You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by da...@apache.org on 2017/02/07 12:44:11 UTC

[1/4] cordova-windows git commit: CB-12416 (Windows) Built bundles are misplaced when building for multiple archs

Repository: cordova-windows
Updated Branches:
  refs/heads/5.0.x 9edcf26b2 -> 75d7bcf01


CB-12416 (Windows) Built bundles are misplaced when building for multiple archs

Added scale-240 exclude back to avoid an empty Windows 10 package creation
This closes #226


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

Branch: refs/heads/5.0.x
Commit: 04ffbeb789135f1e87dfd5ad80f99977c10e9470
Parents: 21ee386
Author: daserge <v-...@microsoft.com>
Authored: Thu Feb 2 13:58:32 2017 +0300
Committer: daserge <v-...@microsoft.com>
Committed: Tue Feb 7 15:43:37 2017 +0300

----------------------------------------------------------------------
 spec/e2e/endtoend.spec.js            | 57 ++++++++++++++++++++++++++++---
 spec/unit/build.spec.js              |  3 +-
 template/CordovaApp.Windows.jsproj   |  6 ++--
 template/CordovaApp.Windows10.jsproj |  6 ++--
 template/cordova/lib/build.js        |  5 +++
 5 files changed, 65 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/04ffbeb7/spec/e2e/endtoend.spec.js
----------------------------------------------------------------------
diff --git a/spec/e2e/endtoend.spec.js b/spec/e2e/endtoend.spec.js
index ac86ab0..71ed278 100644
--- a/spec/e2e/endtoend.spec.js
+++ b/spec/e2e/endtoend.spec.js
@@ -35,8 +35,14 @@ describe('Cordova create and build', function(){
         appPackagesFolder = path.join(buildDirectory, projectFolder, 'AppPackages'),
         buildScriptPath   = '"' + path.join(buildDirectory, projectFolder, 'cordova', 'build') + '"';
 
+    function verifySubDirContainsFile(subDirName, fileName) {
+        var subDir = path.join(appPackagesFolder, subDirName);
+        var packages = shell.ls(subDir);
+        expect(packages.filter(function(file) { return file.match(fileName); }).length).toBe(1);
+    }
+
     beforeEach(function(){
-      shell.exec(path.join('bin', 'create') + ' "' + projectFolder + '" com.test.app \u5fdc\u7528', {silent : true});
+        shell.exec(path.join('bin', 'create') + ' "' + projectFolder + '" com.test.app \u5fdc\u7528', {silent : true});
     });
 
     afterEach(function() {
@@ -68,11 +74,11 @@ describe('Cordova create and build', function(){
         expect(packages.filter(function(file) { return file.match(/.*Phone.*x86.*\.appx.*/); }).length).toBe(1);
         expect(packages.filter(function(file) { return file.match(/.*Phone.*x64.*\.appx.*/); }).length).toBe(1);
         expect(packages.filter(function(file) { return file.match(/.*Phone.*arm.*\.appx.*/); }).length).toBe(1);
-        expect(packages.filter(function(file) { return file.match(/.*Phone.*AnyCPU.*\.appx.*/); }).length).toBe(1);
+        expect(packages.filter(function(file) { return file.match(/.*Phone.*AnyCPU.*\.appx.*/i); }).length).toBe(1);
         expect(packages.filter(function(file) { return file.match(/.*Windows.*x64.*\.appx.*/); }).length).toBe(1);
         expect(packages.filter(function(file) { return file.match(/.*Windows.*x86.*\.appx.*/); }).length).toBe(1);
         expect(packages.filter(function(file) { return file.match(/.*Windows.*arm.*\.appx.*/); }).length).toBe(1);
-        expect(packages.filter(function(file) { return file.match(/.*Windows.*anycpu.*\.appx.*/); }).length).toBe(1);
+        expect(packages.filter(function(file) { return file.match(/.*Windows.*anycpu.*\.appx.*/i); }).length).toBe(1);
     });
 
     it('spec.5 should build project containing plugin with InProcessServer extension', function(done){
@@ -103,10 +109,15 @@ describe('Cordova create and build', function(){
         });
     });
 
-    it('spec.6 should generate appxupload for Windows 8.1 project bundle release build', function(){
+    it('spec.6 should generate appxupload and appxbundle for Windows 8.1 project bundle release build', function(){
         shell.exec(buildScriptPath + ' --release --win --bundle --archs=\"x64 x86 arm\"', {silent : true});
         var packages = shell.ls(appPackagesFolder);
         expect(packages.filter(function(file) { return file.match(/.*bundle\.appxupload$/); }).length > 0).toBeTruthy();
+
+        var bundleDirName = 'CordovaApp.Windows_1.0.0.0_Test';
+        expect(packages.filter(function(file) { return file.match(bundleDirName); }).length).toBe(1);
+
+        verifySubDirContainsFile(bundleDirName, 'CordovaApp.Windows_1.0.0.0_x64_x86_arm.appxbundle');
     });
 
     it('spec.6.1 should generate appxupload for Windows 8.1 project non-bundle release build', function(){
@@ -115,15 +126,51 @@ describe('Cordova create and build', function(){
         expect(packages.filter(function(file) { return file.match(/.*\.appxupload$/); }).length).toBe(3);
     });
 
-    it('spec.7 should generate appxupload for Windows 10 project bundle release build', function(){
+    it('spec.7 should generate appxupload and appxbundle for Windows 10 project bundle release build', function(){
         shell.exec(buildScriptPath + ' --release --win --appx=uap --bundle --archs=\"x64 x86 arm\"', {silent : true});
         var packages = shell.ls(appPackagesFolder);
         expect(packages.filter(function(file) { return file.match(/.*bundle\.appxupload$/); }).length > 0).toBeTruthy();
+
+        var bundleDirName = 'CordovaApp.Windows10_1.0.0.0_Test';
+        expect(packages.filter(function(file) { return file.match(bundleDirName); }).length).toBe(1);
+
+        verifySubDirContainsFile(bundleDirName, 'CordovaApp.Windows10_1.0.0.0_x64_x86_arm.appxbundle');
     });
 
     it('spec.7.1 should generate appxupload for Windows 10 project non-bundle release build', function(){
         shell.exec(buildScriptPath + ' --release --win --appx=uap --archs=\"x64 x86 arm\"', {silent : true});
         var packages = shell.ls(appPackagesFolder);
         expect(packages.filter(function(file) { return file.match(/.*\.appxupload$/); }).length).toBe(3);
+
+        // CB-12416 Should build appx in separate dirs for each architecture
+        var armSubDir = 'CordovaApp.Windows10_1.0.0.0_arm_Test',
+            x64SubDir = 'CordovaApp.Windows10_1.0.0.0_x64_Test',
+            x86SubDir = 'CordovaApp.Windows10_1.0.0.0_x86_Test';
+
+        // Should contain a subdirectory for each of the architectures
+        expect(packages.filter(function(file) { return file.match(armSubDir); }).length).toBe(1);
+        expect(packages.filter(function(file) { return file.match(x64SubDir); }).length).toBe(1);
+        expect(packages.filter(function(file) { return file.match(x86SubDir); }).length).toBe(1);
+
+        // These subdirectories should contain corresponding appx files
+        verifySubDirContainsFile(armSubDir, 'CordovaApp.Windows10_1.0.0.0_arm.appx');
+        verifySubDirContainsFile(x64SubDir, 'CordovaApp.Windows10_1.0.0.0_x64.appx');
+        verifySubDirContainsFile(x86SubDir, 'CordovaApp.Windows10_1.0.0.0_x86.appx');
+    });
+
+    it('spec.8 for a non-bundle case for Windows Phone 8.1 it should build appx in separate dirs for each architecture', function(){
+        shell.exec(buildScriptPath + ' --release --phone --archs=\"x86 arm\"', {silent : true});
+        var packages = shell.ls(appPackagesFolder);
+
+        var armSubDir = 'CordovaApp.Phone_1.0.0.0_arm_Test',
+            x86SubDir = 'CordovaApp.Phone_1.0.0.0_x86_Test';
+
+        // Should contain a subdirectory for each of the architectures
+        expect(packages.filter(function(file) { return file.match(armSubDir); }).length).toBe(1);
+        expect(packages.filter(function(file) { return file.match(x86SubDir); }).length).toBe(1);
+
+        // These subdirectories should contain corresponding appx files
+        verifySubDirContainsFile(armSubDir, 'CordovaApp.Phone_1.0.0.0_arm.appx');
+        verifySubDirContainsFile(x86SubDir, 'CordovaApp.Phone_1.0.0.0_x86.appx');
     });
 });

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/04ffbeb7/spec/unit/build.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/build.spec.js b/spec/unit/build.spec.js
index 3abd630..ade3a01 100644
--- a/spec/unit/build.spec.js
+++ b/spec/unit/build.spec.js
@@ -449,8 +449,9 @@ describe('buildFlags', function () {
             .fail(fail)
             .finally(function() {
                 expect(fail).not.toHaveBeenCalled();
+                // CB-12416 AppxBundle=Never is present because we are not building a bundle
                 expect(buildTools.buildProject).toHaveBeenCalledWith(jasmine.any(String),
-                    jasmine.any(String), jasmine.any(String), [ 'foo=bar' ]);
+                    jasmine.any(String), jasmine.any(String), [ 'foo=bar', '/p:AppxBundle=Never' ]);
 
                 done();
             });

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/04ffbeb7/template/CordovaApp.Windows.jsproj
----------------------------------------------------------------------
diff --git a/template/CordovaApp.Windows.jsproj b/template/CordovaApp.Windows.jsproj
index b5f43d6..35c8f68 100644
--- a/template/CordovaApp.Windows.jsproj
+++ b/template/CordovaApp.Windows.jsproj
@@ -79,9 +79,9 @@
     <AppxManifest Include="package.windows.appxmanifest">
       <SubType>Designer</SubType>
     </AppxManifest>
-    <Content Exclude="images\*SplashScreenPhone*" Include="images\*.png" />
-    <Content Exclude="images\*SplashScreenPhone*" Include="images\*.jpg" />
-    <Content Exclude="images\*SplashScreenPhone*" Include="images\*.jpeg" />
+    <Content Exclude="images\*SplashScreenPhone*;images\*.scale-240.*" Include="images\*.png" />
+    <Content Exclude="images\*SplashScreenPhone*;images\*.scale-240.*" Include="images\*.jpg" />
+    <Content Exclude="images\*SplashScreenPhone*;images\*.scale-240.*" Include="images\*.jpeg" />
   </ItemGroup>
   <ItemGroup>
     <SDKReference Include="Microsoft.WinJS.2.0, Version=1.0" />

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/04ffbeb7/template/CordovaApp.Windows10.jsproj
----------------------------------------------------------------------
diff --git a/template/CordovaApp.Windows10.jsproj b/template/CordovaApp.Windows10.jsproj
index 8a496dd..d2fa1bf 100644
--- a/template/CordovaApp.Windows10.jsproj
+++ b/template/CordovaApp.Windows10.jsproj
@@ -98,9 +98,9 @@
     <AppxManifest Include="package.windows10.appxmanifest">
       <SubType>Designer</SubType>
     </AppxManifest>
-    <Content Exclude="images\*SplashScreenPhone*" Include="images\*.png" />
-    <Content Exclude="images\*SplashScreenPhone*" Include="images\*.jpg" />
-    <Content Exclude="images\*SplashScreenPhone*" Include="images\*.jpeg" />
+    <Content Exclude="images\*SplashScreenPhone*;images\*.scale-240.*" Include="images\*.png" />
+    <Content Exclude="images\*SplashScreenPhone*;images\*.scale-240.*" Include="images\*.jpg" />
+    <Content Exclude="images\*SplashScreenPhone*;images\*.scale-240.*" Include="images\*.jpeg" />
   </ItemGroup>
   <Import Project="CordovaApp.projitems" Label="Shared" />
   <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).targets" />

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/04ffbeb7/template/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/build.js b/template/cordova/lib/build.js
index ca79fcf..b9bbfeb 100644
--- a/template/cordova/lib/build.js
+++ b/template/cordova/lib/build.js
@@ -342,6 +342,11 @@ function buildTargets(allMsBuildVersions, config) {
                 // Only add the CordovaBundlePlatforms argument when on the last build step
                 var bundleArchs = (index === configsArray.length - 1) ? bundleTerms : build.arch;
                 otherProperties.push('/p:CordovaBundlePlatforms=' + bundleArchs);
+            } else {
+                // https://issues.apache.org/jira/browse/CB-12416
+                // MSBuild uses AppxBundle=Always by default which leads to a bundle created even if
+                // --bundle was not passed - override that:
+                otherProperties.push('/p:AppxBundle=Never');
             }
 
             // https://issues.apache.org/jira/browse/CB-12298


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


[4/4] cordova-windows git commit: CB-12404 Updated RELEASENOTES and Version for release 5.0.0

Posted by da...@apache.org.
CB-12404 Updated RELEASENOTES and Version for release 5.0.0


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

Branch: refs/heads/5.0.x
Commit: 75d7bcf01e830191a9b259ca376f124fba16f9d1
Parents: ba9e351
Author: daserge <v-...@microsoft.com>
Authored: Tue Feb 7 15:42:57 2017 +0300
Committer: daserge <v-...@microsoft.com>
Committed: Tue Feb 7 15:43:38 2017 +0300

----------------------------------------------------------------------
 RELEASENOTES.md | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/75d7bcf0/RELEASENOTES.md
----------------------------------------------------------------------
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 53db2c0..78b1fc4 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -25,6 +25,9 @@ Update these notes using: git log --pretty=format:'* %s' --topo-order --no-merge
 cordova-windows is a library that enables developers to create Windows 8/8.1/10 and WP8.1 application projects that support Cordova APIs.
 
 ### 5.0.0 (Jan 27, 2017)
+* [CB-12415](https://issues.apache.org/jira/browse/CB-12415) Windows build fails if start page is missing
+* [CB-12416](https://issues.apache.org/jira/browse/CB-12416) (Windows) Built bundles are misplaced when building for multiple archs
+* [CB-12298](https://issues.apache.org/jira/browse/CB-12298) [Windows] bundle.appxupload not generated for Windows 10 target Generate appxupload for non-bundle builds as well This closes #227
 * Remove duplicate logic after upgrading cordova-common
 * [CB-12163](https://issues.apache.org/jira/browse/CB-12163) Add resource-file reference functionality through a flag
 * [CB-12163](https://issues.apache.org/jira/browse/CB-12163) Make resource-file copy files again


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


[3/4] cordova-windows git commit: CB-12415 Windows build fails if start page is missing

Posted by da...@apache.org.
CB-12415 Windows build fails if start page is missing


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

Branch: refs/heads/5.0.x
Commit: ba9e3513bbedcfd19a93c9924ee9e217606a169b
Parents: 04ffbeb
Author: daserge <v-...@microsoft.com>
Authored: Thu Feb 2 11:19:56 2017 +0300
Committer: daserge <v-...@microsoft.com>
Committed: Tue Feb 7 15:43:38 2017 +0300

----------------------------------------------------------------------
 template/cordova/prebuild.js | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/ba9e3513/template/cordova/prebuild.js
----------------------------------------------------------------------
diff --git a/template/cordova/prebuild.js b/template/cordova/prebuild.js
index 0e38f0b..a7526db 100644
--- a/template/cordova/prebuild.js
+++ b/template/cordova/prebuild.js
@@ -62,6 +62,11 @@ module.exports = function patch(platform) {
     var startPageFilePath = shell.ls(path.join(__dirname, '..', startPage))[0];
     var reBaseJs = new RegExp(escapedBasejsSrcMap[platform], 'i');
 
+    if (!startPageFilePath) {
+        console.warn('Warning: Start page is missing on the disk. The build must go on but note that this will cause WACK failures.');
+        return;
+    }
+
     if (shell.grep(reBaseJs, startPageFilePath).length === 0) {
         // 3. If it doesn't - patch page to include base.js ref before cordova.js
         var appendBaseJsRe = /( *)(<script\s+(?:type="text\/javascript"\s+)?src="(.*\/)?cordova\.js">\s*<\/script>)/;


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


[2/4] cordova-windows git commit: CB-12298 [Windows] bundle.appxupload not generated for Windows 10 target Generate appxupload for non-bundle builds as well This closes #227

Posted by da...@apache.org.
CB-12298 [Windows] bundle.appxupload not generated for Windows 10 target
Generate appxupload for non-bundle builds as well
This closes #227


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

Branch: refs/heads/5.0.x
Commit: 21ee3867aa36c9d76a29a7c5bcf2d4dabfe8f99a
Parents: 9edcf26
Author: daserge <v-...@microsoft.com>
Authored: Mon Feb 6 21:27:48 2017 +0300
Committer: daserge <v-...@microsoft.com>
Committed: Tue Feb 7 15:43:37 2017 +0300

----------------------------------------------------------------------
 spec/e2e/endtoend.spec.js     | 16 ++++++++++++++--
 template/cordova/lib/build.js |  8 ++++----
 2 files changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/21ee3867/spec/e2e/endtoend.spec.js
----------------------------------------------------------------------
diff --git a/spec/e2e/endtoend.spec.js b/spec/e2e/endtoend.spec.js
index aa08bed..ac86ab0 100644
--- a/spec/e2e/endtoend.spec.js
+++ b/spec/e2e/endtoend.spec.js
@@ -103,15 +103,27 @@ describe('Cordova create and build', function(){
         });
     });
 
-    it('spec.6 should build Windows 8.1 project bundle appxupload', function(){
+    it('spec.6 should generate appxupload for Windows 8.1 project bundle release build', function(){
         shell.exec(buildScriptPath + ' --release --win --bundle --archs=\"x64 x86 arm\"', {silent : true});
         var packages = shell.ls(appPackagesFolder);
         expect(packages.filter(function(file) { return file.match(/.*bundle\.appxupload$/); }).length > 0).toBeTruthy();
     });
 
-    it('spec.7 should build Windows 10 project bundle appxupload', function(){
+    it('spec.6.1 should generate appxupload for Windows 8.1 project non-bundle release build', function(){
+        shell.exec(buildScriptPath + ' --release --win --archs=\"x64 x86 arm\"', {silent : true});
+        var packages = shell.ls(appPackagesFolder);
+        expect(packages.filter(function(file) { return file.match(/.*\.appxupload$/); }).length).toBe(3);
+    });
+
+    it('spec.7 should generate appxupload for Windows 10 project bundle release build', function(){
         shell.exec(buildScriptPath + ' --release --win --appx=uap --bundle --archs=\"x64 x86 arm\"', {silent : true});
         var packages = shell.ls(appPackagesFolder);
         expect(packages.filter(function(file) { return file.match(/.*bundle\.appxupload$/); }).length > 0).toBeTruthy();
     });
+
+    it('spec.7.1 should generate appxupload for Windows 10 project non-bundle release build', function(){
+        shell.exec(buildScriptPath + ' --release --win --appx=uap --archs=\"x64 x86 arm\"', {silent : true});
+        var packages = shell.ls(appPackagesFolder);
+        expect(packages.filter(function(file) { return file.match(/.*\.appxupload$/); }).length).toBe(3);
+    });
 });

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/21ee3867/template/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/build.js b/template/cordova/lib/build.js
index 8159c8b..ca79fcf 100644
--- a/template/cordova/lib/build.js
+++ b/template/cordova/lib/build.js
@@ -342,11 +342,11 @@ function buildTargets(allMsBuildVersions, config) {
                 // Only add the CordovaBundlePlatforms argument when on the last build step
                 var bundleArchs = (index === configsArray.length - 1) ? bundleTerms : build.arch;
                 otherProperties.push('/p:CordovaBundlePlatforms=' + bundleArchs);
+            }
 
-                // https://issues.apache.org/jira/browse/CB-12298
-                if (config.targetProject === 'windows10') {
-                    otherProperties.push('/p:UapAppxPackageBuildMode=StoreUpload');
-                }
+            // https://issues.apache.org/jira/browse/CB-12298
+            if (config.targetProject === 'windows10' && config.buildType === 'release') {
+                otherProperties.push('/p:UapAppxPackageBuildMode=StoreUpload');
             }
 
             return msbuild.buildProject(path.join(ROOT, build.target), config.buildType,  build.arch, otherProperties);


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