Repository: cordova-lib Updated Branches: refs/heads/master 6666136f7 -> 9b476c988
CB-9297 Parse xcode project syncronously to avoid issues with node v4 This closes #305 Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/9b476c98 Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/9b476c98 Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/9b476c98 Branch: refs/heads/master Commit: 9b476c9881a2075bfe765135cab24502d4bd1057 Parents: 6666136 Author: Vladimir Kotikov <v-vlk...@microsoft.com> Authored: Fri Sep 11 14:03:33 2015 +0300 Committer: Vladimir Kotikov <v-vlk...@microsoft.com> Committed: Mon Sep 14 17:47:48 2015 +0300 ---------------------------------------------------------------------- .../projects/ios/test.xcodeproj/project.pbxproj | 513 +++++++++++++++++++ .../fixtures/projects/ios/test/test-Info.plist | 206 ++++++++ .../spec-cordova/metadata/ios_parser.spec.js | 72 ++- cordova-lib/src/cordova/metadata/ios_parser.js | 98 ++-- 4 files changed, 813 insertions(+), 76 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/9b476c98/cordova-lib/spec-cordova/fixtures/projects/ios/test.xcodeproj/project.pbxproj ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-cordova/fixtures/projects/ios/test.xcodeproj/project.pbxproj b/cordova-lib/spec-cordova/fixtures/projects/ios/test.xcodeproj/project.pbxproj new file mode 100644 index 0000000..6e9912f --- /dev/null +++ b/cordova-lib/spec-cordova/fixtures/projects/ios/test.xcodeproj/project.pbxproj @@ -0,0 +1,513 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; }; + 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; + 301BF552109A68D80062928A /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 301BF535109A57CC0062928A /* libCordova.a */; }; + 302D95F114D2391D003F00A1 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 302D95EF14D2391D003F00A1 /* MainViewController.m */; }; + 302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 302D95F014D2391D003F00A1 /* MainViewController.xib */; }; + 3074132519D5FC77000C6D87 /* icon...@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3074132419D5FC77000C6D87 /* icon...@3x.png */; }; + 30761BD21AB7FCF100D046E3 /* build-debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 30761BCF1AB7FCF100D046E3 /* build-debug.xcconfig */; }; + 30761BD31AB7FCF100D046E3 /* build-release.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 30761BD01AB7FCF100D046E3 /* build-release.xcconfig */; }; + 30761BD41AB7FCF100D046E3 /* build.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 30761BD11AB7FCF100D046E3 /* build.xcconfig */; }; + 3088BBBD154F3926009F9C59 /* Default-Landscape@2x~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 3088BBB7154F3926009F9C59 /* Default-Landscape@2x~ipad.png */; }; + 3088BBBE154F3926009F9C59 /* Default-Landscape~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 3088BBB8154F3926009F9C59 /* Default-Landscape~ipad.png */; }; + 3088BBBF154F3926009F9C59 /* Default-Portrait@2x~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 3088BBB9154F3926009F9C59 /* Default-Portrait@2x~ipad.png */; }; + 3088BBC0154F3926009F9C59 /* Default-Portrait~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 3088BBBA154F3926009F9C59 /* Default-Portrait~ipad.png */; }; + 3088BBC1154F3926009F9C59 /* Default@2x~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = 3088BBBB154F3926009F9C59 /* Default@2x~iphone.png */; }; + 3088BBC2154F3926009F9C59 /* Default~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = 3088BBBC154F3926009F9C59 /* Default~iphone.png */; }; + 308D05371370CCF300D202BF /* icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 308D052E1370CCF300D202BF /* icon-72.png */; }; + 308D05381370CCF300D202BF /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 308D052F1370CCF300D202BF /* icon.png */; }; + 308D05391370CCF300D202BF /* i...@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 308D05301370CCF300D202BF /* i...@2x.png */; }; + 30B4F30719D5E08600D9F7D8 /* Default-667h.png in Resources */ = {isa = PBXBuildFile; fileRef = 30B4F30419D5E08600D9F7D8 /* Default-667h.png */; }; + 30B4F30819D5E08600D9F7D8 /* Default-736h.png in Resources */ = {isa = PBXBuildFile; fileRef = 30B4F30519D5E08600D9F7D8 /* Default-736h.png */; }; + 30B4F30919D5E08600D9F7D8 /* Default-Landscape-736h.png in Resources */ = {isa = PBXBuildFile; fileRef = 30B4F30619D5E08600D9F7D8 /* Default-Landscape-736h.png */; }; + 30FC414916E50CA1004E6F35 /* icon...@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 30FC414816E50CA1004E6F35 /* icon...@2x.png */; }; + 7E7966DE1810823500FA85AD /* icon-40.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966D41810823500FA85AD /* icon-40.png */; }; + 7E7966DF1810823500FA85AD /* icon...@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966D51810823500FA85AD /* icon...@2x.png */; }; + 7E7966E01810823500FA85AD /* icon-50.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966D61810823500FA85AD /* icon-50.png */; }; + 7E7966E11810823500FA85AD /* icon...@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966D71810823500FA85AD /* icon...@2x.png */; }; + 7E7966E21810823500FA85AD /* icon-60.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966D81810823500FA85AD /* icon-60.png */; }; + 7E7966E31810823500FA85AD /* icon...@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966D91810823500FA85AD /* icon...@2x.png */; }; + 7E7966E41810823500FA85AD /* icon-76.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966DA1810823500FA85AD /* icon-76.png */; }; + 7E7966E51810823500FA85AD /* icon...@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966DB1810823500FA85AD /* icon...@2x.png */; }; + 7E7966E61810823500FA85AD /* icon-small.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966DC1810823500FA85AD /* icon-small.png */; }; + 7E7966E71810823500FA85AD /* icon-sm...@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966DD1810823500FA85AD /* icon-sm...@2x.png */; }; + D4A0D8761607E02300AEF8BB /* Default-568h@2x~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = D4A0D8751607E02300AEF8BB /* Default-568h@2x~iphone.png */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 301BF534109A57CC0062928A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D2AAC07E0554694100DB518D; + remoteInfo = CordovaLib; + }; + 301BF550109A68C00062928A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = D2AAC07D0554694100DB518D; + remoteInfo = CordovaLib; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; + 1D3623250D0F684500981E51 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; + 1D6058910D05DD3D006BFB54 /* test.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "test.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; + 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CordovaLib.xcodeproj; path = CordovaLib/CordovaLib.xcodeproj; sourceTree = "<group>"; }; + 301BF56E109A69640062928A /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = SOURCE_ROOT; }; + 302D95EE14D2391D003F00A1 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; }; + 302D95EF14D2391D003F00A1 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; }; + 302D95F014D2391D003F00A1 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = "<group>"; }; + 3074132419D5FC77000C6D87 /* icon...@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon...@3x.png"; sourceTree = "<group>"; }; + 30761BCF1AB7FCF100D046E3 /* build-debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-debug.xcconfig"; path = "cordova/build-debug.xcconfig"; sourceTree = SOURCE_ROOT; }; + 30761BD01AB7FCF100D046E3 /* build-release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-release.xcconfig"; path = "cordova/build-release.xcconfig"; sourceTree = SOURCE_ROOT; }; + 30761BD11AB7FCF100D046E3 /* build.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = build.xcconfig; path = cordova/build.xcconfig; sourceTree = SOURCE_ROOT; }; + 3088BBB7154F3926009F9C59 /* Default-Landscape@2x~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape@2x~ipad.png"; sourceTree = "<group>"; }; + 3088BBB8154F3926009F9C59 /* Default-Landscape~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape~ipad.png"; sourceTree = "<group>"; }; + 3088BBB9154F3926009F9C59 /* Default-Portrait@2x~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait@2x~ipad.png"; sourceTree = "<group>"; }; + 3088BBBA154F3926009F9C59 /* Default-Portrait~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait~ipad.png"; sourceTree = "<group>"; }; + 3088BBBB154F3926009F9C59 /* Default@2x~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x~iphone.png"; sourceTree = "<group>"; }; + 3088BBBC154F3926009F9C59 /* Default~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default~iphone.png"; sourceTree = "<group>"; }; + 308D052E1370CCF300D202BF /* icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-72.png"; sourceTree = "<group>"; }; + 308D052F1370CCF300D202BF /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = "<group>"; }; + 308D05301370CCF300D202BF /* i...@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "i...@2x.png"; sourceTree = "<group>"; }; + 30B4F30419D5E08600D9F7D8 /* Default-667h.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h.png"; sourceTree = "<group>"; }; + 30B4F30519D5E08600D9F7D8 /* Default-736h.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h.png"; sourceTree = "<group>"; }; + 30B4F30619D5E08600D9F7D8 /* Default-Landscape-736h.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape-736h.png"; sourceTree = "<group>"; }; + 30FC414816E50CA1004E6F35 /* icon...@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon...@2x.png"; sourceTree = "<group>"; }; + 32CA4F630368D1EE00C91783 /* test-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "test-Prefix.pch"; sourceTree = "<group>"; }; + 7E7966D41810823500FA85AD /* icon-40.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-40.png"; sourceTree = "<group>"; }; + 7E7966D51810823500FA85AD /* icon...@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon...@2x.png"; sourceTree = "<group>"; }; + 7E7966D61810823500FA85AD /* icon-50.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-50.png"; sourceTree = "<group>"; }; + 7E7966D71810823500FA85AD /* icon...@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon...@2x.png"; sourceTree = "<group>"; }; + 7E7966D81810823500FA85AD /* icon-60.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-60.png"; sourceTree = "<group>"; }; + 7E7966D91810823500FA85AD /* icon...@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon...@2x.png"; sourceTree = "<group>"; }; + 7E7966DA1810823500FA85AD /* icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-76.png"; sourceTree = "<group>"; }; + 7E7966DB1810823500FA85AD /* icon...@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon...@2x.png"; sourceTree = "<group>"; }; + 7E7966DC1810823500FA85AD /* icon-small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-small.png"; sourceTree = "<group>"; }; + 7E7966DD1810823500FA85AD /* icon-sm...@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-sm...@2x.png"; sourceTree = "<group>"; }; + 8D1107310486CEB800E47090 /* test-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "test-Info.plist"; path = "../test-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; }; + D4A0D8751607E02300AEF8BB /* Default-568h@2x~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x~iphone.png"; sourceTree = "<group>"; }; + F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = "test/config.xml"; sourceTree = "<group>"; }; + ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Bridging-Header.h"; path = "Bridging-Header.h"; sourceTree = "<group>"; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 301BF552109A68D80062928A /* libCordova.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Classes */ = { + isa = PBXGroup; + children = ( + 302D95EE14D2391D003F00A1 /* MainViewController.h */, + 302D95EF14D2391D003F00A1 /* MainViewController.m */, + 302D95F014D2391D003F00A1 /* MainViewController.xib */, + 1D3623240D0F684500981E51 /* AppDelegate.h */, + 1D3623250D0F684500981E51 /* AppDelegate.m */, + ); + name = Classes; + path = "test/Classes"; + sourceTree = SOURCE_ROOT; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 1D6058910D05DD3D006BFB54 /* test.app */, + ); + name = Products; + sourceTree = "<group>"; + }; + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { + isa = PBXGroup; + children = ( + F840E1F0165FE0F500CFE078 /* config.xml */, + 301BF56E109A69640062928A /* www */, + 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */, + 080E96DDFE201D6D7F000001 /* Classes */, + 307C750510C5A3420062BCA9 /* Plugins */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = CustomTemplate; + sourceTree = "<group>"; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 32CA4F630368D1EE00C91783 /* test-Prefix.pch */, + 29B97316FDCFA39411CA2CEA /* main.m */, + ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */, + ); + name = "Other Sources"; + path = "test"; + sourceTree = "<group>"; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 3034A3FB1AB8044400DC33D6 /* config */, + 308D052D1370CCF300D202BF /* icons */, + 308D05311370CCF300D202BF /* splash */, + 8D1107310486CEB800E47090 /* test-Info.plist */, + ); + name = Resources; + path = "test/Resources"; + sourceTree = "<group>"; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = "<group>"; + }; + 301BF52E109A57CC0062928A /* Products */ = { + isa = PBXGroup; + children = ( + 301BF535109A57CC0062928A /* libCordova.a */, + ); + name = Products; + sourceTree = "<group>"; + }; + 3034A3FB1AB8044400DC33D6 /* config */ = { + isa = PBXGroup; + children = ( + 30761BD11AB7FCF100D046E3 /* build.xcconfig */, + 30761BCF1AB7FCF100D046E3 /* build-debug.xcconfig */, + 30761BD01AB7FCF100D046E3 /* build-release.xcconfig */, + ); + name = config; + sourceTree = "<group>"; + }; + 307C750510C5A3420062BCA9 /* Plugins */ = { + isa = PBXGroup; + children = ( + ); + name = Plugins; + path = "test/Plugins"; + sourceTree = SOURCE_ROOT; + }; + 308D052D1370CCF300D202BF /* icons */ = { + isa = PBXGroup; + children = ( + 3074132419D5FC77000C6D87 /* icon...@3x.png */, + 7E7966D41810823500FA85AD /* icon-40.png */, + 7E7966D51810823500FA85AD /* icon...@2x.png */, + 7E7966D61810823500FA85AD /* icon-50.png */, + 7E7966D71810823500FA85AD /* icon...@2x.png */, + 7E7966D81810823500FA85AD /* icon-60.png */, + 7E7966D91810823500FA85AD /* icon...@2x.png */, + 7E7966DA1810823500FA85AD /* icon-76.png */, + 7E7966DB1810823500FA85AD /* icon...@2x.png */, + 7E7966DC1810823500FA85AD /* icon-small.png */, + 7E7966DD1810823500FA85AD /* icon-sm...@2x.png */, + 30FC414816E50CA1004E6F35 /* icon...@2x.png */, + 308D052E1370CCF300D202BF /* icon-72.png */, + 308D052F1370CCF300D202BF /* icon.png */, + 308D05301370CCF300D202BF /* i...@2x.png */, + ); + path = icons; + sourceTree = "<group>"; + }; + 308D05311370CCF300D202BF /* splash */ = { + isa = PBXGroup; + children = ( + 30B4F30419D5E08600D9F7D8 /* Default-667h.png */, + 30B4F30519D5E08600D9F7D8 /* Default-736h.png */, + 30B4F30619D5E08600D9F7D8 /* Default-Landscape-736h.png */, + D4A0D8751607E02300AEF8BB /* Default-568h@2x~iphone.png */, + 3088BBB7154F3926009F9C59 /* Default-Landscape@2x~ipad.png */, + 3088BBB8154F3926009F9C59 /* Default-Landscape~ipad.png */, + 3088BBB9154F3926009F9C59 /* Default-Portrait@2x~ipad.png */, + 3088BBBA154F3926009F9C59 /* Default-Portrait~ipad.png */, + 3088BBBB154F3926009F9C59 /* Default@2x~iphone.png */, + 3088BBBC154F3926009F9C59 /* Default~iphone.png */, + ); + path = splash; + sourceTree = "<group>"; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1D6058900D05DD3D006BFB54 /* test */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "test" */; + buildPhases = ( + 304B58A110DAC018002A0835 /* Copy www directory */, + 1D60588D0D05DD3D006BFB54 /* Resources */, + 1D60588E0D05DD3D006BFB54 /* Sources */, + 1D60588F0D05DD3D006BFB54 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 301BF551109A68C00062928A /* PBXTargetDependency */, + ); + name = "test"; + productName = "test"; + productReference = 1D6058910D05DD3D006BFB54 /* test.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0510; + }; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__NON-CLI__" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + en, + es, + de, + se, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 301BF52E109A57CC0062928A /* Products */; + ProjectRef = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 1D6058900D05DD3D006BFB54 /* test */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 301BF535109A57CC0062928A /* libCordova.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libCordova.a; + remoteRef = 301BF534109A57CC0062928A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 1D60588D0D05DD3D006BFB54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E7966E41810823500FA85AD /* icon-76.png in Resources */, + 7E7966DF1810823500FA85AD /* icon...@2x.png in Resources */, + 308D05371370CCF300D202BF /* icon-72.png in Resources */, + 30B4F30819D5E08600D9F7D8 /* Default-736h.png in Resources */, + 308D05381370CCF300D202BF /* icon.png in Resources */, + 308D05391370CCF300D202BF /* i...@2x.png in Resources */, + 302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */, + 7E7966E01810823500FA85AD /* icon-50.png in Resources */, + 7E7966E31810823500FA85AD /* icon...@2x.png in Resources */, + 7E7966E61810823500FA85AD /* icon-small.png in Resources */, + 3088BBBD154F3926009F9C59 /* Default-Landscape@2x~ipad.png in Resources */, + 30761BD31AB7FCF100D046E3 /* build-release.xcconfig in Resources */, + 3088BBBE154F3926009F9C59 /* Default-Landscape~ipad.png in Resources */, + 3088BBBF154F3926009F9C59 /* Default-Portrait@2x~ipad.png in Resources */, + 7E7966E71810823500FA85AD /* icon-sm...@2x.png in Resources */, + 3088BBC0154F3926009F9C59 /* Default-Portrait~ipad.png in Resources */, + 30761BD41AB7FCF100D046E3 /* build.xcconfig in Resources */, + 30B4F30719D5E08600D9F7D8 /* Default-667h.png in Resources */, + 7E7966DE1810823500FA85AD /* icon-40.png in Resources */, + 3088BBC1154F3926009F9C59 /* Default@2x~iphone.png in Resources */, + 7E7966E21810823500FA85AD /* icon-60.png in Resources */, + 3088BBC2154F3926009F9C59 /* Default~iphone.png in Resources */, + D4A0D8761607E02300AEF8BB /* Default-568h@2x~iphone.png in Resources */, + 30B4F30919D5E08600D9F7D8 /* Default-Landscape-736h.png in Resources */, + 3074132519D5FC77000C6D87 /* icon...@3x.png in Resources */, + 7E7966E11810823500FA85AD /* icon...@2x.png in Resources */, + 30761BD21AB7FCF100D046E3 /* build-debug.xcconfig in Resources */, + 7E7966E51810823500FA85AD /* icon...@2x.png in Resources */, + 30FC414916E50CA1004E6F35 /* icon...@2x.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 304B58A110DAC018002A0835 /* Copy www directory */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy www directory"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "NODEJS_PATH=/usr/local/bin; NVM_NODE_PATH=~/.nvm/versions/node/`nvm version 2>/dev/null`/bin; N_NODE_PATH=`find /usr/local/n/versions/node/* -maxdepth 0 -type d 2>/dev/null | tail -1`/bin; XCODE_NODE_PATH=`xcode-select --print-path`/usr/share/xcs/Node/bin; PATH=$NODEJS_PATH:$NVM_NODE_PATH:$N_NODE_PATH:$XCODE_NODE_PATH:$PATH && node cordova/lib/copy-www-build-step.js"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1D60588E0D05DD3D006BFB54 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589B0D05DD56006BFB54 /* main.m in Sources */, + 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */, + 302D95F114D2391D003F00A1 /* MainViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 301BF551109A68C00062928A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = CordovaLib; + targetProxy = 301BF550109A68C00062928A /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 1D6058940D05DD3E006BFB54 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 30761BCF1AB7FCF100D046E3 /* build-debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "test/test-Prefix.pch"; + GCC_THUMB_SUPPORT = NO; + GCC_VERSION = ""; + INFOPLIST_FILE = "test/test-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + PRODUCT_NAME = "test"; + }; + name = Debug; + }; + 1D6058950D05DD3E006BFB54 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 30761BD01AB7FCF100D046E3 /* build-release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + COPY_PHASE_STRIP = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "test/test-Prefix.pch"; + GCC_THUMB_SUPPORT = NO; + GCC_VERSION = ""; + INFOPLIST_FILE = "test/test-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + PRODUCT_NAME = "test"; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 30761BD11AB7FCF100D046E3 /* build.xcconfig */; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_THUMB_SUPPORT = NO; + GCC_VERSION = ""; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SKIP_INSTALL = NO; + SWIFT_OBJC_BRIDGING_HEADER = "test/Bridging-Header.h"; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 30761BD11AB7FCF100D046E3 /* build.xcconfig */; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_THUMB_SUPPORT = NO; + GCC_VERSION = ""; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + SDKROOT = iphoneos; + SKIP_INSTALL = NO; + SWIFT_OBJC_BRIDGING_HEADER = "test/Bridging-Header.h"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "test" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1D6058940D05DD3E006BFB54 /* Debug */, + 1D6058950D05DD3E006BFB54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__NON-CLI__" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/9b476c98/cordova-lib/spec-cordova/fixtures/projects/ios/test/test-Info.plist ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-cordova/fixtures/projects/ios/test/test-Info.plist b/cordova-lib/spec-cordova/fixtures/projects/ios/test/test-Info.plist new file mode 100644 index 0000000..c049652 --- /dev/null +++ b/cordova-lib/spec-cordova/fixtures/projects/ios/test/test-Info.plist @@ -0,0 +1,206 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<!-- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleDisplayName</key> + <string>${PRODUCT_NAME}</string> + <key>CFBundleExecutable</key> + <string>${EXECUTABLE_NAME}</string> + <key>CFBundleIconFile</key> + <string>icon.png</string> + <key>CFBundleIcons</key> + <dict> + <key>CFBundlePrimaryIcon</key> + <dict> + <key>CFBundleIconFiles</key> + <array> + <string>icon-40</string> + <string>icon-small</string> + <string>icon-60</string> + <string>icon.png</string> + <string>icon@2x</string> + <string>icon-72</string> + <string>icon-72@2x</string> + </array> + <key>UIPrerenderedIcon</key> + <false/> + </dict> + </dict> + <key>CFBundleIcons~ipad</key> + <dict> + <key>CFBundlePrimaryIcon</key> + <dict> + <key>CFBundleIconFiles</key> + <array> + <string>icon-small</string> + <string>icon-40</string> + <string>icon-50</string> + <string>icon-76</string> + <string>icon-60</string> + <string>icon</string> + <string>icon@2x</string> + <string>icon-72</string> + <string>icon-72@2x</string> + </array> + <key>UIPrerenderedIcon</key> + <false/> + </dict> + </dict> + <key>CFBundleIdentifier</key> + <string>ios.sample.project</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>${PRODUCT_NAME}</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>1.0</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>LSRequiresIPhoneOS</key> + <true/> + <key>NSMainNibFile</key> + <string></string> + <key>NSMainNibFile~ipad</key> + <string></string> + <key>UISupportedInterfaceOrientations</key> + <array> + <string>UIInterfaceOrientationPortrait</string> + </array> + <key>UISupportedInterfaceOrientations~ipad</key> + <array> + <string>UIInterfaceOrientationPortrait</string> + <string>UIInterfaceOrientationLandscapeLeft</string> + <string>UIInterfaceOrientationPortraitUpsideDown</string> + <string>UIInterfaceOrientationLandscapeRight</string> + </array> + <key>UILaunchImages</key> + <array> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default</string> + <key>UILaunchImageOrientation</key> + <string>Portrait</string> + <key>UILaunchImageSize</key> + <string>{320, 480}</string> + </dict> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default</string> + <key>UILaunchImageOrientation</key> + <string>Landscape</string> + <key>UILaunchImageSize</key> + <string>{320, 480}</string> + </dict> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default-568h</string> + <key>UILaunchImageOrientation</key> + <string>Portrait</string> + <key>UILaunchImageSize</key> + <string>{320, 568}</string> + </dict> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default-568h</string> + <key>UILaunchImageOrientation</key> + <string>Landscape</string> + <key>UILaunchImageSize</key> + <string>{320, 568}</string> + </dict> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default-667h</string> + <key>UILaunchImageOrientation</key> + <string>Portrait</string> + <key>UILaunchImageSize</key> + <string>{375, 667}</string> + </dict> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default-667h</string> + <key>UILaunchImageOrientation</key> + <string>Landscape</string> + <key>UILaunchImageSize</key> + <string>{375, 667}</string> + </dict> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default-736h</string> + <key>UILaunchImageOrientation</key> + <string>Portrait</string> + <key>UILaunchImageSize</key> + <string>{414, 736}</string> + </dict> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default-Landscape-736h</string> + <key>UILaunchImageOrientation</key> + <string>Landscape</string> + <key>UILaunchImageSize</key> + <string>{414, 736}</string> + </dict> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default-Portrait</string> + <key>UILaunchImageOrientation</key> + <string>Portrait</string> + <key>UILaunchImageSize</key> + <string>{768, 1024}</string> + </dict> + <dict> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + <key>UILaunchImageName</key> + <string>Default-Landscape</string> + <key>UILaunchImageOrientation</key> + <string>Landscape</string> + <key>UILaunchImageSize</key> + <string>{768, 1024}</string> + </dict> + </array> +</dict> +</plist> http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/9b476c98/cordova-lib/spec-cordova/metadata/ios_parser.spec.js ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-cordova/metadata/ios_parser.spec.js b/cordova-lib/spec-cordova/metadata/ios_parser.spec.js index d7ae6f0..33b0653 100644 --- a/cordova-lib/spec-cordova/metadata/ios_parser.spec.js +++ b/cordova-lib/spec-cordova/metadata/ios_parser.spec.js @@ -28,20 +28,30 @@ var iosParser = require('../../src/cordova/metadata/ios_parser'), Parser = require('../../src/cordova/metadata/parser'), ConfigParser = require('../../src/configparser/ConfigParser'); +var iosProjectFixture = path.join(__dirname, '../fixtures/projects/ios'); +var proj = path.join(__dirname, 'some/path'); +var ios_proj = path.join(proj, 'platforms/ios'); + +shell.config.silent = true; + // Create a real config object before mocking out everything. var cfg = new ConfigParser(path.join(__dirname, '..', 'test-config.xml')); describe('ios project parser', function () { - var proj = path.join('some', 'path'); - var custom, readdir; + var custom; beforeEach(function() { custom = spyOn(config, 'has_custom_path').andReturn(false); - readdir = spyOn(fs, 'readdirSync').andReturn(['test.xcodeproj']); + shell.mkdir('-p', ios_proj); + shell.cp('-rf', iosProjectFixture + '/*', ios_proj); + }); + + afterEach(function () { + shell.rm('-rf', path.join(__dirname, 'some')); }); function wrapper(p, done, post) { p.then(post, function(err) { - expect(err).toBeUndefined(); + expect(err.stack).toBeUndefined(); }).fin(done); } @@ -53,58 +63,51 @@ describe('ios project parser', function () { describe('constructions', function() { it('should throw if provided directory does not contain an xcodeproj file', function() { - readdir.andReturn(['noxcodehere']); expect(function() { new iosParser(proj); }).toThrow(); }); it('should create an instance with path, pbxproj, xcodeproj, originalName and cordovaproj properties', function() { expect(function() { - var p = new iosParser(proj); - expect(p.path).toEqual(proj); - expect(p.pbxproj).toEqual(path.join(proj, 'test.xcodeproj', 'project.pbxproj')); - expect(p.xcodeproj).toEqual(path.join(proj, 'test.xcodeproj')); + var p = new iosParser(ios_proj); + expect(p.path).toEqual(ios_proj); + expect(p.pbxproj).toEqual(path.join(ios_proj, 'test.xcodeproj', 'project.pbxproj')); + expect(p.xcodeproj).toEqual(path.join(ios_proj, 'test.xcodeproj')); }).not.toThrow(); }); it('should be an instance of Parser', function() { - expect(new iosParser(proj) instanceof Parser).toBe(true); + expect(new iosParser(ios_proj) instanceof Parser).toBe(true); }); it('should call super with the correct arguments', function() { var call = spyOn(Parser, 'call'); - var p = new iosParser(proj); - expect(call).toHaveBeenCalledWith(p, 'ios', proj); + var p = new iosParser(ios_proj); + expect(call).toHaveBeenCalledWith(p, 'ios', ios_proj); }); }); describe('instance', function() { - var p, cp, rm, mkdir, is_cordova, write, read, getOrientation; - var ios_proj = path.join(proj, 'platforms', 'ios'); + var p, is_cordova, getOrientation; beforeEach(function() { p = new iosParser(ios_proj); - cp = spyOn(shell, 'cp'); - rm = spyOn(shell, 'rm'); - mkdir = spyOn(shell, 'mkdir'); is_cordova = spyOn(util, 'isCordova').andReturn(proj); - write = spyOn(fs, 'writeFileSync'); - read = spyOn(fs, 'readFileSync').andReturn(''); getOrientation = spyOn(p.helper, 'getOrientation'); }); describe('update_from_config method', function() { var mv; var plist_parse, plist_build, xc; - var update_name, xc_write; + var update_name; + var xcOrig = xcode.project; beforeEach(function() { mv = spyOn(shell, 'mv'); plist_parse = spyOn(plist, 'parse').andReturn({ }); plist_build = spyOn(plist, 'build').andReturn(''); - update_name = jasmine.createSpy('update_name'); - xc_write = jasmine.createSpy('xcode writeSync'); - xc = spyOn(xcode, 'project').andReturn({ - parse:function(cb) {cb();}, - updateProductName:update_name, - writeSync:xc_write + xc = spyOn(xcode, 'project') + .andCallFake(function (pbxproj) { + var xc = new xcOrig(pbxproj); + update_name = spyOn(xc, 'updateProductName').andCallThrough(); + return xc; }); cfg.name = function() { return 'testname'; }; cfg.packageName = function() { return 'testpkg'; }; @@ -196,6 +199,13 @@ describe('ios project parser', function () { }); }); describe('update_www method', function() { + var cp, rm; + + beforeEach(function () { + rm = spyOn(shell, 'rm').andCallThrough(); + cp = spyOn(shell, 'cp').andCallThrough(); + }); + it('should rm project-level www and cp in platform agnostic www', function() { p.update_www(path.join('lib','dir')); expect(rm).toHaveBeenCalled(); @@ -203,16 +213,22 @@ describe('ios project parser', function () { }); }); describe('update_overrides method', function() { - var exists; + var exists, rm, cp; beforeEach(function() { - exists = spyOn(fs, 'existsSync').andReturn(true); + exists = spyOn(fs, 'existsSync').andCallThrough(); + rm = spyOn(shell, 'rm').andCallThrough(); + cp = spyOn(shell, 'cp').andCallThrough(); }); it('should do nothing if merges directory does not exist', function() { + cp.reset(); exists.andReturn(false); p.update_overrides(); expect(cp).not.toHaveBeenCalled(); }); it('should copy merges path into www', function() { + cp.andCallFake(function(){}); + cp.reset(); + exists.andReturn(true); p.update_overrides(); expect(cp).toHaveBeenCalled(); }); http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/9b476c98/cordova-lib/src/cordova/metadata/ios_parser.js ---------------------------------------------------------------------- diff --git a/cordova-lib/src/cordova/metadata/ios_parser.js b/cordova-lib/src/cordova/metadata/ios_parser.js index 32843ad..2f089c3 100644 --- a/cordova-lib/src/cordova/metadata/ios_parser.js +++ b/cordova-lib/src/cordova/metadata/ios_parser.js @@ -175,40 +175,41 @@ ios_parser.prototype.update_from_config = function(config) { } }); - var me = this; + var parser = this; return this.update_build_settings(config).then(function() { - if (name == me.originalName) { - events.emit('verbose', 'iOS Product Name has not changed (still "' + me.originalName + '")'); + if (name == parser.originalName) { + events.emit('verbose', 'iOS Product Name has not changed (still "' + parser.originalName + '")'); return Q(); } // Update product name inside pbxproj file - var proj = new xcode.project(me.pbxproj); - var parser = me; - var d = Q.defer(); - proj.parse(function(err,hash) { - if (err) { - d.reject(new Error('An error occured during parsing of project.pbxproj. Start weeping. Output: ' + err)); - } else { - proj.updateProductName(name); - fs.writeFileSync(parser.pbxproj, proj.writeSync(), 'utf-8'); - // Move the xcodeproj and other name-based dirs over. - shell.mv(path.join(parser.cordovaproj, parser.originalName + '-Info.plist'), path.join(parser.cordovaproj, name + '-Info.plist')); - shell.mv(path.join(parser.cordovaproj, parser.originalName + '-Prefix.pch'), path.join(parser.cordovaproj, name + '-Prefix.pch')); - shell.mv(parser.xcodeproj, path.join(parser.path, name + '.xcodeproj')); - shell.mv(parser.cordovaproj, path.join(parser.path, name)); - // Update self object with new paths - var old_name = parser.originalName; - parser = new module.exports(parser.path); - // Hack this shi*t - var pbx_contents = fs.readFileSync(parser.pbxproj, 'utf-8'); - pbx_contents = pbx_contents.split(old_name).join(name); - fs.writeFileSync(parser.pbxproj, pbx_contents, 'utf-8'); - events.emit('verbose', 'Wrote out iOS Product Name and updated XCode project file names from "'+old_name+'" to "' + name + '".'); - d.resolve(); - } - }); - return d.promise; + var proj = new xcode.project(parser.pbxproj); + try { + proj.parseSync(); + } catch (err) { + return Q.reject(new Error('An error occured during parsing of project.pbxproj. Start weeping. Output: ' + err)); + } + + proj.updateProductName(name); + fs.writeFileSync(parser.pbxproj, proj.writeSync(), 'utf-8'); + + // Move the xcodeproj and other name-based dirs over. + shell.mv(path.join(parser.cordovaproj, parser.originalName + '-Info.plist'), path.join(parser.cordovaproj, name + '-Info.plist')); + shell.mv(path.join(parser.cordovaproj, parser.originalName + '-Prefix.pch'), path.join(parser.cordovaproj, name + '-Prefix.pch')); + shell.mv(parser.xcodeproj, path.join(parser.path, name + '.xcodeproj')); + shell.mv(parser.cordovaproj, path.join(parser.path, name)); + + // Update self object with new paths + var old_name = parser.originalName; + parser = new module.exports(parser.path); + + // Hack this shi*t + var pbx_contents = fs.readFileSync(parser.pbxproj, 'utf-8'); + pbx_contents = pbx_contents.split(old_name).join(name); + fs.writeFileSync(parser.pbxproj, pbx_contents, 'utf-8'); + events.emit('verbose', 'Wrote out iOS Product Name and updated XCode project file names from "'+old_name+'" to "' + name + '".'); + + return Q(); }); }; @@ -276,26 +277,27 @@ ios_parser.prototype.update_build_settings = function(config) { return Q(); } - var me = this; - var d = Q.defer(); var proj = new xcode.project(this.pbxproj); - proj.parse(function(err,hash) { - if (err) { - d.reject(new Error('An error occured during parsing of project.pbxproj. Start weeping. Output: ' + err)); - return; - } - if (targetDevice) { - events.emit('verbose', 'Set TARGETED_DEVICE_FAMILY to ' + targetDevice + '.'); - proj.updateBuildProperty('TARGETED_DEVICE_FAMILY', targetDevice); - } - if (deploymentTarget) { - events.emit('verbose', 'Set IPHONEOS_DEPLOYMENT_TARGET to "' + deploymentTarget + '".'); - proj.updateBuildProperty('IPHONEOS_DEPLOYMENT_TARGET', deploymentTarget); - } - fs.writeFileSync(me.pbxproj, proj.writeSync(), 'utf-8'); - d.resolve(); - }); - return d.promise; + + try { + proj.parseSync(); + } catch (err) { + return Q.reject(new Error('An error occured during parsing of project.pbxproj. Start weeping. Output: ' + err)); + } + + if (targetDevice) { + events.emit('verbose', 'Set TARGETED_DEVICE_FAMILY to ' + targetDevice + '.'); + proj.updateBuildProperty('TARGETED_DEVICE_FAMILY', targetDevice); + } + + if (deploymentTarget) { + events.emit('verbose', 'Set IPHONEOS_DEPLOYMENT_TARGET to "' + deploymentTarget + '".'); + proj.updateBuildProperty('IPHONEOS_DEPLOYMENT_TARGET', deploymentTarget); + } + + fs.writeFileSync(this.pbxproj, proj.writeSync(), 'utf-8'); + + return Q(); }; // Construct a default value for CFBundleVersion as the version with any --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org