cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject ios commit: CB-11243: target-device and deployment-target were being ignored
Date Wed, 16 Nov 2016 01:35:38 GMT
Repository: cordova-ios
Updated Branches:
  refs/heads/master b8e855b87 -> 14508d67f


CB-11243: target-device and deployment-target were being ignored

This closes #277


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

Branch: refs/heads/master
Commit: 14508d67f0bf7d44318be5ade24a755a6704ff03
Parents: b8e855b
Author: Connor Pearson <cjp822@gmail.com>
Authored: Fri Nov 11 09:17:19 2016 -0500
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Tue Nov 15 17:16:06 2016 -0800

----------------------------------------------------------------------
 .../project/__TEMP__.xcodeproj/project.pbxproj  |  4 +++
 bin/templates/scripts/cordova/build.xcconfig    |  2 --
 tests/spec/unit/fixtures/test-config-2.xml      |  2 ++
 tests/spec/unit/prepare.spec.js                 | 35 +++++++++++++++++++-
 4 files changed, 40 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/14508d67/bin/templates/project/__TEMP__.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --git a/bin/templates/project/__TEMP__.xcodeproj/project.pbxproj b/bin/templates/project/__TEMP__.xcodeproj/project.pbxproj
index 52f17f7..7e9b730 100755
--- a/bin/templates/project/__TEMP__.xcodeproj/project.pbxproj
+++ b/bin/templates/project/__TEMP__.xcodeproj/project.pbxproj
@@ -303,7 +303,9 @@
 				GCC_THUMB_SUPPORT = NO;
 				GCC_VERSION = "";
 				INFOPLIST_FILE = "__PROJECT_NAME__/__PROJECT_NAME__-Info.plist";
+				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
+				TARGETED_DEVICE_FAMILY = "1,2";
 				PRODUCT_NAME = "__PROJECT_NAME__";
 			};
 			name = Debug;
@@ -323,7 +325,9 @@
 				GCC_THUMB_SUPPORT = NO;
 				GCC_VERSION = "";
 				INFOPLIST_FILE = "__PROJECT_NAME__/__PROJECT_NAME__-Info.plist";
+				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
+				TARGETED_DEVICE_FAMILY = "1,2";
 				PRODUCT_NAME = "__PROJECT_NAME__";
 			};
 			name = Release;

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/14508d67/bin/templates/scripts/cordova/build.xcconfig
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/build.xcconfig b/bin/templates/scripts/cordova/build.xcconfig
index bc9e0e3..cc78c73 100644
--- a/bin/templates/scripts/cordova/build.xcconfig
+++ b/bin/templates/scripts/cordova/build.xcconfig
@@ -23,9 +23,7 @@
 //
 
 HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include" "$(OBJROOT)/UninstalledProducts/include"
"$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" "$(BUILT_PRODUCTS_DIR)"
-IPHONEOS_DEPLOYMENT_TARGET = 8.0
 OTHER_LDFLAGS = -ObjC
-TARGETED_DEVICE_FAMILY = 1,2
 
 // Type of signing identity used for codesigning, resolves to first match of given type.
 // "iPhone Developer": Development builds (default, local only; iOS Development certificate)
or "iPhone Distribution": Distribution builds (Adhoc/In-House/AppStore; iOS Distribution certificate)

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/14508d67/tests/spec/unit/fixtures/test-config-2.xml
----------------------------------------------------------------------
diff --git a/tests/spec/unit/fixtures/test-config-2.xml b/tests/spec/unit/fixtures/test-config-2.xml
index c756d4e..1dc7487 100644
--- a/tests/spec/unit/fixtures/test-config-2.xml
+++ b/tests/spec/unit/fixtures/test-config-2.xml
@@ -11,6 +11,8 @@
 
     <platform name="ios">
         <preference name="orientation" value="all" />
+        <preference name="target-device" value="handset" />
+        <preference name="deployment-target" value="8.0" />
     </platform>
 
     <access origin="http://*.apache.org" />

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/14508d67/tests/spec/unit/prepare.spec.js
----------------------------------------------------------------------
diff --git a/tests/spec/unit/prepare.spec.js b/tests/spec/unit/prepare.spec.js
index a275846..00624b0 100644
--- a/tests/spec/unit/prepare.spec.js
+++ b/tests/spec/unit/prepare.spec.js
@@ -72,12 +72,13 @@ describe('prepare', function () {
         var mv;
         var update_name;
         var xcOrig = xcode.project;
+        var writeFileSyncSpy;
 
         var updateProject = prepare.__get__('updateProject');
 
         beforeEach(function() {
             mv = spyOn(shell, 'mv');
-            spyOn(fs, 'writeFileSync');
+            writeFileSyncSpy = spyOn(fs, 'writeFileSync');
             spyOn(plist, 'parse').andReturn({});
             spyOn(plist, 'build').andReturn('');
             spyOn(xcode, 'project').andCallFake(function (pbxproj) {
@@ -106,6 +107,38 @@ describe('prepare', function () {
             // restore cfg2 original name
             cfg2.name = cfg2OriginalName;
         });
+        it('should write target-device preference', function(done) {
+            var cfg2OriginalName = cfg2.name;
+            cfg2.name = function() { return 'SampleApp'; }; // new config does *not* have
a name change
+            writeFileSyncSpy.andCallThrough();
+
+            wrapper(updateProject(cfg2, p.locations), done, function() {
+                var xcode = require('xcode');
+                var proj = new xcode.project(p.locations.pbxproj);
+                proj.parseSync();
+                var prop = proj.getBuildProperty('TARGETED_DEVICE_FAMILY');
+                expect(prop).toEqual('"1"'); // 1 is handset
+
+                // restore cfg2 original name
+                cfg2.name = cfg2OriginalName;
+            });
+        });
+        it('should write deployment-target preference', function(done) {
+            var cfg2OriginalName = cfg2.name;
+            cfg2.name = function() { return 'SampleApp'; }; // new config does *not* have
a name change
+            writeFileSyncSpy.andCallThrough();
+
+            wrapper(updateProject(cfg2, p.locations), done, function() {
+                var xcode = require('xcode');
+                var proj = new xcode.project(p.locations.pbxproj);
+                proj.parseSync();
+                var prop = proj.getBuildProperty('IPHONEOS_DEPLOYMENT_TARGET'); 
+                expect(prop).toEqual('8.0');
+
+                // restore cfg2 original name
+                cfg2.name = cfg2OriginalName;
+            });
+        });
         it('should write out the app id to info plist as CFBundleIdentifier', function(done)
{
             var orig = cfg.getAttribute;
             cfg.getAttribute = function(name) {


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


Mime
View raw message