Repository: cordova-windows Updated Branches: refs/heads/master 57df16dd7 -> 07f6158bc
CB-11024: Add preference to set the min UAP target version in the JSProj File. Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/07f6158b Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/07f6158b Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/07f6158b Branch: refs/heads/master Commit: 07f6158bc24eda28c2946f54b1e3626c7e124c92 Parents: 57df16d Author: Raghav Katyal <rakat...@microsoft.com> Authored: Thu Apr 7 12:14:30 2016 -0700 Committer: Raghav Katyal <rakat...@microsoft.com> Committed: Fri Apr 8 12:05:17 2016 -0700 ---------------------------------------------------------------------- template/cordova/lib/ConfigParser.js | 10 ++++++++++ template/cordova/lib/prepare.js | 10 ++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/07f6158b/template/cordova/lib/ConfigParser.js ---------------------------------------------------------------------- diff --git a/template/cordova/lib/ConfigParser.js b/template/cordova/lib/ConfigParser.js index c9ce6a8..290cb71 100644 --- a/template/cordova/lib/ConfigParser.js +++ b/template/cordova/lib/ConfigParser.js @@ -73,6 +73,16 @@ WindowsConfigParser.prototype.getWindowsTargetVersion = function() { return preference; }; +WindowsConfigParser.prototype.getUAPTargetMinVersion = function() { + var preference = this.getPreference('uap-target-min-version'); + + if (!preference) { + preference = '10.0.10240.0'; // set default to 10.0.10240.0 (initial release) + } + + return preference; +}; + WindowsConfigParser.prototype.getWindowsPhoneTargetVersion = function() { // This is a little more complicated than the previous one. // 1. Check for an explicit preference. If the preference is set explicitly, return that, irrespective of whether it is valid http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/07f6158b/template/cordova/lib/prepare.js ---------------------------------------------------------------------- diff --git a/template/cordova/lib/prepare.js b/template/cordova/lib/prepare.js index f2d560c..9869e06 100644 --- a/template/cordova/lib/prepare.js +++ b/template/cordova/lib/prepare.js @@ -393,7 +393,7 @@ function applyUAPVersionToProject(projectFilePath, uapVersionInfo) { } // returns {minUAPVersion: Version, targetUAPVersion: Version} | false -function getUAPVersions() { +function getUAPVersions(config) { var baselineVersions = MSBuildTools.getAvailableUAPVersions(); if (!baselineVersions || baselineVersions.length === 0) { return false; @@ -401,9 +401,11 @@ function getUAPVersions() { baselineVersions.sort(Version.comparer); + var uapTargetMinPreference = config.getUAPTargetMinVersion(); + return { - minUAPVersion: baselineVersions[0], - targetUAPVersion: baselineVersions[baselineVersions.length - 1] + minUAPVersion: uapTargetMinPreference, + targetUAPVersion: baselineVersions[baselineVersions.length - 1] /* The highest available SDK on the system */ }; } @@ -551,6 +553,6 @@ function updateProjectAccordingTo(projectConfig, locations) { }); if (process.platform === 'win32') { - applyUAPVersionToProject(path.join(locations.root, PROJECT_WINDOWS10), getUAPVersions()); + applyUAPVersionToProject(path.join(locations.root, PROJECT_WINDOWS10), getUAPVersions(projectConfig)); } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org