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/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/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..4056628b 100644 --- a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj @@ -436,6 +436,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 = ""; }; @@ -453,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 = ""; }; @@ -467,6 +469,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 +615,7 @@ 7F1A2F579A6F79C62DDA05712E2AB1F7 /* AppDelegate.swift */, 3797E591F302ECC0AA2FC607B190E2C8 /* Assets.xcassets */, C9DDE1B06BCC1CDE0ECF15895A14CD45 /* Info.plist */, + AAA49985DFFE797EE8416887CE54DD39 /* inputList.xcfilelist */, CE1F06D99242F4223D081F0DF78367F3 /* LaunchScreen.storyboard */, 9E17D598D98065767A04740F5E729CCA /* Localizable.strings */, 65C8D6D1DDC1512D396C07B712F31188 /* Localizable.stringsdict */, @@ -619,6 +623,7 @@ 814D72C2B921F60B759C2D4BB2604550 /* Main.storyboard */, 306796628DD52FA55E833B65DD4F2A22 /* Model.xcdatamodeld */, C7809CE9FE9852C2AA87ACE57B5DEF9E /* module.modulemap */, + 553D289724905857912C7A1D65ADD26F /* outputList.xcfilelist */, 0704B6CAFBB53E0EBB08F6B385901D43 /* ViewController.swift */, ); name = App; @@ -785,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 */, @@ -1328,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" */; @@ -1452,6 +1473,7 @@ 020A320BB3736FCDE6CC4E703EE69AC0 /* App_macOS */, 208179651927D1138D19B5AD54E29D2B /* App_watchOS */, 307AE3FA155FFD09B74AE351B15321B6 /* App_watchOS Extension */, + B61ED4688789B071275E2B7AC003F20B /* EntitledApp */, CE7D183D3752B5B35D2D8E6DC832BED5 /* Framework2_iOS */, FC26AF2506D3B2B40DE8A5F887952CE1 /* Framework2_macOS */, 8B9A14DC280CCE013CC8644093599CB1 /* Framework2_tvOS */, @@ -1692,13 +1714,13 @@ files = ( ); inputFileListPaths = ( - inputList.xcfilelist, + App_iOS/inputList.xcfilelist, ); inputPaths = ( ); name = MyScript; outputFileListPaths = ( - outputList.xcfilelist, + App_iOS/outputList.xcfilelist, ); outputPaths = ( ); @@ -1885,6 +1907,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + A0FE01FFC2B5A9FD21A898740AF5EA1D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; AE7971E1CA54D23C264E6541EA9BAE1B /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2210,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)", @@ -2501,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 = { @@ -2968,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)", @@ -3333,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)", @@ -3570,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 = { @@ -3673,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 = { @@ -3909,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)", @@ -3973,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)", @@ -4135,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 = { @@ -4357,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 = { @@ -4451,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)", @@ -4470,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 = { @@ -5219,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.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/build.sh b/Tests/Fixtures/TestProject/build.sh index ad36f73a..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" -xcodebuild -project Project.xcodeproj -scheme "App_iOS Test" -configuration "Test Debug" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty +⚙️ 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" -xcodebuild -project Project.xcodeproj -scheme "App_macOS" -configuration "Test Debug" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty +⚙️ 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" diff --git a/Tests/Fixtures/TestProject/project.yml b/Tests/Fixtures/TestProject/project.yml index 21656c36..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: @@ -49,10 +50,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: @@ -113,9 +110,17 @@ targets: script: | echo "You ran a script!" inputFileLists: - - inputList.xcfilelist + - App_iOS/inputList.xcfilelist outputFileLists: - - outputList.xcfilelist + - 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 diff --git a/build-fixtures.sh b/scripts/build-fixtures.sh similarity index 100% rename from build-fixtures.sh rename to scripts/build-fixtures.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