From d792b9f25b30e296382e586a7ba7b5dbc265af2c Mon Sep 17 00:00:00 2001 From: Yonas Kolb Date: Tue, 22 Jan 2019 15:44:00 +1100 Subject: [PATCH 1/3] add command line tool to ProjectTest fixture --- .../Project.xcodeproj/project.pbxproj | 110 ++++++++++++++++++ .../xcshareddata/xcschemes/Tool.xcscheme | 96 +++++++++++++++ Tests/Fixtures/TestProject/Tool/main.swift | 0 Tests/Fixtures/TestProject/project.yml | 6 + 4 files changed, 212 insertions(+) create mode 100644 Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/Tool.xcscheme create mode 100644 Tests/Fixtures/TestProject/Tool/main.swift diff --git a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj index dc0d55c3..b573bde4 100644 --- a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj @@ -115,6 +115,7 @@ F04CBE9A3D61F78E4FEE6A09AED606C0 /* StaticLibrary_ObjC.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5A2B916A11DCC2565241359FD0114B0C /* StaticLibrary_ObjC.h */; }; F08C4D2A18A75CC292F45F1FB8E06CDE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 108BB29172D27BE3BD1E7F3536D14EAD /* Assets.xcassets */; }; F7ECF245988DABA0164DFF08607F6C31 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D296BB7355994040E197A1EE5B41F583 /* Result.framework */; }; + F96940D55B77163B7A5B04FB2B8AF458 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93C033648A37D95027845BD34562053B /* main.swift */; }; FBDBC020EE959F32F0FF0E6252028356 /* Contacts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB2B6A77D39CD5602F2125F01DEF025 /* Contacts.framework */; }; FE01CB2392794EC5CD44533920AA051B /* StaticLibrary_ObjC.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5A2B916A11DCC2565241359FD0114B0C /* StaticLibrary_ObjC.h */; }; FE4C8407830C0189E1F61AFBEF16398B /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B76E17CE3574081D5BF45B449F3F46DB /* Result.framework */; }; @@ -459,6 +460,7 @@ 8A9274BE42A03DC5DA1FAD04992ED6E3 /* Framework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Framework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8CAF6C55B555E3E1352645B630CCB23E /* ExtensionDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionDelegate.swift; sourceTree = ""; }; 9390121B4ECBB1B796C7CBBDD32C4DD4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 93C033648A37D95027845BD34562053B /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 9A87A926D563773658FB87FEEE4DD132 /* iMessageApp.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = iMessageApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 9F27382DD66E26C059E26EFE8D6BEF4D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A0DC40025AB59B688E758829FB7EDB95 /* Framework2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Framework2.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -472,6 +474,7 @@ B76E17CE3574081D5BF45B449F3F46DB /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Result.framework; sourceTree = ""; }; BA040F1F7D6CA08878323A551349F18D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; BB178D03E75929F3F5B10C56838882EC /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Result.framework; sourceTree = ""; }; + BECEA4A483ADEB8158F640B356D10090 /* Tool */ = {isa = PBXFileReference; includeInIndex = 0; path = Tool; sourceTree = BUILT_PRODUCTS_DIR; }; C2F3574CCEF023755DDB1A06C6FE315C /* Mintfile */ = {isa = PBXFileReference; path = Mintfile; sourceTree = ""; }; C53ACB2962FED621389C36A2E1AE6E28 /* iMessageStickersExtension.appex */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "wrapper.app-extension"; path = iMessageStickersExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; C5ABEA2284F13483EFDF7C0E050F0450 /* MessagesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessagesViewController.swift; sourceTree = ""; }; @@ -650,6 +653,7 @@ 9DB22CB08CFAA455518700DBA5CAD7DE /* StandaloneFiles */, BDA839814AF73F01F771051894A708E8 /* StaticLibrary_ObjC */, CBDAC144248EE9D3838C6AAA35F55CB5 /* StaticLibrary_Swift */, + 8CFD8AD4820FAB9265663F9203506239 /* Tool */, 3FEA12CF227D41EF50E5C2DB21B84FBB /* Vendor */, 80C3A0E524EC1ABCB9149EA22136F282 /* XPC Service */, FC60FF5527FEDF545816FFCF26619677 /* Folder */, @@ -739,6 +743,14 @@ path = "XPC Service"; sourceTree = ""; }; + 8CFD8AD4820FAB9265663F9203506239 /* Tool */ = { + isa = PBXGroup; + children = ( + 93C033648A37D95027845BD34562053B /* main.swift */, + ); + path = Tool; + sourceTree = ""; + }; 912A7321F662FE41BAAEED67F628711F /* Mac */ = { isa = PBXGroup; children = ( @@ -789,6 +801,7 @@ 1313F043F19B484A5046E0748579814C /* StaticLibrary_ObjC.a */, EF92E90B6F1D583382BD85BEE4CD1896 /* StaticLibrary_ObjC.a */, D8D8907E2CDA1295D0D94F53FCD6939F /* StaticLibrary_Swift.a */, + BECEA4A483ADEB8158F640B356D10090 /* Tool */, 22237B8EBD9E6BE8EBC8735F5AA17192 /* XPC Service.xpc */, ); name = Products; @@ -1028,6 +1041,21 @@ productReference = B1C33BB070583BE3B0EC0E68083FE89C /* App_iOS.app */; productType = "com.apple.product-type.application"; }; + 090315A24AC8E8B8F318A709B9288671 /* Tool */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7881E73F05F096623E59204004CF8E23 /* Build configuration list for PBXNativeTarget "Tool" */; + buildPhases = ( + 2235AD7DEFC8FE534AB91B38BDF26FA4 /* Sources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Tool; + productName = Tool; + productReference = BECEA4A483ADEB8158F640B356D10090 /* Tool */; + productType = "com.apple.product-type.tool"; + }; 13E8C5AB873CEE21E18E552F5E94B768 /* StaticLibrary_ObjC_iOS */ = { isa = PBXNativeTarget; buildConfigurationList = 56BF985F253DD84AD7C3753800E07F6D /* Build configuration list for PBXNativeTarget "StaticLibrary_ObjC_iOS" */; @@ -1439,6 +1467,7 @@ 7D3D92034F4F203C140574F08DF5F38F /* StaticLibrary_ObjC_watchOS */, 19BFB84599B0AA1275A9662DCB5C0E50 /* StaticLibrary_Swift */, BF3693DCA6182D7AEC410AFC08078F33 /* SuperTarget */, + 090315A24AC8E8B8F318A709B9288671 /* Tool */, E7815F2F0D9CDECF9185AAF3A6B474C1 /* XPC Service */, 834F55973F05AC8A18144DB04FF6F2C7 /* iMessageApp */, 1C26A6A0BC446191F311D470FDFF54F8 /* iMessageExtension */, @@ -1693,6 +1722,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 2235AD7DEFC8FE534AB91B38BDF26FA4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F96940D55B77163B7A5B04FB2B8AF458 /* main.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 247A4E3947EC2AFB733A1B00BCEF9EC2 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2375,6 +2412,16 @@ }; name = "Production Release"; }; + 18B5349AE18B7183BE4B43630876517C /* Staging Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.project.Tool; + SDKROOT = macosx; + }; + name = "Staging Release"; + }; 196FEEE6C4B0DDE53AD16BD6E5645F0E /* Test Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2679,6 +2726,16 @@ }; name = "Production Debug"; }; + 436FB4981A66822DAF6F22ACC8B60E23 /* Production Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.project.Tool; + SDKROOT = macosx; + }; + name = "Production Debug"; + }; 4621C6C8A78FBB1CF4078178688742F9 /* Production Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -3461,6 +3518,16 @@ }; name = "Test Debug"; }; + 921EC740167F616C38809275FD6C52C9 /* Production Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.project.Tool; + SDKROOT = macosx; + }; + name = "Production Release"; + }; 92602C025633FBA848F91812F4CD6D45 /* Production Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -3576,6 +3643,16 @@ }; name = "Production Debug"; }; + 98A87959E6B746416846959429725DCB /* Staging Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.project.Tool; + SDKROOT = macosx; + }; + name = "Staging Debug"; + }; 9A891313A139893990989BDDFA989F3A /* Test Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -4056,6 +4133,16 @@ }; name = "Production Debug"; }; + C00DBF60DC8C1A570738241F19D127F9 /* Test Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.project.Tool; + SDKROOT = macosx; + }; + name = "Test Release"; + }; C0D5765142C68AF68B954B3F748538C2 /* Production Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -4230,6 +4317,16 @@ }; name = "Test Release"; }; + CA45EC48C1EDE1A41141A103C7CE467A /* Test Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.project.Tool; + SDKROOT = macosx; + }; + name = "Test Debug"; + }; CBE9D80AD0719511A13A889E867077CC /* Staging Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -5040,6 +5137,19 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = ""; }; + 7881E73F05F096623E59204004CF8E23 /* Build configuration list for PBXNativeTarget "Tool" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 436FB4981A66822DAF6F22ACC8B60E23 /* Production Debug */, + 921EC740167F616C38809275FD6C52C9 /* Production Release */, + 98A87959E6B746416846959429725DCB /* Staging Debug */, + 18B5349AE18B7183BE4B43630876517C /* Staging Release */, + CA45EC48C1EDE1A41141A103C7CE467A /* Test Debug */, + C00DBF60DC8C1A570738241F19D127F9 /* Test Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = ""; + }; 7CBF487CACC0BBFB530D79633BC124AA /* Build configuration list for PBXAggregateTarget "SuperTarget" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/Tool.xcscheme b/Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/Tool.xcscheme new file mode 100644 index 00000000..38d9cc5d --- /dev/null +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/Tool.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/Fixtures/TestProject/Tool/main.swift b/Tests/Fixtures/TestProject/Tool/main.swift new file mode 100644 index 00000000..e69de29b diff --git a/Tests/Fixtures/TestProject/project.yml b/Tests/Fixtures/TestProject/project.yml index 6d387766..077127ae 100644 --- a/Tests/Fixtures/TestProject/project.yml +++ b/Tests/Fixtures/TestProject/project.yml @@ -212,6 +212,12 @@ targets: sources: - path: XPC Service + Tool: + type: tool + platform: macOS + sources: [Tool] + scheme: {} + schemes: Framework: build: From 7581653b8536f1e6ed107a80fde93e6f8ffd0835 Mon Sep 17 00:00:00 2001 From: Yonas Kolb Date: Tue, 22 Jan 2019 15:44:55 +1100 Subject: [PATCH 2/3] fix tools not being added as executables in schemes --- Sources/ProjectSpec/XCProjExtensions.swift | 2 +- .../Project.xcodeproj/xcshareddata/xcschemes/Tool.xcscheme | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Sources/ProjectSpec/XCProjExtensions.swift b/Sources/ProjectSpec/XCProjExtensions.swift index bd3541a1..353d777b 100644 --- a/Sources/ProjectSpec/XCProjExtensions.swift +++ b/Sources/ProjectSpec/XCProjExtensions.swift @@ -35,7 +35,7 @@ extension PBXProductType { } public var isExecutable: Bool { - return isApp || isExtension || isTest + return isApp || isExtension || isTest || self == .commandLineTool } public var name: String { diff --git a/Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/Tool.xcscheme b/Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/Tool.xcscheme index 38d9cc5d..ac9a9963 100644 --- a/Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/Tool.xcscheme +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/Tool.xcscheme @@ -53,7 +53,8 @@ debugDocumentVersioning = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES"> - + - + From 0751952a65d60ac0d7543c0133c25140f9486c43 Mon Sep 17 00:00:00 2001 From: Yonas Kolb Date: Tue, 22 Jan 2019 15:49:08 +1100 Subject: [PATCH 3/3] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45950aa9..5543b75d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ #### Fixed - Fixed `--project` argument not taking effect [#487](https://github.com/yonaskolb/XcodeGen/pull/487) @monowerker - Fixed Sticker Packs from generating an empty Source file phase which caused in error in the new build system [#492](https://github.com/yonaskolb/XcodeGen/pull/492) @rpassis +- Fixed generated schemes for tool targets not setting the executable [#496](https://github.com/yonaskolb/XcodeGen/pull/496) @yonaskolb ## 2.1.0