cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nikhi...@apache.org
Subject cordova-windows git commit: CB-9025 Removes 'prepare' logic call as part of the 'build'.
Date Thu, 21 May 2015 18:12:21 GMT
Repository: cordova-windows
Updated Branches:
  refs/heads/master 059feacc0 -> 53c593981


CB-9025 Removes 'prepare' logic call as part of the 'build'.


Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/53c59398
Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/53c59398
Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/53c59398

Branch: refs/heads/master
Commit: 53c5939816885479a952c30622d89d9ddfbac614
Parents: 059feac
Author: Vladimir Kotikov <v-vlkoti@microsoft.com>
Authored: Wed May 13 18:54:00 2015 +0300
Committer: Nikhil Khandelwal <nikhilkh@microsoft.com>
Committed: Thu May 21 11:06:46 2015 -0700

----------------------------------------------------------------------
 template/CordovaApp.Windows80.jsproj |  9 +-------
 template/cordova/lib/MSBuildTools.js |  3 +--
 template/cordova/lib/build.js        |  4 ++--
 template/cordova/lib/prepare.js      | 35 ++++++++++++++-----------------
 4 files changed, 20 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/53c59398/template/CordovaApp.Windows80.jsproj
----------------------------------------------------------------------
diff --git a/template/CordovaApp.Windows80.jsproj b/template/CordovaApp.Windows80.jsproj
index 4842dde..5b84ae6 100644
--- a/template/CordovaApp.Windows80.jsproj
+++ b/template/CordovaApp.Windows80.jsproj
@@ -80,11 +80,4 @@
   </ItemGroup>
   <Import Project="CordovaApp.projitems" Label="Shared" />
   <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).targets"
/>
-  <PropertyGroup>
-    <BuildFromCordovaTooling>false</BuildFromCordovaTooling>
-    <PreBuildEvent Condition="$(BuildFromCordovaTooling) != true">
-      cd /d $(MSBuildThisFileDirectory)
-      node -e "require('./cordova/lib/prepare.js').applyPlatformConfig()"
-    </PreBuildEvent>
-  </PropertyGroup>
-</Project>
\ No newline at end of file
+</Project>

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/53c59398/template/cordova/lib/MSBuildTools.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/MSBuildTools.js b/template/cordova/lib/MSBuildTools.js
index 402225d..19278af 100644
--- a/template/cordova/lib/MSBuildTools.js
+++ b/template/cordova/lib/MSBuildTools.js
@@ -36,8 +36,7 @@ MSBuildTools.prototype.buildProject = function(projFile, buildType, buildarch)
{
 
     var args = ['/clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal', '/nologo',
     '/p:Configuration=' + buildType,
-    '/p:Platform=' + buildarch,
-    '/p:BuildFromCordovaTooling=' + true];
+    '/p:Platform=' + buildarch];
 
     return spawn(path.join(this.path, 'msbuild'), [projFile].concat(args));
 };

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/53c59398/template/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/build.js b/template/cordova/lib/build.js
index e567192..37ef935 100644
--- a/template/cordova/lib/build.js
+++ b/template/cordova/lib/build.js
@@ -48,8 +48,8 @@ module.exports.run = function run (argv) {
 
     return Q.all([parseAndValidateArgs(argv), MSBuildTools.findAvailableVersion()])
         .spread(function(buildConfig, msbuildTools) {
-            // update platform as per configuration settings
-            prepare.applyPlatformConfig(buildConfig);
+            // Apply build related configs
+            prepare.updateBuildConfig(buildConfig);
             cleanIntermediates();
             msbuild = msbuildTools;
             console.log('MSBuildToolsPath: ' + msbuild.path);

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/53c59398/template/cordova/lib/prepare.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/prepare.js b/template/cordova/lib/prepare.js
index 485f2d8..2df6067 100644
--- a/template/cordova/lib/prepare.js
+++ b/template/cordova/lib/prepare.js
@@ -48,8 +48,7 @@ var TEMPLATE =
     '<!--\n    This file is automatically generated.\n' +
     '    Do not modify this file - YOUR CHANGES WILL BE ERASED!\n-->\n';
 
-module.exports.applyPlatformConfig = function(buildConfig) {
-    console.log('Applying Platform Config...');
+module.exports.applyPlatformConfig = function() {
 
     var config = new ConfigParser(path.join(ROOT, 'config.xml'));
     var isTargetingWin10 = false;
@@ -58,14 +57,6 @@ module.exports.applyPlatformConfig = function(buildConfig) {
         isTargetingWin10 = true;
     }
 
-    // if no buildConfig is provided dont do anything
-    buildConfig = buildConfig || {};
-
-    // Merge buildConfig with config
-    for (var attr in buildConfig) {
-        config[attr] = buildConfig[attr];
-    }
-
     // Apply appxmanifest changes
     [{ fileName: MANIFEST_WINDOWS,   namespacePrefix: 'm2:' },
      { fileName: MANIFEST_WINDOWS8,  namespacePrefix: '' },
@@ -74,13 +65,6 @@ module.exports.applyPlatformConfig = function(buildConfig) {
             updateManifestFile(config, path.join(ROOT, manifestFile.fileName), manifestFile.namespacePrefix,
null);
     });
 
-    // Apply build related configs
-    if (config.buildType === 'debug') {
-        updateBuildConfig(config, path.join(ROOT, 'CordovaAppDebug.projitems'));
-    } else if(config.buildType === 'release') {
-        updateBuildConfig(config, path.join(ROOT, 'CordovaAppRelease.projitems'));
-    }
-
     // Break out Windows 10-specific functionality because we also need to
     // apply UAP versioning to Windows 10 appx-manifests.
     var uapVersionInfo = getUAPVersions(config);
@@ -97,8 +81,17 @@ module.exports.applyPlatformConfig = function(buildConfig) {
     copyImages(config);
 };
 
+module.exports.updateBuildConfig = function(buildConfig) {
+    var config = new ConfigParser(path.join(ROOT, 'config.xml'));
+
+    // if no buildConfig is provided dont do anything
+    buildConfig = buildConfig || {};
+
+    // Merge buildConfig with config
+    for (var attr in buildConfig) {
+        config[attr] = buildConfig[attr];
+    }
 
-function updateBuildConfig(config, buildConfigFileName) {
     var root = new et.Element('Project');
     root.set('xmlns', 'http://schemas.microsoft.com/developer/msbuild/2003');
     var buildConfigXML =  new et.ElementTree(root);
@@ -137,8 +130,12 @@ function updateBuildConfig(config, buildConfigFileName) {
     defaultLocaleElement.text = defaultLocale;
     propertyGroup.append(defaultLocaleElement);
 
+    var buildConfigFileName = buildConfig.buildType === 'release' ?
+        path.join(ROOT, 'CordovaAppRelease.projitems') :
+        path.join(ROOT, 'CordovaAppDebug.projitems');
+
     fs.writeFileSync(buildConfigFileName, TEMPLATE + buildConfigXML.write({indent: 2, xml_declaration:
false}), 'utf-8');
-}
+};
 
 function updateManifestFile (config, manifestPath, namespacePrefix, uapVersionInfo) {
     var contents = fs.readFileSync(manifestPath, 'utf-8');


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


Mime
View raw message