From c1edaff4dff25da1441da90df49bbe6c2b583422 Mon Sep 17 00:00:00 2001 From: Yonas Kolb Date: Sat, 2 Feb 2019 12:25:55 +1100 Subject: [PATCH 1/9] remove xcpretty from fixture builds --- Tests/Fixtures/TestProject/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Fixtures/TestProject/build.sh b/Tests/Fixtures/TestProject/build.sh index ad36f73a..d933d114 100755 --- a/Tests/Fixtures/TestProject/build.sh +++ b/Tests/Fixtures/TestProject/build.sh @@ -4,7 +4,7 @@ set -e carthage bootstrap --cache-builds echo " Building iOS app" -xcodebuild -project Project.xcodeproj -scheme "App_iOS Test" -configuration "Test Debug" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty +xcodebuild -project Project.xcodeproj -scheme "App_iOS Test" -configuration "Test Debug" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO echo " Building macOS app" -xcodebuild -project Project.xcodeproj -scheme "App_macOS" -configuration "Test Debug" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty +xcodebuild -project Project.xcodeproj -scheme "App_macOS" -configuration "Test Debug" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO From df168dd9fae9e74fa27b4aeedde4fcf5148b6491 Mon Sep 17 00:00:00 2001 From: Yonas Kolb Date: Sat, 2 Feb 2019 13:04:08 +1100 Subject: [PATCH 2/9] get iOS app compiling --- .../TestProject/App_iOS/inputList.xcfilelist | 0 .../TestProject/App_iOS/outputList.xcfilelist | 0 .../TestProject/Project.xcodeproj/project.pbxproj | 12 ++++++++++-- Tests/Fixtures/TestProject/project.yml | 4 ++-- 4 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 Tests/Fixtures/TestProject/App_iOS/inputList.xcfilelist create mode 100644 Tests/Fixtures/TestProject/App_iOS/outputList.xcfilelist diff --git a/Tests/Fixtures/TestProject/App_iOS/inputList.xcfilelist b/Tests/Fixtures/TestProject/App_iOS/inputList.xcfilelist new file mode 100644 index 00000000..e69de29b diff --git a/Tests/Fixtures/TestProject/App_iOS/outputList.xcfilelist b/Tests/Fixtures/TestProject/App_iOS/outputList.xcfilelist new file mode 100644 index 00000000..e69de29b diff --git a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj index 8979eb5c..6dc0901f 100644 --- a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj @@ -23,6 +23,7 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 0220391495C1E822D952DDE68B11AEB8 /* outputList.xcfilelist in Resources */ = {isa = PBXBuildFile; fileRef = 553D289724905857912C7A1D65ADD26F /* outputList.xcfilelist */; }; 03F389DFD30F3CE5A441925C10CAED46 /* MessagesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5ABEA2284F13483EFDF7C0E050F0450 /* MessagesViewController.swift */; }; 03FC73E479EBD3CFF4E55BBC6CC82311 /* MyFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A58A16491CDDF968B0D56DE7EB96D92 /* MyFramework.h */; settings = {ATTRIBUTES = (Public, ); }; }; 097B0B6C198B9A52D4312F11000496FD /* App_watchOS.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = A680BE9F68A255B0FB291AE6F0A2B045 /* App_watchOS.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; @@ -74,6 +75,7 @@ 7A3C2B80CE0F5D42B7684BF5928B1694 /* Headers in Headers */ = {isa = PBXBuildFile; fileRef = 2E1E747C7BC434ADB80CC269B7B595DC /* Headers */; settings = {ATTRIBUTES = (Public, ); }; }; 7C9152ACD50B4F96C205B0DDEFD7D6D3 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B47B80AF9EAE0ADB4FA469CFDB7ABB8F /* MainInterface.storyboard */; }; 7E84045B3F49256D14A8E8C1FF19490A /* NotificationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C934C1F7A68CCD0AB6B384782470EE7B /* NotificationController.swift */; }; + 7EB82D5622290C763B5283B9689AB9F8 /* inputList.xcfilelist in Resources */ = {isa = PBXBuildFile; fileRef = AAA49985DFFE797EE8416887CE54DD39 /* inputList.xcfilelist */; }; 7EC05429C10D0A00A8AE38CADF3F5DCA /* XPC_Service.m in Sources */ = {isa = PBXBuildFile; fileRef = 148B7C933698BCC4F1DBA979CF051F81 /* XPC_Service.m */; }; 824FECDE01A22CDE6C288C1969A645E9 /* FrameworkFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A5F527F2590C149565181748C7DBECD /* FrameworkFile.swift */; }; 82D432D23D2ACC56338BE911465E6F89 /* Framework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41FC82ED1C4C3B7B3D7B2FB721574442 /* Framework.framework */; }; @@ -436,6 +438,7 @@ 4BF4D16042A80576D259160C97AD2C2E /* Model 3.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Model 3.xcdatamodel"; sourceTree = ""; }; 4D0BF47DF71A6DBA33ED23FD22D023EF /* StaticLibrary_ObjC.a */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = archive.ar; path = StaticLibrary_ObjC.a; sourceTree = BUILT_PRODUCTS_DIR; }; 5116B3B58070BCD09F1487BAFC210EE0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 553D289724905857912C7A1D65ADD26F /* outputList.xcfilelist */ = {isa = PBXFileReference; path = outputList.xcfilelist; sourceTree = ""; }; 564E35E83C95F5591345B7722A59AA4E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 57FF8864B8EBAB5777DC12E62D66732F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 587B9E9A3533E965CA602B763210583F /* TestProjectUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestProjectUITests.swift; sourceTree = ""; }; @@ -467,6 +470,7 @@ A3F6BCB5FEFB16F1BA368059F4B1505A /* InterfaceController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InterfaceController.swift; sourceTree = ""; }; A4C3FE6B986506724DAB5D0FC4361D53 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; A680BE9F68A255B0FB291AE6F0A2B045 /* App_watchOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App_watchOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; + AAA49985DFFE797EE8416887CE54DD39 /* inputList.xcfilelist */ = {isa = PBXFileReference; path = inputList.xcfilelist; sourceTree = ""; }; AB055761199DF36DB0C629A608A4EF3A /* Framework2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Framework2.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B17B8D9C9B391332CD176A355AD24669 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LocalizedStoryboard.storyboard; sourceTree = ""; }; B1C33BB070583BE3B0EC0E68083FE89C /* App_iOS.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = App_iOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -612,6 +616,7 @@ 7F1A2F579A6F79C62DDA05712E2AB1F7 /* AppDelegate.swift */, 3797E591F302ECC0AA2FC607B190E2C8 /* Assets.xcassets */, C9DDE1B06BCC1CDE0ECF15895A14CD45 /* Info.plist */, + AAA49985DFFE797EE8416887CE54DD39 /* inputList.xcfilelist */, CE1F06D99242F4223D081F0DF78367F3 /* LaunchScreen.storyboard */, 9E17D598D98065767A04740F5E729CCA /* Localizable.strings */, 65C8D6D1DDC1512D396C07B712F31188 /* Localizable.stringsdict */, @@ -619,6 +624,7 @@ 814D72C2B921F60B759C2D4BB2604550 /* Main.storyboard */, 306796628DD52FA55E833B65DD4F2A22 /* Model.xcdatamodeld */, C7809CE9FE9852C2AA87ACE57B5DEF9E /* module.modulemap */, + 553D289724905857912C7A1D65ADD26F /* outputList.xcfilelist */, 0704B6CAFBB53E0EBB08F6B385901D43 /* ViewController.swift */, ); name = App; @@ -1524,6 +1530,8 @@ CBAC0459E3DCD72B512329E604C46B2E /* MyBundle.bundle in Resources */, 8493DEA48BF40EFFAC6FBD459C0E9EE4 /* ResourceFolder in Resources */, 36F2B8CC97BD885A59E4FBA6EBC8EB22 /* StandaloneAssets.xcassets in Resources */, + 7EB82D5622290C763B5283B9689AB9F8 /* inputList.xcfilelist in Resources */, + 0220391495C1E822D952DDE68B11AEB8 /* outputList.xcfilelist in Resources */, EF285B90A968453FA1CB0CDE8C0AD440 /* iMessageApp.app in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1692,13 +1700,13 @@ files = ( ); inputFileListPaths = ( - inputList.xcfilelist, + App_iOS/inputList.xcfilelist, ); inputPaths = ( ); name = MyScript; outputFileListPaths = ( - outputList.xcfilelist, + App_iOS/outputList.xcfilelist, ); outputPaths = ( ); diff --git a/Tests/Fixtures/TestProject/project.yml b/Tests/Fixtures/TestProject/project.yml index 21656c36..8f186318 100644 --- a/Tests/Fixtures/TestProject/project.yml +++ b/Tests/Fixtures/TestProject/project.yml @@ -113,9 +113,9 @@ targets: script: | echo "You ran a script!" inputFileLists: - - inputList.xcfilelist + - App_iOS/inputList.xcfilelist outputFileLists: - - outputList.xcfilelist + - App_iOS/outputList.xcfilelist App_watchOS: type: application.watchapp2 From 064ab394348157d1e665e9418dcde4ac21b7966e Mon Sep 17 00:00:00 2001 From: Yonas Kolb Date: Sat, 2 Feb 2019 13:05:36 +1100 Subject: [PATCH 3/9] make the default build phase for xcfilelist to be nothing --- Sources/XcodeGenKit/SourceGenerator.swift | 1 + Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Sources/XcodeGenKit/SourceGenerator.swift b/Sources/XcodeGenKit/SourceGenerator.swift index 8c79314e..0c9e1f26 100644 --- a/Sources/XcodeGenKit/SourceGenerator.swift +++ b/Sources/XcodeGenKit/SourceGenerator.swift @@ -218,6 +218,7 @@ class SourceGenerator { "entitlements", "gpx", "lproj", + "xcfilelist", "apns": return nil default: diff --git a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj index 6dc0901f..12d96856 100644 --- a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj @@ -23,7 +23,6 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ - 0220391495C1E822D952DDE68B11AEB8 /* outputList.xcfilelist in Resources */ = {isa = PBXBuildFile; fileRef = 553D289724905857912C7A1D65ADD26F /* outputList.xcfilelist */; }; 03F389DFD30F3CE5A441925C10CAED46 /* MessagesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5ABEA2284F13483EFDF7C0E050F0450 /* MessagesViewController.swift */; }; 03FC73E479EBD3CFF4E55BBC6CC82311 /* MyFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A58A16491CDDF968B0D56DE7EB96D92 /* MyFramework.h */; settings = {ATTRIBUTES = (Public, ); }; }; 097B0B6C198B9A52D4312F11000496FD /* App_watchOS.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = A680BE9F68A255B0FB291AE6F0A2B045 /* App_watchOS.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; @@ -75,7 +74,6 @@ 7A3C2B80CE0F5D42B7684BF5928B1694 /* Headers in Headers */ = {isa = PBXBuildFile; fileRef = 2E1E747C7BC434ADB80CC269B7B595DC /* Headers */; settings = {ATTRIBUTES = (Public, ); }; }; 7C9152ACD50B4F96C205B0DDEFD7D6D3 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B47B80AF9EAE0ADB4FA469CFDB7ABB8F /* MainInterface.storyboard */; }; 7E84045B3F49256D14A8E8C1FF19490A /* NotificationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C934C1F7A68CCD0AB6B384782470EE7B /* NotificationController.swift */; }; - 7EB82D5622290C763B5283B9689AB9F8 /* inputList.xcfilelist in Resources */ = {isa = PBXBuildFile; fileRef = AAA49985DFFE797EE8416887CE54DD39 /* inputList.xcfilelist */; }; 7EC05429C10D0A00A8AE38CADF3F5DCA /* XPC_Service.m in Sources */ = {isa = PBXBuildFile; fileRef = 148B7C933698BCC4F1DBA979CF051F81 /* XPC_Service.m */; }; 824FECDE01A22CDE6C288C1969A645E9 /* FrameworkFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A5F527F2590C149565181748C7DBECD /* FrameworkFile.swift */; }; 82D432D23D2ACC56338BE911465E6F89 /* Framework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41FC82ED1C4C3B7B3D7B2FB721574442 /* Framework.framework */; }; @@ -1530,8 +1528,6 @@ CBAC0459E3DCD72B512329E604C46B2E /* MyBundle.bundle in Resources */, 8493DEA48BF40EFFAC6FBD459C0E9EE4 /* ResourceFolder in Resources */, 36F2B8CC97BD885A59E4FBA6EBC8EB22 /* StandaloneAssets.xcassets in Resources */, - 7EB82D5622290C763B5283B9689AB9F8 /* inputList.xcfilelist in Resources */, - 0220391495C1E822D952DDE68B11AEB8 /* outputList.xcfilelist in Resources */, EF285B90A968453FA1CB0CDE8C0AD440 /* iMessageApp.app in Resources */, ); runOnlyForDeploymentPostprocessing = 0; From da7be20176ab227e9a777a1562f3c68d25192244 Mon Sep 17 00:00:00 2001 From: Yonas Kolb Date: Sat, 2 Feb 2019 13:12:37 +1100 Subject: [PATCH 4/9] generated fixture in build script --- build-fixtures.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build-fixtures.sh b/build-fixtures.sh index f5ca8ebe..f13a3ae5 100755 --- a/build-fixtures.sh +++ b/build-fixtures.sh @@ -1,5 +1,6 @@ #!/bin/bash set -e +swift run xcodegen --spec Tests/Fixtures/TestProject/project.yml cd Tests/Fixtures/TestProject ./build.sh From 2ca26a5fc1d00877a04cf1eaf72790631c95baf9 Mon Sep 17 00:00:00 2001 From: Yonas Kolb Date: Sat, 2 Feb 2019 13:13:03 +1100 Subject: [PATCH 5/9] remove entitlements from main iOS app so it can build --- .../Project.xcodeproj/project.pbxproj | 128 +++++++++++++++++- Tests/Fixtures/TestProject/project.yml | 12 +- 2 files changed, 130 insertions(+), 10 deletions(-) diff --git a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj index 12d96856..4056628b 100644 --- a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj @@ -454,6 +454,7 @@ 7B5068D64404C61A67A184584E13804D /* MyBundle.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = MyBundle.bundle; sourceTree = ""; }; 7C176A8297AC2F5207352BA80F60ADB0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = ""; }; 7D67F1C1BFBACE101DE7DB5179F2DCEA /* Framework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Framework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 7D700FA699849D2F95216883E585B959 /* EntitledApp.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = EntitledApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 7DE38C10AB71A47B786D5BF205BA002F /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = ""; }; 7F1A2F579A6F79C62DDA05712E2AB1F7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7FDC16E1938AA114B67D87A9822E86D7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Interface.storyboard; sourceTree = ""; }; @@ -789,6 +790,7 @@ 33F6DCDC37D2E66543D4965D829900E1 /* App_macOS.app */, 0D09D243DBCF9D32E239F1E8A64D75AB /* App_watchOS Extension.appex */, A680BE9F68A255B0FB291AE6F0A2B045 /* App_watchOS.app */, + 7D700FA699849D2F95216883E585B959 /* EntitledApp.app */, 8A9274BE42A03DC5DA1FAD04992ED6E3 /* Framework.framework */, 41FC82ED1C4C3B7B3D7B2FB721574442 /* Framework.framework */, 7D67F1C1BFBACE101DE7DB5179F2DCEA /* Framework.framework */, @@ -1332,6 +1334,21 @@ productReference = 8A9274BE42A03DC5DA1FAD04992ED6E3 /* Framework.framework */; productType = "com.apple.product-type.framework"; }; + B61ED4688789B071275E2B7AC003F20B /* EntitledApp */ = { + isa = PBXNativeTarget; + buildConfigurationList = 91E8D6B95F23669734D43FDCD5DCC2C7 /* Build configuration list for PBXNativeTarget "EntitledApp" */; + buildPhases = ( + A0FE01FFC2B5A9FD21A898740AF5EA1D /* Sources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = EntitledApp; + productName = EntitledApp; + productReference = 7D700FA699849D2F95216883E585B959 /* EntitledApp.app */; + productType = "com.apple.product-type.application"; + }; CE7D183D3752B5B35D2D8E6DC832BED5 /* Framework2_iOS */ = { isa = PBXNativeTarget; buildConfigurationList = 9A0EF0B71AD44055E8749C42210FBBE8 /* Build configuration list for PBXNativeTarget "Framework2_iOS" */; @@ -1456,6 +1473,7 @@ 020A320BB3736FCDE6CC4E703EE69AC0 /* App_macOS */, 208179651927D1138D19B5AD54E29D2B /* App_watchOS */, 307AE3FA155FFD09B74AE351B15321B6 /* App_watchOS Extension */, + B61ED4688789B071275E2B7AC003F20B /* EntitledApp */, CE7D183D3752B5B35D2D8E6DC832BED5 /* Framework2_iOS */, FC26AF2506D3B2B40DE8A5F887952CE1 /* Framework2_macOS */, 8B9A14DC280CCE013CC8644093599CB1 /* Framework2_tvOS */, @@ -1889,6 +1907,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + A0FE01FFC2B5A9FD21A898740AF5EA1D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; AE7971E1CA54D23C264E6541EA9BAE1B /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2214,7 +2239,6 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_ENTITLEMENTS = App_iOS/App.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -2505,6 +2529,20 @@ }; name = "Production Debug"; }; + 234640A811EF6EB9CC9081CA803A4C19 /* Staging Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = App_iOS/App.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.project.EntitledApp; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = "Staging Debug"; + }; 236247F0F85C9D342FAEE803854E5159 /* Staging Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2972,7 +3010,6 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_ENTITLEMENTS = App_iOS/App.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3337,7 +3374,6 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_ENTITLEMENTS = App_iOS/App.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3574,6 +3610,20 @@ }; name = "Production Debug"; }; + 94295771D06A8E3DC6DCC8ADE73874F7 /* Staging Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = App_iOS/App.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.project.EntitledApp; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = "Staging Release"; + }; 943D402E936EC5BD391F9FD0C7D926EA /* Production Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -3677,6 +3727,20 @@ }; name = "Production Debug"; }; + 983ACA9F991B0B18D9760B122B42614C /* Test Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = App_iOS/App.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.project.EntitledApp; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = "Test Release"; + }; 98A87959E6B746416846959429725DCB /* Staging Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -3913,7 +3977,6 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_ENTITLEMENTS = App_iOS/App.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3977,7 +4040,6 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_ENTITLEMENTS = App_iOS/App.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -4139,6 +4201,20 @@ }; name = "Production Release"; }; + BA5AD3137CD90C50E5E1BDA06645F11E /* Production Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = App_iOS/App.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.project.EntitledApp; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = "Production Release"; + }; BBA736CF3FB466E323EA84621521053D /* Test Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -4361,6 +4437,20 @@ }; name = "Test Debug"; }; + CB4F81A519CA89CAF5703DAB428CCE0A /* Test Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = App_iOS/App.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.project.EntitledApp; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = "Test Debug"; + }; CBE9D80AD0719511A13A889E867077CC /* Staging Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -4455,7 +4545,6 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_ENTITLEMENTS = App_iOS/App.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -4474,6 +4563,20 @@ }; name = "Test Release"; }; + DDECE7D81A63C1C46A08F1F47ACCE4DF /* Production Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = App_iOS/App.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.project.EntitledApp; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = "Production Debug"; + }; E24703CFCCBD727B3FE08F51C14A0CC8 /* Test Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -5223,6 +5326,19 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = ""; }; + 91E8D6B95F23669734D43FDCD5DCC2C7 /* Build configuration list for PBXNativeTarget "EntitledApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DDECE7D81A63C1C46A08F1F47ACCE4DF /* Production Debug */, + BA5AD3137CD90C50E5E1BDA06645F11E /* Production Release */, + 234640A811EF6EB9CC9081CA803A4C19 /* Staging Debug */, + 94295771D06A8E3DC6DCC8ADE73874F7 /* Staging Release */, + CB4F81A519CA89CAF5703DAB428CCE0A /* Test Debug */, + 983ACA9F991B0B18D9760B122B42614C /* Test Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = ""; + }; 9A0EF0B71AD44055E8749C42210FBBE8 /* Build configuration list for PBXNativeTarget "Framework2_iOS" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Tests/Fixtures/TestProject/project.yml b/Tests/Fixtures/TestProject/project.yml index 8f186318..79cd06ed 100644 --- a/Tests/Fixtures/TestProject/project.yml +++ b/Tests/Fixtures/TestProject/project.yml @@ -49,10 +49,6 @@ targets: App_iOS: type: application platform: iOS - entitlements: - path: App_iOS/App.entitlements - properties: - com.apple.security.application-groups: group.com.app attributes: ProvisioningStyle: Automatic sources: @@ -117,6 +113,14 @@ targets: outputFileLists: - App_iOS/outputList.xcfilelist + EntitledApp: + type: application + platform: iOS + entitlements: + path: App_iOS/App.entitlements + properties: + com.apple.security.application-groups: group.com.app + App_watchOS: type: application.watchapp2 platform: watchOS From eb02ebe3d06fc0fac0c43845d9e40657b528cbd9 Mon Sep 17 00:00:00 2001 From: Yonas Kolb Date: Sat, 2 Feb 2019 13:15:20 +1100 Subject: [PATCH 6/9] add macOS app scheme --- .../xcshareddata/xcschemes/App_macOS.xcscheme | 97 +++++++++++++++++++ Tests/Fixtures/TestProject/project.yml | 1 + 2 files changed, 98 insertions(+) create mode 100644 Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/App_macOS.xcscheme diff --git a/Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/App_macOS.xcscheme b/Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/App_macOS.xcscheme new file mode 100644 index 00000000..08425a7c --- /dev/null +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/App_macOS.xcscheme @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/Fixtures/TestProject/project.yml b/Tests/Fixtures/TestProject/project.yml index 79cd06ed..e46ea409 100644 --- a/Tests/Fixtures/TestProject/project.yml +++ b/Tests/Fixtures/TestProject/project.yml @@ -26,6 +26,7 @@ targets: App_macOS: type: application platform: macOS + scheme: {} info: path: App_macOS/Info.plist properties: From aeaf35e197d38cd75fc0bccba0df025c3db738dc Mon Sep 17 00:00:00 2001 From: Yonas Kolb Date: Sat, 2 Feb 2019 13:21:19 +1100 Subject: [PATCH 7/9] move ci scripts and add generation step --- .circleci/config.yml | 11 +++++++---- build-fixtures.sh | 6 ------ scripts/build-fixtures.sh | 5 +++++ diff-fixtures.sh => scripts/diff-fixtures.sh | 0 scripts/{gen_fixtures.sh => gen-fixtures.sh} | 3 +++ 5 files changed, 15 insertions(+), 10 deletions(-) delete mode 100755 build-fixtures.sh create mode 100755 scripts/build-fixtures.sh rename diff-fixtures.sh => scripts/diff-fixtures.sh (100%) rename scripts/{gen_fixtures.sh => gen-fixtures.sh} (76%) diff --git a/.circleci/config.yml b/.circleci/config.yml index f1edcc7f..9affa0f8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,11 +12,14 @@ jobs: name: Test command: swift test 2>&1 | xcpretty - run: - name: Check Project Diff - command: ./diff-fixtures.sh + name: Generate Fixtures + command: scripts/gen-fixtures.sh - run: - name: Build Test Project - command: ./build-fixtures.sh + name: Check Fixture Diffs + command: scripts/diff-fixtures.sh + - run: + name: Build Fixtures + command: scripts/build-fixtures.sh - run: name: Build release command: make build diff --git a/build-fixtures.sh b/build-fixtures.sh deleted file mode 100755 index f13a3ae5..00000000 --- a/build-fixtures.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -set -e - -swift run xcodegen --spec Tests/Fixtures/TestProject/project.yml -cd Tests/Fixtures/TestProject -./build.sh diff --git a/scripts/build-fixtures.sh b/scripts/build-fixtures.sh new file mode 100755 index 00000000..f5ca8ebe --- /dev/null +++ b/scripts/build-fixtures.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -e + +cd Tests/Fixtures/TestProject +./build.sh diff --git a/diff-fixtures.sh b/scripts/diff-fixtures.sh similarity index 100% rename from diff-fixtures.sh rename to scripts/diff-fixtures.sh diff --git a/scripts/gen_fixtures.sh b/scripts/gen-fixtures.sh similarity index 76% rename from scripts/gen_fixtures.sh rename to scripts/gen-fixtures.sh index 428d236e..3d77d567 100755 --- a/scripts/gen_fixtures.sh +++ b/scripts/gen-fixtures.sh @@ -1 +1,4 @@ +#!/bin/bash +set -e + swift run xcodegen --spec Tests/Fixtures/TestProject/project.yml From 474874d00fe6d5a8c0c5a06cc567dd53433e2f5b Mon Sep 17 00:00:00 2001 From: Yonas Kolb Date: Sat, 2 Feb 2019 13:23:04 +1100 Subject: [PATCH 8/9] add --quite to xcodebuild --- Tests/Fixtures/TestProject/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Fixtures/TestProject/build.sh b/Tests/Fixtures/TestProject/build.sh index d933d114..12b64bb6 100755 --- a/Tests/Fixtures/TestProject/build.sh +++ b/Tests/Fixtures/TestProject/build.sh @@ -4,7 +4,7 @@ set -e carthage bootstrap --cache-builds echo " Building iOS app" -xcodebuild -project Project.xcodeproj -scheme "App_iOS Test" -configuration "Test Debug" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO +xcodebuild -quiet -project Project.xcodeproj -scheme "App_iOS Test" -configuration "Test Debug" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO echo " Building macOS app" -xcodebuild -project Project.xcodeproj -scheme "App_macOS" -configuration "Test Debug" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO +xcodebuild -quiet -project Project.xcodeproj -scheme "App_macOS" -configuration "Test Debug" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO From f9d152d46a0d5d8c07eb52fcf32807f87a24ac30 Mon Sep 17 00:00:00 2001 From: Yonas Kolb Date: Sat, 2 Feb 2019 13:26:40 +1100 Subject: [PATCH 9/9] add some friendlier output to build script --- Tests/Fixtures/TestProject/build.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Tests/Fixtures/TestProject/build.sh b/Tests/Fixtures/TestProject/build.sh index 12b64bb6..19f44a14 100755 --- a/Tests/Fixtures/TestProject/build.sh +++ b/Tests/Fixtures/TestProject/build.sh @@ -3,8 +3,11 @@ set -e carthage bootstrap --cache-builds echo " -Building iOS app" +⚙️ Building iOS app" xcodebuild -quiet -project Project.xcodeproj -scheme "App_iOS Test" -configuration "Test Debug" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO +echo "✅ Successfully built iOS app" + echo " -Building macOS app" +⚙️ Building macOS app" xcodebuild -quiet -project Project.xcodeproj -scheme "App_macOS" -configuration "Test Debug" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO +echo "✅ Successfully built macOS app"