You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by vladimir-kotikov <gi...@git.apache.org> on 2015/06/23 14:40:56 UTC

[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

GitHub user vladimir-kotikov opened a pull request:

    https://github.com/apache/cordova-windows/pull/92

    CB-9235 Adds more checks based on the windows-target-version

    This is an implementation for [CB-9235](https://issues.apache.org/jira/browse/CB-9235)
    
    The logic of `check_all` method was updated to include additional checks for Visual Studio and  Windows/Windows phone SDKs.
    Also logic of checks has been improved to checks for versions depending on the `windows-target-version` and `windows-phone-target-version` preferences from platform’s config.xml.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MSOpenTech/cordova-windows CB-9235

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-windows/pull/92.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #92
    
----
commit 90a0df174b1d42a269ee5fe89f1d2a445967ae76
Author: Vladimir Kotikov <v-...@microsoft.com>
Date:   2015-06-23T12:14:39Z

    CB-9235 Adds more checks based on the windows-target-version

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on a diff in the pull request:

    https://github.com/apache/cordova-windows/pull/92#discussion_r33998435
  
    --- Diff: bin/lib/check_reqs.js ---
    @@ -19,15 +19,226 @@
     
     /*jshint node:true*/
     
    -var Q     = require('Q');
    +var Q     = require('q');
    +var os    = require('os');
    +var path  = require('path');
    +var shell = require('shelljs');
     
    -var MSBuildTools;
    +var ConfigParser, MSBuildTools, Version, exec;
     try {
    +    ConfigParser = require('../../template/cordova/lib/ConfigParser');
         MSBuildTools = require('../../template/cordova/lib/MSBuildTools');
    +    exec = require('../../template/cordova/lib/exec');
    +    Version = require('../../template/cordova/lib/Version');
     } catch (ex) {
         // If previous import fails, we're probably running this script
         // from installed platform and the module location is different.
    +    ConfigParser = require('./ConfigParser');
         MSBuildTools = require('./MSBuildTools');
    +    exec = require('./exec');
    +    Version = require('./Version');
    +}
    +
    +// The constant for VS2013 Upd2 PackageVersion. See MSDN for
    +// reference: https://msdn.microsoft.com/en-us/library/bb164659(v=vs.120).aspx
    +var VS2013_UPDATE2_RC = new Version(12, 0, 30324);
    +var REQUIRED_VERSIONS = {
    +    '8.0': {
    +        os: '6.1',
    +        msbuild: '11.0',
    +        visualstudio: '11.0',
    +        windowssdk: '8.0'
    +    },
    +    '8.1': {
    +        os: '6.2',
    +        msbuild: '12.0',
    +        visualstudio: '12.0',
    +        windowssdk: '8.1',
    +        phonesdk: '8.1'
    +    },
    +    '10.0': {
    +        os: '6.2',
    --- End diff --
    
    Also, Windows 8 is not supported for Win10 development.  You need Windows 8.1.  So it needs to be the set of (6.1, 6.3, 10.0).  I think you'll have to change your logic.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on the pull request:

    https://github.com/apache/cordova-windows/pull/92#issuecomment-123712167
  
    > When I run this branch on my local, I get an npm test failure for check_reqs.spec.js, failing to find config.xml in cordova-windows root.
    
    Sorry, that was my bad. [Fixed this here](https://github.com/MSOpenTech/cordova-windows/commit/e3f4a7880bbc9a5c3af0f09637235d66fe6762ba#diff-f477d7d5a4a7b8cc0bfe70b71a81920fR71)
    
    > build.spec.js spec.13 fails because it doesn't mock findAllAvailableVersions
    
    I can't repro this. build specs are all passing on my local machine. Probably merge issues?
    
    > make sure your AppVeyor passes - I think it's a problem with check_reqs
    
    AppVeyor tests was failing because AppVeyor machines has UAC disabled (I already mentioned that in one of my PRs, can't find it now), so the `run` command was failing. See https://github.com/apache/cordova-windows/blob/master/template/cordova/lib/run.js#L38. I've updated `run` command and its tests, so this condition is now mocked, and tests are passing even under the elevated prompt.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by sgrebnov <gi...@git.apache.org>.
Github user sgrebnov commented on the pull request:

    https://github.com/apache/cordova-windows/pull/92#issuecomment-125480333
  
    lgtm :+1:  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov closed the pull request at:

    https://github.com/apache/cordova-windows/pull/92


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on the pull request:

    https://github.com/apache/cordova-windows/pull/92#issuecomment-123432180
  
    I'm supposing build.spec.js spec.13 fails because it doesn't mock `findAllAvailableVersions` (or was also `findAvailableVersions` in your code).  I wrote a use case for this in #102 in spec.1; take a look at that and ensure the right code paths.  Otherwise, the merge of #92 and #102 is pretty straightforward.  Before merge, make sure your AppVeyor passes - I think it's a problem with check_reqs.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on the pull request:

    https://github.com/apache/cordova-windows/pull/92#issuecomment-117830645
  
    Why are there AppVeyor failures


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on a diff in the pull request:

    https://github.com/apache/cordova-windows/pull/92#discussion_r33998339
  
    --- Diff: bin/lib/check_reqs.js ---
    @@ -19,15 +19,226 @@
     
     /*jshint node:true*/
     
    -var Q     = require('Q');
    +var Q     = require('q');
    +var os    = require('os');
    +var path  = require('path');
    +var shell = require('shelljs');
     
    -var MSBuildTools;
    +var ConfigParser, MSBuildTools, Version, exec;
     try {
    +    ConfigParser = require('../../template/cordova/lib/ConfigParser');
         MSBuildTools = require('../../template/cordova/lib/MSBuildTools');
    +    exec = require('../../template/cordova/lib/exec');
    +    Version = require('../../template/cordova/lib/Version');
     } catch (ex) {
         // If previous import fails, we're probably running this script
         // from installed platform and the module location is different.
    +    ConfigParser = require('./ConfigParser');
         MSBuildTools = require('./MSBuildTools');
    +    exec = require('./exec');
    +    Version = require('./Version');
    +}
    +
    +// The constant for VS2013 Upd2 PackageVersion. See MSDN for
    +// reference: https://msdn.microsoft.com/en-us/library/bb164659(v=vs.120).aspx
    +var VS2013_UPDATE2_RC = new Version(12, 0, 30324);
    +var REQUIRED_VERSIONS = {
    +    '8.0': {
    +        os: '6.1',
    +        msbuild: '11.0',
    +        visualstudio: '11.0',
    +        windowssdk: '8.0'
    +    },
    +    '8.1': {
    +        os: '6.2',
    +        msbuild: '12.0',
    +        visualstudio: '12.0',
    +        windowssdk: '8.1',
    +        phonesdk: '8.1'
    +    },
    +    '10.0': {
    +        os: '6.2',
    +        msbuild: '14.0',
    +        visualstudio: '14.0',
    +        windowssdk: '10.0',
    +        phonesdk: '10.0'
    +    }
    +};
    +
    +function getMinimalRequiredVersionFor (requirement) {
    +    var config = new ConfigParser(path.join(__dirname, '..', '..', 'config.xml'));
    +
    +    var windowsTargetVersion = config.getWindowsTargetVersion();
    +    var windowsPhoneTargetVersion = config.getWindowsPhoneTargetVersion();
    +    var windowsReqVersion = Version.tryParse(REQUIRED_VERSIONS[windowsTargetVersion][requirement]);
    +    var phoneReqVersion = Version.tryParse(REQUIRED_VERSIONS[windowsPhoneTargetVersion][requirement]);
    +
    +    // If we're searching for Windows SDK, we're not
    +    // interested in Phone's version and and vice versa.
    +    if (requirement === 'windowssdk') return windowsReqVersion;
    +    if (requirement === 'phonesdk') return phoneReqVersion;
    +
    +    // If both windowsReqVersion and phoneReqVersion is valid Versions, choose the max one
    +    if (windowsReqVersion && phoneReqVersion) {
    +        return windowsReqVersion.gt(phoneReqVersion) ?
    +            windowsReqVersion :
    +            phoneReqVersion;
    +    }
    +
    +    // Otherwise return that one which is defined and valid
    +    return windowsReqVersion || phoneReqVersion;
    +}
    +
    +function getHighestAppropriateVersion (versions, requiredVersion) {
    +    return versions.map(function (version) {
    +        return Version.tryParse(version);
    +    })
    +    .sort(Version.comparer)
    +    .filter(function (toolVersion) {
    +        return toolVersion.gte(requiredVersion);
    +    })[0];
    +}
    +
    +/**
    + * Return Version object for current Windows version. User 'ver' binary or
    + *   os.release() in case of errors.
    + *
    + * @return  {Version}  Version information for current OS.
    + */
    +function getWindowsVersion() {
    +    return exec('ver').then(function (output) {
    +        var match = /\[Version (.*)\]\s*$/.exec(output);
    +        return Version.fromString(match[1]);
    +    }).fail(function () {
    +        return Version.fromString(os.release());
    +    });
    +}
    +
    +/**
    + * Lists all Visual Studio versions insalled. For VS 2013 if it present, alao
    + *   checks if Update 2 is installed.
    + *
    + * @return  {String[]}  List of installed Visual Studio versions.
    + */
    +function getInstalledVSVersions() {
    +    // Query all keys with Install value equal to 1, then filter out
    +    // those, which are not related to VS itself
    +    return exec('reg query HKLM\\SOFTWARE\\Microsoft\\DevDiv\\vs\\Servicing /s /v Install /f 1 /d /e /reg:32')
    +    .fail(function () { return ''; })
    +    .then(function (output) {
    +        return output.split('\n')
    +        .reduce(function (installedVersions, line) {
    +            var match = /(\d+\.\d+)\\(ultimate|professional|premium|community)/.exec(line);
    +            if (match && match[1] && installedVersions.indexOf(match[1]) === -1)
    +                installedVersions.push(match[1]);
    +            return installedVersions;
    +        }, []);
    +    })
    +    .then(function (installedVersions) {
    +        // If there is no VS2013 installed, the we have nothing to do
    +        if (installedVersions.indexOf('12.0') === -1) return installedVersions;
    +
    +        // special case for VS 2013. We need to check if VS2013 update 2 is installed
    +        return exec('reg query "HKLM\\SOFTWARE\\Microsoft\\Updates\\Microsoft Visual Studio' +
    +            ' 2013\\vsupdate_KB2829760" /v PackageVersion /reg:32')
    +        .then(function (output) {
    +            var updateVer = Version.fromString(/PackageVersion\s+REG_SZ\s+(.*)/i.exec(output)[1]);
    +            // if update version is lover than Update2, reject the promise
    +            if (VS2013_UPDATE2_RC.gte(updateVer)) return Q.reject();
    +            return installedVersions;
    +        })
    +        .fail(function () {
    +            // if we got any errors on previous steps, we're assuming that
    +            // required VS update is not installed.
    +            installedVersions.splice(installedVersions.indexOf('12.0'));
    +            return installedVersions;
    +        });
    +    });
    +}
    +
    +/**
    + * Gets list of installed Windows SDKs
    + *
    + * @return  {Version[]}  List of installed SDKs' versions
    + */
    +function getInstalledWindowsSdks () {
    +    var installedSdks = [];
    +    return exec('reg query "HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows" /s /v InstallationFolder /reg:32')
    +    .fail(function () { return ''; })
    +    .then(function (output) {
    +        var re = /\\Microsoft SDKs\\Windows\\v(\d+\.\d+)\s*InstallationFolder\s+REG_SZ\s+(.*)/gim;
    +        var match;
    +        while ((match = re.exec(output))){
    +            var sdkPath = match[2];
    +            // Verify that SDKs is really installed by checking SDKManifest file at SDK root
    +            if (shell.test('-e', path.join(sdkPath, 'SDKManifest.xml'))) {
    +                installedSdks.push(Version.tryParse(match[1]));
    +            }
    +        }
    +    })
    +    .thenResolve(installedSdks);
    +}
    +
    +/**
    + * Gets list of installed Windows Phone SDKs. Separately searches for 8.1 Phone
    + *   SDK and Windows 10 SDK, because the latter is needed for both Windows and
    + *   Windows Phone applications.
    + *
    + * @return  {Version[]}  List of installed Phone SDKs' versions.
    + */
    +function getInstalledPhoneSdks () {
    --- End diff --
    
    This doesn't match Windows 10, right?  This is explicitly only for WinPhone8.1?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on the pull request:

    https://github.com/apache/cordova-windows/pull/92#issuecomment-117930344
  
    I've slightly changed `Version` module to allow to accept incomplete version strings, but forgot ro check  test results :( However, if the test for incomplete strings is failing, this might be done intentionally. @robpaveza, could you please confirm that?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on the pull request:

    https://github.com/apache/cordova-windows/pull/92#issuecomment-123412166
  
    I'm checking out how it works with #102 .  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on the pull request:

    https://github.com/apache/cordova-windows/pull/92#issuecomment-123430303
  
    build.spec.js spec.13 fails.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on a diff in the pull request:

    https://github.com/apache/cordova-windows/pull/92#discussion_r33998401
  
    --- Diff: bin/lib/check_reqs.js ---
    @@ -19,15 +19,226 @@
     
     /*jshint node:true*/
     
    -var Q     = require('Q');
    +var Q     = require('q');
    +var os    = require('os');
    +var path  = require('path');
    +var shell = require('shelljs');
     
    -var MSBuildTools;
    +var ConfigParser, MSBuildTools, Version, exec;
     try {
    +    ConfigParser = require('../../template/cordova/lib/ConfigParser');
         MSBuildTools = require('../../template/cordova/lib/MSBuildTools');
    +    exec = require('../../template/cordova/lib/exec');
    +    Version = require('../../template/cordova/lib/Version');
     } catch (ex) {
         // If previous import fails, we're probably running this script
         // from installed platform and the module location is different.
    +    ConfigParser = require('./ConfigParser');
         MSBuildTools = require('./MSBuildTools');
    +    exec = require('./exec');
    +    Version = require('./Version');
    +}
    +
    +// The constant for VS2013 Upd2 PackageVersion. See MSDN for
    +// reference: https://msdn.microsoft.com/en-us/library/bb164659(v=vs.120).aspx
    +var VS2013_UPDATE2_RC = new Version(12, 0, 30324);
    +var REQUIRED_VERSIONS = {
    +    '8.0': {
    +        os: '6.1',
    +        msbuild: '11.0',
    +        visualstudio: '11.0',
    +        windowssdk: '8.0'
    +    },
    +    '8.1': {
    +        os: '6.2',
    +        msbuild: '12.0',
    +        visualstudio: '12.0',
    +        windowssdk: '8.1',
    +        phonesdk: '8.1'
    +    },
    +    '10.0': {
    +        os: '6.2',
    --- End diff --
    
    I think this is incorrect, I think it's actually 6.1 (Windows 7).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on the pull request:

    https://github.com/apache/cordova-windows/pull/92#issuecomment-124020906
  
    > AppVeyor tests was failing because AppVeyor machines has UAC disabled (I already mentioned that in one of my PRs, can't find it now)
    
    Found it: https://github.com/apache/cordova-windows/pull/99


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-windows/pull/92#discussion_r34019903
  
    --- Diff: bin/lib/check_reqs.js ---
    @@ -19,15 +19,226 @@
     
     /*jshint node:true*/
     
    -var Q     = require('Q');
    +var Q     = require('q');
    +var os    = require('os');
    +var path  = require('path');
    +var shell = require('shelljs');
     
    -var MSBuildTools;
    +var ConfigParser, MSBuildTools, Version, exec;
     try {
    +    ConfigParser = require('../../template/cordova/lib/ConfigParser');
         MSBuildTools = require('../../template/cordova/lib/MSBuildTools');
    +    exec = require('../../template/cordova/lib/exec');
    +    Version = require('../../template/cordova/lib/Version');
     } catch (ex) {
         // If previous import fails, we're probably running this script
         // from installed platform and the module location is different.
    +    ConfigParser = require('./ConfigParser');
         MSBuildTools = require('./MSBuildTools');
    +    exec = require('./exec');
    +    Version = require('./Version');
    +}
    +
    +// The constant for VS2013 Upd2 PackageVersion. See MSDN for
    +// reference: https://msdn.microsoft.com/en-us/library/bb164659(v=vs.120).aspx
    +var VS2013_UPDATE2_RC = new Version(12, 0, 30324);
    +var REQUIRED_VERSIONS = {
    +    '8.0': {
    +        os: '6.1',
    +        msbuild: '11.0',
    +        visualstudio: '11.0',
    +        windowssdk: '8.0'
    +    },
    +    '8.1': {
    +        os: '6.2',
    +        msbuild: '12.0',
    +        visualstudio: '12.0',
    +        windowssdk: '8.1',
    +        phonesdk: '8.1'
    +    },
    +    '10.0': {
    +        os: '6.2',
    +        msbuild: '14.0',
    +        visualstudio: '14.0',
    +        windowssdk: '10.0',
    +        phonesdk: '10.0'
    +    }
    +};
    +
    +function getMinimalRequiredVersionFor (requirement) {
    +    var config = new ConfigParser(path.join(__dirname, '..', '..', 'config.xml'));
    +
    +    var windowsTargetVersion = config.getWindowsTargetVersion();
    +    var windowsPhoneTargetVersion = config.getWindowsPhoneTargetVersion();
    +    var windowsReqVersion = Version.tryParse(REQUIRED_VERSIONS[windowsTargetVersion][requirement]);
    +    var phoneReqVersion = Version.tryParse(REQUIRED_VERSIONS[windowsPhoneTargetVersion][requirement]);
    +
    +    // If we're searching for Windows SDK, we're not
    +    // interested in Phone's version and and vice versa.
    +    if (requirement === 'windowssdk') return windowsReqVersion;
    +    if (requirement === 'phonesdk') return phoneReqVersion;
    +
    +    // If both windowsReqVersion and phoneReqVersion is valid Versions, choose the max one
    +    if (windowsReqVersion && phoneReqVersion) {
    +        return windowsReqVersion.gt(phoneReqVersion) ?
    +            windowsReqVersion :
    +            phoneReqVersion;
    +    }
    +
    +    // Otherwise return that one which is defined and valid
    +    return windowsReqVersion || phoneReqVersion;
    +}
    +
    +function getHighestAppropriateVersion (versions, requiredVersion) {
    +    return versions.map(function (version) {
    +        return Version.tryParse(version);
    +    })
    +    .sort(Version.comparer)
    +    .filter(function (toolVersion) {
    +        return toolVersion.gte(requiredVersion);
    +    })[0];
    +}
    +
    +/**
    + * Return Version object for current Windows version. User 'ver' binary or
    + *   os.release() in case of errors.
    + *
    + * @return  {Version}  Version information for current OS.
    + */
    +function getWindowsVersion() {
    +    return exec('ver').then(function (output) {
    +        var match = /\[Version (.*)\]\s*$/.exec(output);
    +        return Version.fromString(match[1]);
    +    }).fail(function () {
    +        return Version.fromString(os.release());
    +    });
    +}
    +
    +/**
    + * Lists all Visual Studio versions insalled. For VS 2013 if it present, alao
    + *   checks if Update 2 is installed.
    + *
    + * @return  {String[]}  List of installed Visual Studio versions.
    + */
    +function getInstalledVSVersions() {
    +    // Query all keys with Install value equal to 1, then filter out
    +    // those, which are not related to VS itself
    +    return exec('reg query HKLM\\SOFTWARE\\Microsoft\\DevDiv\\vs\\Servicing /s /v Install /f 1 /d /e /reg:32')
    +    .fail(function () { return ''; })
    +    .then(function (output) {
    +        return output.split('\n')
    +        .reduce(function (installedVersions, line) {
    +            var match = /(\d+\.\d+)\\(ultimate|professional|premium|community)/.exec(line);
    +            if (match && match[1] && installedVersions.indexOf(match[1]) === -1)
    +                installedVersions.push(match[1]);
    +            return installedVersions;
    +        }, []);
    +    })
    +    .then(function (installedVersions) {
    +        // If there is no VS2013 installed, the we have nothing to do
    +        if (installedVersions.indexOf('12.0') === -1) return installedVersions;
    +
    +        // special case for VS 2013. We need to check if VS2013 update 2 is installed
    +        return exec('reg query "HKLM\\SOFTWARE\\Microsoft\\Updates\\Microsoft Visual Studio' +
    +            ' 2013\\vsupdate_KB2829760" /v PackageVersion /reg:32')
    +        .then(function (output) {
    +            var updateVer = Version.fromString(/PackageVersion\s+REG_SZ\s+(.*)/i.exec(output)[1]);
    +            // if update version is lover than Update2, reject the promise
    +            if (VS2013_UPDATE2_RC.gte(updateVer)) return Q.reject();
    +            return installedVersions;
    +        })
    +        .fail(function () {
    +            // if we got any errors on previous steps, we're assuming that
    +            // required VS update is not installed.
    +            installedVersions.splice(installedVersions.indexOf('12.0'));
    +            return installedVersions;
    +        });
    +    });
    +}
    +
    +/**
    + * Gets list of installed Windows SDKs
    + *
    + * @return  {Version[]}  List of installed SDKs' versions
    + */
    +function getInstalledWindowsSdks () {
    +    var installedSdks = [];
    +    return exec('reg query "HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows" /s /v InstallationFolder /reg:32')
    +    .fail(function () { return ''; })
    +    .then(function (output) {
    +        var re = /\\Microsoft SDKs\\Windows\\v(\d+\.\d+)\s*InstallationFolder\s+REG_SZ\s+(.*)/gim;
    +        var match;
    +        while ((match = re.exec(output))){
    +            var sdkPath = match[2];
    +            // Verify that SDKs is really installed by checking SDKManifest file at SDK root
    +            if (shell.test('-e', path.join(sdkPath, 'SDKManifest.xml'))) {
    +                installedSdks.push(Version.tryParse(match[1]));
    +            }
    +        }
    +    })
    +    .thenResolve(installedSdks);
    +}
    +
    +/**
    + * Gets list of installed Windows Phone SDKs. Separately searches for 8.1 Phone
    + *   SDK and Windows 10 SDK, because the latter is needed for both Windows and
    + *   Windows Phone applications.
    + *
    + * @return  {Version[]}  List of installed Phone SDKs' versions.
    + */
    +function getInstalledPhoneSdks () {
    --- End diff --
    
    No, this searches for both WP8.1 and Win10 SDKs - Win10 SDK is required wor building WP10 apps.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on the pull request:

    https://github.com/apache/cordova-windows/pull/92#issuecomment-118113194
  
    @robpaveza Can you please take a look?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on a diff in the pull request:

    https://github.com/apache/cordova-windows/pull/92#discussion_r33998489
  
    --- Diff: bin/lib/check_reqs.js ---
    @@ -19,15 +19,226 @@
     
     /*jshint node:true*/
     
    -var Q     = require('Q');
    +var Q     = require('q');
    +var os    = require('os');
    +var path  = require('path');
    +var shell = require('shelljs');
     
    -var MSBuildTools;
    +var ConfigParser, MSBuildTools, Version, exec;
     try {
    +    ConfigParser = require('../../template/cordova/lib/ConfigParser');
         MSBuildTools = require('../../template/cordova/lib/MSBuildTools');
    +    exec = require('../../template/cordova/lib/exec');
    +    Version = require('../../template/cordova/lib/Version');
     } catch (ex) {
         // If previous import fails, we're probably running this script
         // from installed platform and the module location is different.
    +    ConfigParser = require('./ConfigParser');
         MSBuildTools = require('./MSBuildTools');
    +    exec = require('./exec');
    +    Version = require('./Version');
    +}
    +
    +// The constant for VS2013 Upd2 PackageVersion. See MSDN for
    +// reference: https://msdn.microsoft.com/en-us/library/bb164659(v=vs.120).aspx
    +var VS2013_UPDATE2_RC = new Version(12, 0, 30324);
    +var REQUIRED_VERSIONS = {
    +    '8.0': {
    +        os: '6.1',
    +        msbuild: '11.0',
    +        visualstudio: '11.0',
    +        windowssdk: '8.0'
    +    },
    +    '8.1': {
    +        os: '6.2',
    +        msbuild: '12.0',
    +        visualstudio: '12.0',
    +        windowssdk: '8.1',
    +        phonesdk: '8.1'
    +    },
    +    '10.0': {
    +        os: '6.2',
    +        msbuild: '14.0',
    +        visualstudio: '14.0',
    +        windowssdk: '10.0',
    +        phonesdk: '10.0'
    +    }
    +};
    +
    +function getMinimalRequiredVersionFor (requirement) {
    +    var config = new ConfigParser(path.join(__dirname, '..', '..', 'config.xml'));
    +
    +    var windowsTargetVersion = config.getWindowsTargetVersion();
    +    var windowsPhoneTargetVersion = config.getWindowsPhoneTargetVersion();
    +    var windowsReqVersion = Version.tryParse(REQUIRED_VERSIONS[windowsTargetVersion][requirement]);
    +    var phoneReqVersion = Version.tryParse(REQUIRED_VERSIONS[windowsPhoneTargetVersion][requirement]);
    +
    +    // If we're searching for Windows SDK, we're not
    +    // interested in Phone's version and and vice versa.
    +    if (requirement === 'windowssdk') return windowsReqVersion;
    +    if (requirement === 'phonesdk') return phoneReqVersion;
    +
    +    // If both windowsReqVersion and phoneReqVersion is valid Versions, choose the max one
    +    if (windowsReqVersion && phoneReqVersion) {
    +        return windowsReqVersion.gt(phoneReqVersion) ?
    +            windowsReqVersion :
    +            phoneReqVersion;
    +    }
    +
    +    // Otherwise return that one which is defined and valid
    +    return windowsReqVersion || phoneReqVersion;
    +}
    +
    +function getHighestAppropriateVersion (versions, requiredVersion) {
    +    return versions.map(function (version) {
    +        return Version.tryParse(version);
    +    })
    +    .sort(Version.comparer)
    +    .filter(function (toolVersion) {
    +        return toolVersion.gte(requiredVersion);
    +    })[0];
    +}
    +
    +/**
    + * Return Version object for current Windows version. User 'ver' binary or
    + *   os.release() in case of errors.
    + *
    + * @return  {Version}  Version information for current OS.
    + */
    +function getWindowsVersion() {
    +    return exec('ver').then(function (output) {
    +        var match = /\[Version (.*)\]\s*$/.exec(output);
    +        return Version.fromString(match[1]);
    +    }).fail(function () {
    +        return Version.fromString(os.release());
    +    });
    +}
    +
    +/**
    + * Lists all Visual Studio versions insalled. For VS 2013 if it present, alao
    + *   checks if Update 2 is installed.
    + *
    + * @return  {String[]}  List of installed Visual Studio versions.
    + */
    +function getInstalledVSVersions() {
    +    // Query all keys with Install value equal to 1, then filter out
    +    // those, which are not related to VS itself
    +    return exec('reg query HKLM\\SOFTWARE\\Microsoft\\DevDiv\\vs\\Servicing /s /v Install /f 1 /d /e /reg:32')
    +    .fail(function () { return ''; })
    +    .then(function (output) {
    +        return output.split('\n')
    +        .reduce(function (installedVersions, line) {
    +            var match = /(\d+\.\d+)\\(ultimate|professional|premium|community)/.exec(line);
    +            if (match && match[1] && installedVersions.indexOf(match[1]) === -1)
    +                installedVersions.push(match[1]);
    +            return installedVersions;
    +        }, []);
    +    })
    +    .then(function (installedVersions) {
    +        // If there is no VS2013 installed, the we have nothing to do
    +        if (installedVersions.indexOf('12.0') === -1) return installedVersions;
    +
    +        // special case for VS 2013. We need to check if VS2013 update 2 is installed
    +        return exec('reg query "HKLM\\SOFTWARE\\Microsoft\\Updates\\Microsoft Visual Studio' +
    +            ' 2013\\vsupdate_KB2829760" /v PackageVersion /reg:32')
    +        .then(function (output) {
    +            var updateVer = Version.fromString(/PackageVersion\s+REG_SZ\s+(.*)/i.exec(output)[1]);
    +            // if update version is lover than Update2, reject the promise
    +            if (VS2013_UPDATE2_RC.gte(updateVer)) return Q.reject();
    +            return installedVersions;
    +        })
    +        .fail(function () {
    +            // if we got any errors on previous steps, we're assuming that
    +            // required VS update is not installed.
    +            installedVersions.splice(installedVersions.indexOf('12.0'));
    +            return installedVersions;
    +        });
    +    });
    +}
    +
    +/**
    + * Gets list of installed Windows SDKs
    + *
    + * @return  {Version[]}  List of installed SDKs' versions
    + */
    +function getInstalledWindowsSdks () {
    +    var installedSdks = [];
    +    return exec('reg query "HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows" /s /v InstallationFolder /reg:32')
    +    .fail(function () { return ''; })
    +    .then(function (output) {
    +        var re = /\\Microsoft SDKs\\Windows\\v(\d+\.\d+)\s*InstallationFolder\s+REG_SZ\s+(.*)/gim;
    +        var match;
    +        while ((match = re.exec(output))){
    +            var sdkPath = match[2];
    +            // Verify that SDKs is really installed by checking SDKManifest file at SDK root
    +            if (shell.test('-e', path.join(sdkPath, 'SDKManifest.xml'))) {
    +                installedSdks.push(Version.tryParse(match[1]));
    +            }
    +        }
    +    })
    +    .thenResolve(installedSdks);
    +}
    +
    +/**
    + * Gets list of installed Windows Phone SDKs. Separately searches for 8.1 Phone
    + *   SDK and Windows 10 SDK, because the latter is needed for both Windows and
    + *   Windows Phone applications.
    + *
    + * @return  {Version[]}  List of installed Phone SDKs' versions.
    + */
    +function getInstalledPhoneSdks () {
    +    var installedSdks = [];
    +    return exec('reg query "HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows Phone\\v8.1" /v InstallationFolder /reg:32')
    +    .fail(function () { return ''; })
    +    .then(function (output) {
    +        var match = /\\Microsoft SDKs\\Windows Phone\\v(\d+\.\d+)\s*InstallationFolder\s+REG_SZ\s+(.*)/gim.exec(output);
    +        if (match && shell.test('-e', path.join(match[2], 'SDKManifest.xml'))) {
    +            installedSdks.push(Version.tryParse(match[1]));
    +        }
    +    })
    +    .then(function () {
    +        return exec('reg query "HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v10.0" /v InstallationFolder /reg:32');
    +    })
    +    .fail(function () { return ''; })
    +    .then(function (output) {
    +        var match = /\\Microsoft SDKs\\Windows\\v(\d+\.\d+)\s*InstallationFolder\s+REG_SZ\s+(.*)/gim.exec(output);
    +        if (match && shell.test('-e', path.join(match[2], 'SDKManifest.xml'))) {
    +            installedSdks.push(Version.tryParse(match[1]));
    +        }
    +    })
    +    .thenResolve(installedSdks);
    +}
    +
    +/**
    + * Shortens version string or Version object by leaving only first two segments
    + *   (major and minor).
    + * @param   {String|Version}  version  The version identifier. Either Version
    + *   object or string that looks like "12.5.6"
    + * @return  {String}          Shortened version, or undefined if provided
    + *   parameter is not a valid version
    + */
    +function shortenVersion (version) {
    +    return /^(\d+(?:\.\d+)?)/.exec(version.toString())[1];
    +}
    +
    +function mapWindowsVersionToName(version) {
    +    var map = {
    +        '6.2': 'Windows 8',
    +        '6.3': 'Windows 8.1',
    +        '10.0': 'Windows 10'
    +    };
    +    var majorMinor = shortenVersion(version);
    +    return map[majorMinor];
    +}
    +
    +function mapVSVersionToName(version) {
    +    var map = {
    --- End diff --
    
    You might suggest "2012 Express for Windows", "2013 Express for Windows", "2015 Community" to be specific.  Our documentation is incorrectly specific because it says "Professional."


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-windows/pull/92#discussion_r34036020
  
    --- Diff: bin/lib/check_reqs.js ---
    @@ -19,15 +19,226 @@
     
     /*jshint node:true*/
     
    -var Q     = require('Q');
    +var Q     = require('q');
    +var os    = require('os');
    +var path  = require('path');
    +var shell = require('shelljs');
     
    -var MSBuildTools;
    +var ConfigParser, MSBuildTools, Version, exec;
     try {
    +    ConfigParser = require('../../template/cordova/lib/ConfigParser');
         MSBuildTools = require('../../template/cordova/lib/MSBuildTools');
    +    exec = require('../../template/cordova/lib/exec');
    +    Version = require('../../template/cordova/lib/Version');
     } catch (ex) {
         // If previous import fails, we're probably running this script
         // from installed platform and the module location is different.
    +    ConfigParser = require('./ConfigParser');
         MSBuildTools = require('./MSBuildTools');
    +    exec = require('./exec');
    +    Version = require('./Version');
    +}
    +
    +// The constant for VS2013 Upd2 PackageVersion. See MSDN for
    +// reference: https://msdn.microsoft.com/en-us/library/bb164659(v=vs.120).aspx
    +var VS2013_UPDATE2_RC = new Version(12, 0, 30324);
    +var REQUIRED_VERSIONS = {
    +    '8.0': {
    +        os: '6.1',
    +        msbuild: '11.0',
    +        visualstudio: '11.0',
    +        windowssdk: '8.0'
    +    },
    +    '8.1': {
    +        os: '6.2',
    +        msbuild: '12.0',
    +        visualstudio: '12.0',
    +        windowssdk: '8.1',
    +        phonesdk: '8.1'
    +    },
    +    '10.0': {
    +        os: '6.2',
    +        msbuild: '14.0',
    +        visualstudio: '14.0',
    +        windowssdk: '10.0',
    +        phonesdk: '10.0'
    +    }
    +};
    +
    +function getMinimalRequiredVersionFor (requirement) {
    +    var config = new ConfigParser(path.join(__dirname, '..', '..', 'config.xml'));
    +
    +    var windowsTargetVersion = config.getWindowsTargetVersion();
    +    var windowsPhoneTargetVersion = config.getWindowsPhoneTargetVersion();
    +    var windowsReqVersion = Version.tryParse(REQUIRED_VERSIONS[windowsTargetVersion][requirement]);
    +    var phoneReqVersion = Version.tryParse(REQUIRED_VERSIONS[windowsPhoneTargetVersion][requirement]);
    +
    +    // If we're searching for Windows SDK, we're not
    +    // interested in Phone's version and and vice versa.
    +    if (requirement === 'windowssdk') return windowsReqVersion;
    +    if (requirement === 'phonesdk') return phoneReqVersion;
    +
    +    // If both windowsReqVersion and phoneReqVersion is valid Versions, choose the max one
    +    if (windowsReqVersion && phoneReqVersion) {
    +        return windowsReqVersion.gt(phoneReqVersion) ?
    +            windowsReqVersion :
    +            phoneReqVersion;
    +    }
    +
    +    // Otherwise return that one which is defined and valid
    +    return windowsReqVersion || phoneReqVersion;
    +}
    +
    +function getHighestAppropriateVersion (versions, requiredVersion) {
    +    return versions.map(function (version) {
    +        return Version.tryParse(version);
    +    })
    +    .sort(Version.comparer)
    +    .filter(function (toolVersion) {
    +        return toolVersion.gte(requiredVersion);
    +    })[0];
    +}
    +
    +/**
    + * Return Version object for current Windows version. User 'ver' binary or
    + *   os.release() in case of errors.
    + *
    + * @return  {Version}  Version information for current OS.
    + */
    +function getWindowsVersion() {
    +    return exec('ver').then(function (output) {
    +        var match = /\[Version (.*)\]\s*$/.exec(output);
    +        return Version.fromString(match[1]);
    +    }).fail(function () {
    +        return Version.fromString(os.release());
    +    });
    +}
    +
    +/**
    + * Lists all Visual Studio versions insalled. For VS 2013 if it present, alao
    + *   checks if Update 2 is installed.
    + *
    + * @return  {String[]}  List of installed Visual Studio versions.
    + */
    +function getInstalledVSVersions() {
    +    // Query all keys with Install value equal to 1, then filter out
    +    // those, which are not related to VS itself
    +    return exec('reg query HKLM\\SOFTWARE\\Microsoft\\DevDiv\\vs\\Servicing /s /v Install /f 1 /d /e /reg:32')
    +    .fail(function () { return ''; })
    +    .then(function (output) {
    +        return output.split('\n')
    +        .reduce(function (installedVersions, line) {
    +            var match = /(\d+\.\d+)\\(ultimate|professional|premium|community)/.exec(line);
    +            if (match && match[1] && installedVersions.indexOf(match[1]) === -1)
    +                installedVersions.push(match[1]);
    +            return installedVersions;
    +        }, []);
    +    })
    +    .then(function (installedVersions) {
    +        // If there is no VS2013 installed, the we have nothing to do
    +        if (installedVersions.indexOf('12.0') === -1) return installedVersions;
    +
    +        // special case for VS 2013. We need to check if VS2013 update 2 is installed
    +        return exec('reg query "HKLM\\SOFTWARE\\Microsoft\\Updates\\Microsoft Visual Studio' +
    +            ' 2013\\vsupdate_KB2829760" /v PackageVersion /reg:32')
    +        .then(function (output) {
    +            var updateVer = Version.fromString(/PackageVersion\s+REG_SZ\s+(.*)/i.exec(output)[1]);
    +            // if update version is lover than Update2, reject the promise
    +            if (VS2013_UPDATE2_RC.gte(updateVer)) return Q.reject();
    +            return installedVersions;
    +        })
    +        .fail(function () {
    +            // if we got any errors on previous steps, we're assuming that
    +            // required VS update is not installed.
    +            installedVersions.splice(installedVersions.indexOf('12.0'));
    +            return installedVersions;
    +        });
    +    });
    +}
    +
    +/**
    + * Gets list of installed Windows SDKs
    + *
    + * @return  {Version[]}  List of installed SDKs' versions
    + */
    +function getInstalledWindowsSdks () {
    +    var installedSdks = [];
    +    return exec('reg query "HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows" /s /v InstallationFolder /reg:32')
    +    .fail(function () { return ''; })
    +    .then(function (output) {
    +        var re = /\\Microsoft SDKs\\Windows\\v(\d+\.\d+)\s*InstallationFolder\s+REG_SZ\s+(.*)/gim;
    +        var match;
    +        while ((match = re.exec(output))){
    +            var sdkPath = match[2];
    +            // Verify that SDKs is really installed by checking SDKManifest file at SDK root
    +            if (shell.test('-e', path.join(sdkPath, 'SDKManifest.xml'))) {
    +                installedSdks.push(Version.tryParse(match[1]));
    +            }
    +        }
    +    })
    +    .thenResolve(installedSdks);
    +}
    +
    +/**
    + * Gets list of installed Windows Phone SDKs. Separately searches for 8.1 Phone
    + *   SDK and Windows 10 SDK, because the latter is needed for both Windows and
    + *   Windows Phone applications.
    + *
    + * @return  {Version[]}  List of installed Phone SDKs' versions.
    + */
    +function getInstalledPhoneSdks () {
    +    var installedSdks = [];
    +    return exec('reg query "HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows Phone\\v8.1" /v InstallationFolder /reg:32')
    +    .fail(function () { return ''; })
    +    .then(function (output) {
    +        var match = /\\Microsoft SDKs\\Windows Phone\\v(\d+\.\d+)\s*InstallationFolder\s+REG_SZ\s+(.*)/gim.exec(output);
    +        if (match && shell.test('-e', path.join(match[2], 'SDKManifest.xml'))) {
    +            installedSdks.push(Version.tryParse(match[1]));
    +        }
    +    })
    +    .then(function () {
    +        return exec('reg query "HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v10.0" /v InstallationFolder /reg:32');
    +    })
    +    .fail(function () { return ''; })
    +    .then(function (output) {
    +        var match = /\\Microsoft SDKs\\Windows\\v(\d+\.\d+)\s*InstallationFolder\s+REG_SZ\s+(.*)/gim.exec(output);
    +        if (match && shell.test('-e', path.join(match[2], 'SDKManifest.xml'))) {
    +            installedSdks.push(Version.tryParse(match[1]));
    +        }
    +    })
    +    .thenResolve(installedSdks);
    +}
    +
    +/**
    + * Shortens version string or Version object by leaving only first two segments
    + *   (major and minor).
    + * @param   {String|Version}  version  The version identifier. Either Version
    + *   object or string that looks like "12.5.6"
    + * @return  {String}          Shortened version, or undefined if provided
    + *   parameter is not a valid version
    + */
    +function shortenVersion (version) {
    +    return /^(\d+(?:\.\d+)?)/.exec(version.toString())[1];
    +}
    +
    +function mapWindowsVersionToName(version) {
    +    var map = {
    +        '6.2': 'Windows 8',
    +        '6.3': 'Windows 8.1',
    +        '10.0': 'Windows 10'
    +    };
    +    var majorMinor = shortenVersion(version);
    +    return map[majorMinor];
    +}
    +
    +function mapVSVersionToName(version) {
    +    var map = {
    --- End diff --
    
    Done.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on the pull request:

    https://github.com/apache/cordova-windows/pull/92#issuecomment-123413927
  
    When I run this branch on my local, I get an npm test failure for check_reqs.spec.js, failing to find config.xml in cordova-windows root.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on the pull request:

    https://github.com/apache/cordova-windows/pull/92#issuecomment-125482377
  
    This was merged in 9be50cd43a893f6af532b585baa7fa00e71772c9 but not auto-closed. Closing it now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-windows pull request: CB-9235 Adds more checks based on th...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-windows/pull/92#discussion_r34035987
  
    --- Diff: bin/lib/check_reqs.js ---
    @@ -19,15 +19,226 @@
     
     /*jshint node:true*/
     
    -var Q     = require('Q');
    +var Q     = require('q');
    +var os    = require('os');
    +var path  = require('path');
    +var shell = require('shelljs');
     
    -var MSBuildTools;
    +var ConfigParser, MSBuildTools, Version, exec;
     try {
    +    ConfigParser = require('../../template/cordova/lib/ConfigParser');
         MSBuildTools = require('../../template/cordova/lib/MSBuildTools');
    +    exec = require('../../template/cordova/lib/exec');
    +    Version = require('../../template/cordova/lib/Version');
     } catch (ex) {
         // If previous import fails, we're probably running this script
         // from installed platform and the module location is different.
    +    ConfigParser = require('./ConfigParser');
         MSBuildTools = require('./MSBuildTools');
    +    exec = require('./exec');
    +    Version = require('./Version');
    +}
    +
    +// The constant for VS2013 Upd2 PackageVersion. See MSDN for
    +// reference: https://msdn.microsoft.com/en-us/library/bb164659(v=vs.120).aspx
    +var VS2013_UPDATE2_RC = new Version(12, 0, 30324);
    +var REQUIRED_VERSIONS = {
    +    '8.0': {
    +        os: '6.1',
    +        msbuild: '11.0',
    +        visualstudio: '11.0',
    +        windowssdk: '8.0'
    +    },
    +    '8.1': {
    +        os: '6.2',
    +        msbuild: '12.0',
    +        visualstudio: '12.0',
    +        windowssdk: '8.1',
    +        phonesdk: '8.1'
    +    },
    +    '10.0': {
    +        os: '6.2',
    --- End diff --
    
    I've realized that there is another mistake from my side: there should be something like:
    ```javascript
    '8.0': {
        os: '6.2', // instead of 6.1
        ...
    },
    '8.1': {
        os: '6.3', // instead of 6.2
        ...
    },
    '10.0': {
        os: '6.3', // Note that Windows 10 target is supported on Windows 7.
        ...        // This case get handled in checkOS function separately
        ...
    ``` 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org