From 07cddccb3bc50673e211b4aab72f777acdb4f747 Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Tue, 26 Mar 2019 22:33:51 +1100 Subject: [PATCH 01/22] test swift 5 --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9affa0f8..6b9507be 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,8 +1,8 @@ version: 2 jobs: - macOS_swift_4.2: + macOS_swift_5.0: macos: - xcode: "10.0.0" + xcode: "10.2.0" steps: - checkout - run: @@ -27,4 +27,4 @@ workflows: version: 2 workflow: jobs: - - macOS_swift_4.2 + - macOS_swift_5.0 From ad276a8bc8421e6797c3668afe848cd4f331946b Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Tue, 26 Mar 2019 22:33:46 +1100 Subject: [PATCH 02/22] support Swift 5 --- Sources/ProjectSpec/Scheme.swift | 2 +- Sources/XcodeGen/main.swift | 2 +- Sources/XcodeGenKit/MD5.swift | 4 ++-- Sources/XcodeGenKit/SourceGenerator.swift | 4 ++-- Tests/XcodeGenKitTests/ProjectSpecTests.swift | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Sources/ProjectSpec/Scheme.swift b/Sources/ProjectSpec/Scheme.swift index 907ccffd..6865c284 100644 --- a/Sources/ProjectSpec/Scheme.swift +++ b/Sources/ProjectSpec/Scheme.swift @@ -377,7 +377,7 @@ extension XCScheme.EnvironmentVariable: JSONObjectConvertible { value = try jsonDictionary.json(atKeyPath: "value") } let variable: String = try jsonDictionary.json(atKeyPath: "variable") - let enabled: Bool = (try? jsonDictionary.json(atKeyPath: "isEnabled")) ?? true + let enabled: Bool = jsonDictionary.json(atKeyPath: "isEnabled") ?? true self.init(variable: variable, value: value, enabled: enabled) } diff --git a/Sources/XcodeGen/main.swift b/Sources/XcodeGen/main.swift index 3bf80ef9..b984a7af 100644 --- a/Sources/XcodeGen/main.swift +++ b/Sources/XcodeGen/main.swift @@ -2,6 +2,6 @@ import Foundation import ProjectSpec import XcodeGenCLI -let version = try Version("2.3.0") +let version = Version("2.3.0") let cli = XcodeGenCLI(version: version) cli.execute() diff --git a/Sources/XcodeGenKit/MD5.swift b/Sources/XcodeGenKit/MD5.swift index b52f772a..1514774d 100644 --- a/Sources/XcodeGenKit/MD5.swift +++ b/Sources/XcodeGenKit/MD5.swift @@ -20,8 +20,8 @@ import Foundation extension String { public var md5: String { if let data = data(using: .utf8, allowLossyConversion: true) { - let message = data.withUnsafeBytes { bytes -> [UInt8] in - return Array(UnsafeBufferPointer(start: bytes, count: data.count)) + let message = data.withUnsafeBytes { (bytes: UnsafeRawBufferPointer) -> [UInt8] in + return Array(bytes) } let MD5Calculator = MD5(message) diff --git a/Sources/XcodeGenKit/SourceGenerator.swift b/Sources/XcodeGenKit/SourceGenerator.swift index 7e283967..a6014092 100644 --- a/Sources/XcodeGenKit/SourceGenerator.swift +++ b/Sources/XcodeGenKit/SourceGenerator.swift @@ -148,7 +148,7 @@ class SourceGenerator { // order by taking the last item in the sortedPaths array let currentVersionPath = findCurrentCoreDataModelVersionPath(using: versionedModels) ?? sortedPaths.last let currentVersion: PBXFileReference? = { - guard let indexOf = sortedPaths.index(where: { $0 == currentVersionPath }) else { return nil } + guard let indexOf = sortedPaths.firstIndex(where: { $0 == currentVersionPath }) else { return nil } return modelFileReferences[indexOf] }() let versionGroup = addObject(XCVersionGroup( @@ -561,7 +561,7 @@ class SourceGenerator { let versionPath = versionedModels.first(where: { $0.lastComponent == ".xccurrentversion" }), let data = try? versionPath.read(), let plist = try? PropertyListSerialization.propertyList(from: data, options: [], format: nil) as? [String: Any], - let versionString = plist?["_XCCurrentVersionName"] as? String else { + let versionString = plist["_XCCurrentVersionName"] as? String else { return nil } return versionedModels.first(where: { $0.lastComponent == versionString }) diff --git a/Tests/XcodeGenKitTests/ProjectSpecTests.swift b/Tests/XcodeGenKitTests/ProjectSpecTests.swift index bbb4378a..a386d45a 100644 --- a/Tests/XcodeGenKitTests/ProjectSpecTests.swift +++ b/Tests/XcodeGenKitTests/ProjectSpecTests.swift @@ -76,7 +76,7 @@ class ProjectSpecTests: XCTestCase { ) $0.it("fails with invalid XcodeGen version") { - let minimumVersion = try Version("1.11.1") + let minimumVersion = Version("1.11.1") var project = baseProject project.options = SpecOptions(minimumXcodeGenVersion: minimumVersion) @@ -86,9 +86,9 @@ class ProjectSpecTests: XCTestCase { } } - try expectMinimumXcodeGenVersionError(project, minimumVersion: minimumVersion, xcodeGenVersion: try Version("1.11.0")) - try expectMinimumXcodeGenVersionError(project, minimumVersion: minimumVersion, xcodeGenVersion: try Version("1.10.99")) - try expectMinimumXcodeGenVersionError(project, minimumVersion: minimumVersion, xcodeGenVersion: try Version("0.99")) + try expectMinimumXcodeGenVersionError(project, minimumVersion: minimumVersion, xcodeGenVersion: Version("1.11.0")) + try expectMinimumXcodeGenVersionError(project, minimumVersion: minimumVersion, xcodeGenVersion: Version("1.10.99")) + try expectMinimumXcodeGenVersionError(project, minimumVersion: minimumVersion, xcodeGenVersion: Version("0.99")) } $0.it("fails with invalid project") { From a010e094e09b050c909317b79e2dbf47c04f2033 Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Wed, 27 Mar 2019 18:36:08 +1100 Subject: [PATCH 03/22] update package to Swift 5 --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index d180b01b..e0a50310 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:4.2 +// swift-tools-version:5.0 import PackageDescription From 3311b4d321d961343f2324d22ecb1031e2486e7b Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Wed, 27 Mar 2019 19:29:21 +1100 Subject: [PATCH 04/22] fix TestProject building --- .../Carthage/Build/.Result.version | 8 +- Tests/Fixtures/TestProject/Mintfile | 1 + .../Project.xcodeproj/project.pbxproj | 12 -- Tests/Fixtures/TestProject/SomeFile | 1 + .../Headers/SomeFramework-Swift.h | 186 ------------------ .../Vendor/SomeFramework.framework/Info.plist | Bin 736 -> 0 bytes .../SomeFramework.swiftmodule/x86_64.swiftdoc | Bin 356 -> 0 bytes .../x86_64.swiftmodule | Bin 12844 -> 0 bytes .../Modules/module.modulemap | 4 - .../SomeFramework.framework/SomeFramework | Bin 30368 -> 0 bytes .../_CodeSignature/CodeResources | 165 ---------------- Tests/Fixtures/TestProject/build.sh | 4 +- Tests/Fixtures/TestProject/project.yml | 1 - 13 files changed, 8 insertions(+), 374 deletions(-) delete mode 100644 Tests/Fixtures/TestProject/Vendor/SomeFramework.framework/Headers/SomeFramework-Swift.h delete mode 100644 Tests/Fixtures/TestProject/Vendor/SomeFramework.framework/Info.plist delete mode 100644 Tests/Fixtures/TestProject/Vendor/SomeFramework.framework/Modules/SomeFramework.swiftmodule/x86_64.swiftdoc delete mode 100644 Tests/Fixtures/TestProject/Vendor/SomeFramework.framework/Modules/SomeFramework.swiftmodule/x86_64.swiftmodule delete mode 100644 Tests/Fixtures/TestProject/Vendor/SomeFramework.framework/Modules/module.modulemap delete mode 100755 Tests/Fixtures/TestProject/Vendor/SomeFramework.framework/SomeFramework delete mode 100644 Tests/Fixtures/TestProject/Vendor/SomeFramework.framework/_CodeSignature/CodeResources diff --git a/Tests/Fixtures/TestProject/Carthage/Build/.Result.version b/Tests/Fixtures/TestProject/Carthage/Build/.Result.version index 56d69be2..0ff47abe 100644 --- a/Tests/Fixtures/TestProject/Carthage/Build/.Result.version +++ b/Tests/Fixtures/TestProject/Carthage/Build/.Result.version @@ -2,26 +2,26 @@ "Mac" : [ { "name" : "Result", - "hash" : "798b63be483da72a39b8b82eef99e204df84ae52776cd4eb3bc3a887a51d3556" + "hash" : "f14569d60b4947d7467d06912c9969bac4caa5c2b62e19dec21bfd37ae146a9f" } ], "watchOS" : [ { "name" : "Result", - "hash" : "ca05c8fa750b3737a39d134ae5a2bf675c1d6d8962bfd99fd7b4c3fcadeff364" + "hash" : "80ed6de84fe4e9a468a10ca021db53f5a91edfa70874fdab0b5c1e61487604ea" } ], "tvOS" : [ { "name" : "Result", - "hash" : "a8c876ce896eb86255745cd700e54034c231a929916bcd71669f87ee15448d54" + "hash" : "28ba58a2f0caf9db17d544ea3f01908b3f100bca5777a10c8238386be054b9ce" } ], "commitish" : "4.1.0", "iOS" : [ { "name" : "Result", - "hash" : "17b7a454596e240de059d0018168a70eb3d8b7ff5979057c4a062d4288053bf2" + "hash" : "328ec56ff90373242dc848bda9f214eeb58c456ea5e4703855b3f7f207861a24" } ] } \ No newline at end of file diff --git a/Tests/Fixtures/TestProject/Mintfile b/Tests/Fixtures/TestProject/Mintfile index e69de29b..8b137891 100644 --- a/Tests/Fixtures/TestProject/Mintfile +++ b/Tests/Fixtures/TestProject/Mintfile @@ -0,0 +1 @@ + diff --git a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj index 4056628b..c64a1531 100644 --- a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj @@ -30,7 +30,6 @@ 0D281787B630CE62E91F9F7219EFF40D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D8A016580A3B8F72B820BFBF93749CD7 /* Assets.xcassets */; }; 0F7F220834A3E2B344322B64DB5140DF /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 0BB1B49A91B892152D68ED76D9D4E759 /* libc++.tbd */; }; 13C624ABA05AC67129468002144005A9 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0704B6CAFBB53E0EBB08F6B385901D43 /* ViewController.swift */; settings = {COMPILER_FLAGS = "-Werror"; }; }; - 1985E98D7107DFCBB2F2AC7DC6A155B5 /* SomeFramework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 73E7D4B860A5B6B80540E64703192744 /* SomeFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 1E105E72C258FF9843B21D8A3F520CFB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE1F06D99242F4223D081F0DF78367F3 /* LaunchScreen.storyboard */; }; 205719BEDEFFC911468631925C617988 /* module.modulemap in CopyFiles */ = {isa = PBXBuildFile; fileRef = F2950763C4C568CC85021D185A35C1FB /* module.modulemap */; }; 21B9D91DC3573A47C3298339795D0D2A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B419F22EB75EDD4AB9B92F32F7D39755 /* Assets.xcassets */; }; @@ -108,7 +107,6 @@ E32A04EF64C8989C8349A476E3DC1F19 /* Framework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 41FC82ED1C4C3B7B3D7B2FB721574442 /* Framework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; E48B36322124BDE8EE3AF22EB3B2B47C /* MyFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A58A16491CDDF968B0D56DE7EB96D92 /* MyFramework.h */; settings = {ATTRIBUTES = (Public, ); }; }; E7555C1BCBCF88204907587DBD341663 /* Headers in Headers */ = {isa = PBXBuildFile; fileRef = 2E1E747C7BC434ADB80CC269B7B595DC /* Headers */; settings = {ATTRIBUTES = (Public, ); }; }; - EA0D7CDB58D81E7D92E731535E41FB5E /* SomeFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73E7D4B860A5B6B80540E64703192744 /* SomeFramework.framework */; }; EEDCCB9427FA46F272DFC190FCCBE77A /* StaticLibrary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AC91042453E18DF74BA1C0F957D87DC /* StaticLibrary.swift */; }; EF285B90A968453FA1CB0CDE8C0AD440 /* iMessageApp.app in Resources */ = {isa = PBXBuildFile; fileRef = 9A87A926D563773658FB87FEEE4DD132 /* iMessageApp.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; EFBDE105D3397BE7AAC207B8AD3CC8BB /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D296BB7355994040E197A1EE5B41F583 /* Result.framework */; }; @@ -392,7 +390,6 @@ files = ( 3799FF03E75F5D3C925CBB18B8BB7BF6 /* Framework2.framework in Embed Frameworks */, 7856158603A68D4FF152F8E96305B3E7 /* Framework.framework in Embed Frameworks */, - 1985E98D7107DFCBB2F2AC7DC6A155B5 /* SomeFramework.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -448,7 +445,6 @@ 6BBE762F36D94AB6FFBFE834A99277EA /* SomeFile */ = {isa = PBXFileReference; path = SomeFile; sourceTree = ""; }; 70A8E15C81E454DC950C59F092CC1049 /* SomeXPCService.xpc */ = {isa = PBXFileReference; path = SomeXPCService.xpc; sourceTree = ""; }; 72A14C887EF7E9C8CBE914ACC4DDF4D4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 73E7D4B860A5B6B80540E64703192744 /* SomeFramework.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SomeFramework.framework; path = Vendor/SomeFramework.framework; sourceTree = ""; }; 77C0C341F1865224E059608627CC2D82 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 7ACBAD7D485AA4E2542B9E0F9908D5B2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 7B5068D64404C61A67A184584E13804D /* MyBundle.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = MyBundle.bundle; sourceTree = ""; }; @@ -515,7 +511,6 @@ DE50B077EE4BFABAF128321B2A13886F /* Framework.framework in Frameworks */, 29A79F030DD325754FD2C82C4A6E0AE6 /* Result.framework in Frameworks */, 53B2D7C4FD56D5D1D8AF16B23110235D /* StaticLibrary_ObjC.a in Frameworks */, - EA0D7CDB58D81E7D92E731535E41FB5E /* SomeFramework.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -893,7 +888,6 @@ 12809A79ACE69F501A5FE815B43985BD /* Carthage */, FDB2B6A77D39CD5602F2125F01DEF025 /* Contacts.framework */, 0BB1B49A91B892152D68ED76D9D4E759 /* libc++.tbd */, - 73E7D4B860A5B6B80540E64703192744 /* SomeFramework.framework */, ); name = Frameworks; sourceTree = ""; @@ -2243,7 +2237,6 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", - "\"Vendor\"", ); INFOPLIST_FILE = App_iOS/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -3014,7 +3007,6 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", - "\"Vendor\"", ); INFOPLIST_FILE = App_iOS/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -3378,7 +3370,6 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", - "\"Vendor\"", ); INFOPLIST_FILE = App_iOS/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -3981,7 +3972,6 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", - "\"Vendor\"", ); INFOPLIST_FILE = App_iOS/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -4044,7 +4034,6 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", - "\"Vendor\"", ); INFOPLIST_FILE = App_iOS/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -4549,7 +4538,6 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", - "\"Vendor\"", ); INFOPLIST_FILE = App_iOS/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; diff --git a/Tests/Fixtures/TestProject/SomeFile b/Tests/Fixtures/TestProject/SomeFile index e69de29b..8b137891 100644 --- a/Tests/Fixtures/TestProject/SomeFile +++ b/Tests/Fixtures/TestProject/SomeFile @@ -0,0 +1 @@ + diff --git a/Tests/Fixtures/TestProject/Vendor/SomeFramework.framework/Headers/SomeFramework-Swift.h b/Tests/Fixtures/TestProject/Vendor/SomeFramework.framework/Headers/SomeFramework-Swift.h deleted file mode 100644 index cbd45075..00000000 --- a/Tests/Fixtures/TestProject/Vendor/SomeFramework.framework/Headers/SomeFramework-Swift.h +++ /dev/null @@ -1,186 +0,0 @@ -// Generated by Apple Swift version 4.1.2 (swiftlang-902.0.54 clang-902.0.39.2) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgcc-compat" - -#if !defined(__has_include) -# define __has_include(x) 0 -#endif -#if !defined(__has_attribute) -# define __has_attribute(x) 0 -#endif -#if !defined(__has_feature) -# define __has_feature(x) 0 -#endif -#if !defined(__has_warning) -# define __has_warning(x) 0 -#endif - -#if __has_include() -# include -#endif - -#pragma clang diagnostic ignored "-Wauto-import" -#include -#include -#include -#include - -#if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) -typedef uint_least16_t char16_t; -typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); -#endif - -#if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) -#endif -#if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class -#endif -#if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif -#endif - -#if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) -#else -# define SWIFT_RUNTIME_NAME(X) -#endif -#if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) -#else -# define SWIFT_COMPILE_NAME(X) -#endif -#if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) -#else -# define SWIFT_METHOD_FAMILY(X) -#endif -#if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) -#else -# define SWIFT_NOESCAPE -#endif -#if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) -#else -# define SWIFT_WARN_UNUSED_RESULT -#endif -#if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) -#else -# define SWIFT_NORETURN -#endif -#if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA -#endif -#if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA -#endif -#if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA -#endif -#if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif -#endif - -#if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -#endif - -#if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) -#endif - -#if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif -#endif -#if !defined(SWIFT_ENUM_ATTR) -# if defined(__has_attribute) && __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR __attribute__((enum_extensibility(open))) -# else -# define SWIFT_ENUM_ATTR -# endif -#endif -#if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_ATTR SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name) -# endif -#endif -#if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) -#endif -#if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) -#endif -#if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) -#endif -#if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) -#endif -#if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) -#endif -#if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) -#else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) -#endif -#if __has_feature(modules) -#endif - -#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" -#pragma clang diagnostic ignored "-Wduplicate-method-arg" -#if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" -#endif -#pragma clang diagnostic ignored "-Wunknown-pragmas" -#pragma clang diagnostic ignored "-Wnullability" - -#if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="SomeFramework",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") -#endif - -#if __has_attribute(external_source_symbol) -# pragma clang attribute pop -#endif -#pragma clang diagnostic pop diff --git a/Tests/Fixtures/TestProject/Vendor/SomeFramework.framework/Info.plist b/Tests/Fixtures/TestProject/Vendor/SomeFramework.framework/Info.plist deleted file mode 100644 index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zJs|E9N*ye*hWPRApod9sty{l~mrG=bNCa11JR`VpzYzn`1`Mnw>UCqVTeBkwiJ16P z(F9+5XblWlK71C_YXkWOrNku3dG6gM;0I;hrNlZ5R)F!Qze$=3A`ok?C6~JiUq>n7 zM?Jq(rKjjS@V9iS3?um;e1;gmXekk(uoM)7_YevKuO_~v5o-NPqcRjoOAq_!|45x( z&jVOVkyDbp%dgc6J5+|#`UQkp|NTI20hu6tH_yF5cv%l}$xt^%73iAU{WId4fdBAq zz=Qm2zzWNHI$2o8)5OY4mge`qf|rIaew8Tp0)dA5YZUx6Be?%DZw!xlU6Lon5l;`2 z>*P{SE~(WmfcN?0Uz3G&cYG6I>*|34UIJiO7}kDBUF&+<|IuQy;+xuv15U6eN*UH( zp;X%6fc941z9*=gbJ}afU9upF6J+_=CuDp;dg{ApINj|C262t}HW{cpj{(0EG7}FB zSk;?_Mg#sMQ<1Kb1d`+9Jh;{IM@Ug;SX)tG_KjA+=m;<1(7dsyUKXFC7Zem7cJJM% z+xNVo>;3hB3&9cp>eBq4<|4!CI}3EBKQiRJdT+r0(Xv{x`&mKwiJL*2>( zUE_~2d|$x7^NY3O>4hbZH`lpy9=Jc?kKlO<(?7uUPcZ#km_7mrob&h%IlCQVAiAj- z5c6-tRctDh1>vsTdY=D+9&`UT2b0Gzxv|M_=yF$x!k$7t-=sGvzoK$ptq{A#owo`? zBbmP(^SfWj(Vg3ZnY)*Zh!EjX3>2@{16{h(ZCI^*g&6P~7s11~&6fvsrOkNvQ}S*b z-U-h6eEtJ^!|4gExA!5xKZ2KH(|ic@Qf?1#LKaDWa;fJ8+#^R*{Yc{42i=DBj~HD< z-jIw$zVnLLiM~6RUg$_Z6Z388NWwDnlLqWFEC8M^Ehw Xh5l>pK^Q#Eymh@`kX)I_pZxqcSkw#( diff --git a/Tests/Fixtures/TestProject/Vendor/SomeFramework.framework/Modules/module.modulemap b/Tests/Fixtures/TestProject/Vendor/SomeFramework.framework/Modules/module.modulemap deleted file mode 100644 index bcab7ffb..00000000 --- a/Tests/Fixtures/TestProject/Vendor/SomeFramework.framework/Modules/module.modulemap +++ /dev/null @@ -1,4 +0,0 @@ -framework module SomeFramework { - header "SomeFramework-Swift.h" - requires objc -} diff --git a/Tests/Fixtures/TestProject/Vendor/SomeFramework.framework/SomeFramework b/Tests/Fixtures/TestProject/Vendor/SomeFramework.framework/SomeFramework deleted file mode 100755 index 50e17ba975fa60cd55d17c91de43b72f1d35788f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 30368 zcmeHNe{fXA9p6hxNdZYv6s!tI8yK*X%f${*2Wvud;Q_fANrKcOkIUT)IlN!oy(0-D zPMo8Z=ao*TT8lINgN~yutsT=Je?-SlFGv9`DudK!ri>F?#9%~Ir)2^n>F4|2Zu0Jc zlX2SV*x8-ixBJ=M?{~lZ+3(wZx9`1i;q0Z!j5!J!V_!nN9#JV~?7OTKImT{AY)7T4 zHhb1Ln?>0dtJy>u$I!`&5U21ORn@gleWF>ez6##(Cu9f$;Yn83x=v!9SqATU>-lPlWG6%fwiPblUo#@i8W)9+OEE(};} z%hi|R`e^SpvEG+Doi*F&~8U*+)DtM2D(c zTismEji5vjc9oRwGtxWZ$B~el=nA(+LuyQqUsaz_NBZq{ksdo%)y>ffue;p7Qm#no zBW#x^eY6gUpsFEXKKq}d zbyrZv$ry1`jFj|>(CB0=29QCz4=Hg)ea7Z7R*!W30w{psROA~GDcr*&*<6Q6K6JHE z0eP{<*xTF!K>b87Rozs*`|eMkF28i-g?sm(osTk;@=53s@pgfcQkaIg9+70td7bqf z-1iQLtEnrYYhhP?ur=1r+^&Hl}yB4 zpa+@#7=ScbFZEYtGKEn&OhR^#)F9?bQ>CK}hW1aHN3EJV-L zZ7C#k>US=ffmJhSJ`v- zn{cK+T0@LOFFKG6b)(?Hm)m-%9%*^W+@0od6=PH}^fFwU%SKSI7!MQB0ZQi9GG^*a zebDI6d~?J|UQ~=7BZ|>7RI>9Gh^IXlQ=_b8*Kd*Uqiz)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%wn9p26TEE4cC{q1yScVkR8)4vQ$HL+0R=?l10-JciwJL($JFEqQK3z+cN22tU z&?yv@(?%a46iE7MKXuk>t;x-cgR%B#L`ww2$&gQv#l;X?Pe()*pn;z%?e_Jv%X z%a*81zLC??{8}Ll?rxb(V`|6_%U5<@UoRK;IXVPW!0Kqj~-MbKYjwCxzTgD^xf7;6;&WG^TEg1_Nqb z!-V9&t2*G?`EJS%d%CdF~lh<0ZoW&3o$yL^ zVh0tsmi71OzkIiS&fDpKbiY`SCD!%A+tV_5g4qHjo?*(6$77je9X;3}ZABZxm8`&g zY@$cD^Gv<$m%VXBZ3*}i;$)5Xp@mryi$+LF<*WCVcId9+;{U2!-SGT^ - - - - files - - Headers/SomeFramework-Swift.h - - GsWLq+pM7+WTHb5Lytl5yzwE6Lg= - - Info.plist - - pHXZVe8uQSXZphapqiSal27/+cY= - - Modules/SomeFramework.swiftmodule/x86_64.swiftdoc - - K6JkWBnfjFpkw5UPJ9OZalStS6w= - - Modules/SomeFramework.swiftmodule/x86_64.swiftmodule - - 45szTu0MSm7Jh5wqFDqeTRcIVpk= - - Modules/module.modulemap - - 5TTCyrUix6BrqYO5bplMEDiYK98= - - - files2 - - Headers/SomeFramework-Swift.h - - hash2 - - i0YcIx4NscoXVWFIAurGgi+DMENrppl1DamK1PLy3/w= - - - Modules/SomeFramework.swiftmodule/x86_64.swiftdoc - - hash2 - - rw34Qgu/XEVt2QL4jvsrMJrfrqrMma2PBLFwd8lmXc4= - - - Modules/SomeFramework.swiftmodule/x86_64.swiftmodule - - hash2 - - SR7Q1t/6wNc4fmUX/866/vWPDXJLDPp0zN396/PLlbQ= - - - Modules/module.modulemap - - hash2 - - cbLtUnOM5bPVzNdrge9LxFAcg5zHw3i7lx3sjHEV8t0= - - - - rules - - ^ - - ^.*\.lproj/ - - optional - - weight - 1000 - - ^.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Base\.lproj/ - - weight - 1010 - - ^version.plist$ - - - rules2 - - .*\.dSYM($|/) - - weight - 11 - - ^ - - weight - 20 - - ^(.*/)?\.DS_Store$ - - omit - - weight - 2000 - - ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ - - nested - - weight - 10 - - ^.* - - ^.*\.lproj/ - - optional - - weight - 1000 - - ^.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Base\.lproj/ - - weight - 1010 - - ^Info\.plist$ - - omit - - weight - 20 - - ^PkgInfo$ - - omit - - weight - 20 - - ^[^/]+$ - - nested - - weight - 10 - - ^embedded\.provisionprofile$ - - weight - 20 - - ^version\.plist$ - - weight - 20 - - - - diff --git a/Tests/Fixtures/TestProject/build.sh b/Tests/Fixtures/TestProject/build.sh index 19f44a14..a1e22bc4 100755 --- a/Tests/Fixtures/TestProject/build.sh +++ b/Tests/Fixtures/TestProject/build.sh @@ -4,10 +4,10 @@ set -e carthage bootstrap --cache-builds echo " ⚙️ Building iOS app" -xcodebuild -quiet -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 CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO" echo "✅ Successfully built iOS app" echo " ⚙️ Building macOS app" -xcodebuild -quiet -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 CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO" echo "✅ Successfully built macOS app" diff --git a/Tests/Fixtures/TestProject/project.yml b/Tests/Fixtures/TestProject/project.yml index 10fbc5aa..cb9ba10b 100644 --- a/Tests/Fixtures/TestProject/project.yml +++ b/Tests/Fixtures/TestProject/project.yml @@ -90,7 +90,6 @@ targets: weak: true - target: App_watchOS - target: iMessageApp - - framework: Vendor/SomeFramework.framework - sdk: Contacts.framework scheme: testTargets: From 2bd59a5b4d2e8d493c972a734787acda8a627ec2 Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Wed, 27 Mar 2019 19:54:59 +1100 Subject: [PATCH 05/22] update versions in readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 630602b4..b0311862 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ A project would be created with 2 connected targets, with all the required confi ## Installing -Make sure Xcode 9.3 is installed first. +Make sure Xcode 10.2 is installed first. ### [Mint](https://github.com/yonaskolb/mint) ```sh @@ -105,7 +105,7 @@ swift run xcodegen Add the following to your Package.swift file's dependencies: ```swift -.package(url: "https://github.com/yonaskolb/XcodeGen.git", from: "1.0.0"), +.package(url: "https://github.com/yonaskolb/XcodeGen.git", from: "2.3.0"), ``` And then import wherever needed: `import XcodeGenKit` From b7f50b6aeefd292296ce547152b2573c401f33c8 Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Wed, 27 Mar 2019 20:09:35 +1100 Subject: [PATCH 06/22] remove -Xswiftc -static-stdlib --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d21837df..2e110e1c 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ install: build cp -R $(CURRENT_PATH)/SettingPresets $(SHARE_PATH)/SettingPresets build: - swift build --disable-sandbox -c release -Xswiftc -static-stdlib + swift build --disable-sandbox -c release uninstall: rm -f $(INSTALL_PATH) From c257ec1a9116b225c242e450827769b489134a23 Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Wed, 27 Mar 2019 20:27:46 +1100 Subject: [PATCH 07/22] update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index faa1100a..2a642df6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Next Version +#### Changed +- Updated to Swift 5 and drop Swift 4.2 [#549](https://github.com/yonaskolb/XcodeGen/pull/549) @yonaskolb + ## 2.3.0 #### Added From e6fd3731a286c03bac8c6923720a8a2e1ca8b43a Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Sun, 31 Mar 2019 21:57:03 +1100 Subject: [PATCH 08/22] update changelog --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a642df6..035c076b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,15 @@ ## Next Version +## 2.4.0 + +###$ Fixed: +- Fixed installation when building in Swift 5 [#549](https://github.com/yonaskolb/XcodeGen/pull/549) @yonaskolb + #### Changed -- Updated to Swift 5 and drop Swift 4.2 [#549](https://github.com/yonaskolb/XcodeGen/pull/549) @yonaskolb +- Updated to Swift 5 and dropped Swift 4.2 [#549](https://github.com/yonaskolb/XcodeGen/pull/549) @yonaskolb + +[Commits](https://github.com/yonaskolb/XcodeGen/compare/2.3.0...2.4.0) ## 2.3.0 From bf4a65bbdcabf906f533edbfb00b269bb3b1bd78 Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Sun, 31 Mar 2019 21:58:31 +1100 Subject: [PATCH 09/22] Update to 2.4.0 --- Makefile | 6 +++--- Sources/XcodeGen/main.swift | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 2e110e1c..e0d6a2bd 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ TOOL_NAME = XcodeGen export EXECUTABLE_NAME = xcodegen -VERSION = 2.3.0 +VERSION = 2.4.0 PREFIX = /usr/local INSTALL_PATH = $(PREFIX)/bin/$(EXECUTABLE_NAME) @@ -28,8 +28,8 @@ uninstall: format_code: swiftformat . -release: format_code - sed -i '' 's|\(let version = try Version("\)\(.*\)\(")\)|\1$(VERSION)\3|' Sources/XcodeGen/main.swift +release: + sed -i '' 's|\(let version = Version("\)\(.*\)\(")\)|\1$(VERSION)\3|' Sources/XcodeGen/main.swift git add . git commit -m "Update to $(VERSION)" diff --git a/Sources/XcodeGen/main.swift b/Sources/XcodeGen/main.swift index b984a7af..ed42dac0 100644 --- a/Sources/XcodeGen/main.swift +++ b/Sources/XcodeGen/main.swift @@ -2,6 +2,6 @@ import Foundation import ProjectSpec import XcodeGenCLI -let version = Version("2.3.0") +let version = Version("2.4.0") let cli = XcodeGenCLI(version: version) cli.execute() From 6b431a204d05acf94e8ca6b93408fd409b13c137 Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Sun, 31 Mar 2019 22:00:41 +1100 Subject: [PATCH 10/22] update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 035c076b..e15f9253 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ## 2.4.0 -###$ Fixed: +#### Fixed: - Fixed installation when building in Swift 5 [#549](https://github.com/yonaskolb/XcodeGen/pull/549) @yonaskolb #### Changed From fde42399de2bef432ae54fa40368530ba6cd84e0 Mon Sep 17 00:00:00 2001 From: Yonas Kolb Date: Sun, 17 Mar 2019 13:52:13 +1100 Subject: [PATCH 11/22] update to xcodeproj 6.6 --- CHANGELOG.md | 4 ++++ Docs/ProjectSpec.md | 4 +++- Package.resolved | 4 ++-- Package.swift | 2 +- Sources/ProjectSpec/Linkage.swift | 1 + 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e15f9253..b2b71243 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - Added ability to set `link` to false in framework dependencies [#532](https://github.com/yonaskolb/XcodeGen/pull/532) @dimatosaurus - Added `missingConfigFiles` to `options.disabledValidations` to optionally skip checking for the existence of config files. - Added ability to define a per-platform `deploymentTarget` for Multi-Platform targets. [#510](https://github.com/yonaskolb/XcodeGen/pull/510) @ainopara +- Added support for `app-extension.intents-service` target type [#536](https://github.com/yonaskolb/XcodeGen/pull/536) @yonaskolb #### Changed - **DEPRECATION**: Placeholders `$target_name` and `$platform` have been deprecated in favour of `${target_name}` and `${platform}`. Support for the old placeholders will be removed in a future version [#533](https://github.com/yonaskolb/XcodeGen/pull/533) @tomquist @@ -35,6 +36,9 @@ [Commits](https://github.com/yonaskolb/XcodeGen/compare/2.2.0...2.3.0) +#### Changed +- Updated to xcodeproj 6.6 which includes project writing performance improvements [#536](https://github.com/yonaskolb/XcodeGen/pull/536) @yonaskolb + ## 2.2.0 #### Added diff --git a/Docs/ProjectSpec.md b/Docs/ProjectSpec.md index b610a72e..7f804069 100644 --- a/Docs/ProjectSpec.md +++ b/Docs/ProjectSpec.md @@ -227,9 +227,10 @@ This will provide default build settings for a certain product type. It can be a - `application.messages` - `application.watchapp` - `application.watchapp2` +- `app-extension` - `app-extension.messages` - `app-extension.messages-sticker-pack` -- `app-extension` +- `app-extension.intents-service` - `bundle` - `bundle.unit-test` - `bundle.ui-testing` @@ -242,6 +243,7 @@ This will provide default build settings for a certain product type. It can be a - `tv-app-extension` - `watchkit-extension` - `watchkit2-extension` +- `xcode-extension` - `xpc-service` - ``""`` (used for legacy targets) diff --git a/Package.resolved b/Package.resolved index fad2b4b4..37f7c688 100644 --- a/Package.resolved +++ b/Package.resolved @@ -69,8 +69,8 @@ "repositoryURL": "https://github.com/tuist/xcodeproj.git", "state": { "branch": null, - "revision": "8e15cc74149ee946b7ae125685177915b4ff7317", - "version": "6.4.0" + "revision": "3fe1bd763072c81050b867d34db56d11cb9085bb", + "version": "6.6.0" } }, { diff --git a/Package.swift b/Package.swift index e0a50310..78112db1 100644 --- a/Package.swift +++ b/Package.swift @@ -15,7 +15,7 @@ let package = Package( .package(url: "https://github.com/yonaskolb/JSONUtilities.git", from: "4.1.0"), .package(url: "https://github.com/kylef/Spectre.git", from: "0.9.0"), .package(url: "https://github.com/onevcat/Rainbow.git", from: "3.0.0"), - .package(url: "https://github.com/tuist/xcodeproj.git", .exact("6.4.0")), + .package(url: "https://github.com/tuist/xcodeproj.git", .exact("6.6.0")), .package(url: "https://github.com/jakeheis/SwiftCLI.git", from: "5.2.0"), ], targets: [ diff --git a/Sources/ProjectSpec/Linkage.swift b/Sources/ProjectSpec/Linkage.swift index ec2b71e1..166a8681 100644 --- a/Sources/ProjectSpec/Linkage.swift +++ b/Sources/ProjectSpec/Linkage.swift @@ -16,6 +16,7 @@ extension Target { .bundle, .commandLineTool, .instrumentsPackage, + .intentsServiceExtension, .messagesApplication, .messagesExtension, .ocUnitTestBundle, From 16bc081944b7aaf3f5842ab2c3e7442a793ec5cc Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Mon, 1 Apr 2019 20:15:38 +1100 Subject: [PATCH 12/22] update to xcodeproj 6.7 --- Package.resolved | 4 ++-- Package.swift | 2 +- Tests/XcodeGenKitTests/ProjectGeneratorTests.swift | 8 ++++---- Tests/XcodeGenKitTests/SourceGeneratorTests.swift | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Package.resolved b/Package.resolved index 37f7c688..db29fe0a 100644 --- a/Package.resolved +++ b/Package.resolved @@ -69,8 +69,8 @@ "repositoryURL": "https://github.com/tuist/xcodeproj.git", "state": { "branch": null, - "revision": "3fe1bd763072c81050b867d34db56d11cb9085bb", - "version": "6.6.0" + "revision": "065f348754b6155b8037dc43876a8f2ee354b95d", + "version": "6.7.0" } }, { diff --git a/Package.swift b/Package.swift index 78112db1..1249be28 100644 --- a/Package.swift +++ b/Package.swift @@ -15,7 +15,7 @@ let package = Package( .package(url: "https://github.com/yonaskolb/JSONUtilities.git", from: "4.1.0"), .package(url: "https://github.com/kylef/Spectre.git", from: "0.9.0"), .package(url: "https://github.com/onevcat/Rainbow.git", from: "3.0.0"), - .package(url: "https://github.com/tuist/xcodeproj.git", .exact("6.6.0")), + .package(url: "https://github.com/tuist/xcodeproj.git", .exact("6.7.0")), .package(url: "https://github.com/jakeheis/SwiftCLI.git", from: "5.2.0"), ], targets: [ diff --git a/Tests/XcodeGenKitTests/ProjectGeneratorTests.swift b/Tests/XcodeGenKitTests/ProjectGeneratorTests.swift index 2f7dc633..7ad7d420 100644 --- a/Tests/XcodeGenKitTests/ProjectGeneratorTests.swift +++ b/Tests/XcodeGenKitTests/ProjectGeneratorTests.swift @@ -598,7 +598,7 @@ class ProjectGeneratorTests: XCTestCase { if let expectedResourceFiles = expectedResourceFiles[target.name] { try expect(resourcesPhases.count) == (expectedResourceFiles.isEmpty ? 0 : 1) if !expectedResourceFiles.isEmpty { - let resourceFiles = resourcesPhases[0].files + let resourceFiles = (resourcesPhases[0].files ?? []) .compactMap { $0.file } .map { $0.nameOrPath } try expect(Set(resourceFiles)) == expectedResourceFiles @@ -611,7 +611,7 @@ class ProjectGeneratorTests: XCTestCase { let expectedLinkedFiles = expectedLinkedFiles[target.name]! try expect(frameworkPhases.count) == (expectedLinkedFiles.isEmpty ? 0 : 1) if !expectedLinkedFiles.isEmpty { - let linkFrameworks = frameworkPhases[0].files + let linkFrameworks = (frameworkPhases[0].files ?? []) .compactMap { $0.file?.nameOrPath } try expect(Set(linkFrameworks)) == expectedLinkedFiles } @@ -620,7 +620,7 @@ class ProjectGeneratorTests: XCTestCase { if let expectedEmbeddedFrameworks = expectedEmbeddedFrameworks[target.name] { try expect(copyFilesPhases.count) == (expectedEmbeddedFrameworks.isEmpty ? 0 : 1) if !expectedEmbeddedFrameworks.isEmpty { - let copyFiles = copyFilesPhases[0].files + let copyFiles = (copyFilesPhases[0].files ?? []) .compactMap { $0.file?.nameOrPath } try expect(Set(copyFiles)) == expectedEmbeddedFrameworks } @@ -871,7 +871,7 @@ class ProjectGeneratorTests: XCTestCase { } let frameworkPhases = nativeTarget.buildPhases.compactMap { $0 as? PBXFrameworksBuildPhase } - let frameworkBuildFiles = frameworkPhases[0].files + let frameworkBuildFiles = frameworkPhases[0].files ?? [] let buildFileSettings = frameworkBuildFiles.map { $0.settings } try expect(frameworkBuildFiles.count) == 2 diff --git a/Tests/XcodeGenKitTests/SourceGeneratorTests.swift b/Tests/XcodeGenKitTests/SourceGeneratorTests.swift index 0ac104ea..97c7dc9c 100644 --- a/Tests/XcodeGenKitTests/SourceGeneratorTests.swift +++ b/Tests/XcodeGenKitTests/SourceGeneratorTests.swift @@ -95,8 +95,8 @@ class SourceGeneratorTests: XCTestCase { .first(where: { $0.file == fileReference }) else { throw failure("Cant find build file") } - try expect(buildPhase?.files.count) == 1 - try expect(buildPhase?.files.contains(buildFile)) == true + try expect(buildPhase?.files?.count) == 1 + try expect(buildPhase?.files?.contains(buildFile)) == true } $0.it("generates core data models") { @@ -518,7 +518,7 @@ class SourceGeneratorTests: XCTestCase { let sourcesBuildPhase = pbxProj.buildPhases.first(where: { $0.buildPhase == BuildPhase.sources })! - try expect(sourcesBuildPhase.files.count) == 1 + try expect(sourcesBuildPhase.files?.count) == 1 } $0.it("add only carthage dependencies with same platform") { @@ -609,7 +609,7 @@ extension PBXProj { let buildFile = buildFiles .first(where: { $0.file === fileReference }) let actualBuildPhase = buildFile - .flatMap { buildFile in buildPhases.first { $0.files.contains(buildFile) } }?.buildPhase + .flatMap { buildFile in buildPhases.first { $0.files?.contains(buildFile) ?? false } }?.buildPhase var error: String? if let buildPhase = buildPhase.buildPhase { From 036c68885a842d53025832a3073e285bd48a2d9c Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Mon, 1 Apr 2019 20:26:46 +1100 Subject: [PATCH 13/22] update changelog --- CHANGELOG.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2b71243..7018e4fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## Next Version +#### Added +- Added support for `app-extension.intents-service` target type [#536](https://github.com/yonaskolb/XcodeGen/pull/536) @yonaskolb + +#### Changed +- Updated to xcodeproj 6.7.0 including its performance improvements [#536](https://github.com/yonaskolb/XcodeGen/pull/536) @yonaskolb + ## 2.4.0 #### Fixed: @@ -21,7 +27,6 @@ - Added ability to set `link` to false in framework dependencies [#532](https://github.com/yonaskolb/XcodeGen/pull/532) @dimatosaurus - Added `missingConfigFiles` to `options.disabledValidations` to optionally skip checking for the existence of config files. - Added ability to define a per-platform `deploymentTarget` for Multi-Platform targets. [#510](https://github.com/yonaskolb/XcodeGen/pull/510) @ainopara -- Added support for `app-extension.intents-service` target type [#536](https://github.com/yonaskolb/XcodeGen/pull/536) @yonaskolb #### Changed - **DEPRECATION**: Placeholders `$target_name` and `$platform` have been deprecated in favour of `${target_name}` and `${platform}`. Support for the old placeholders will be removed in a future version [#533](https://github.com/yonaskolb/XcodeGen/pull/533) @tomquist @@ -36,9 +41,6 @@ [Commits](https://github.com/yonaskolb/XcodeGen/compare/2.2.0...2.3.0) -#### Changed -- Updated to xcodeproj 6.6 which includes project writing performance improvements [#536](https://github.com/yonaskolb/XcodeGen/pull/536) @yonaskolb - ## 2.2.0 #### Added From 27c588a19355f4582eafe8d592bac82892585dca Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Tue, 2 Apr 2019 22:24:08 +1100 Subject: [PATCH 14/22] update default swift version to 5.0 --- SettingPresets/base.yml | 2 +- .../TestProject/Project.xcodeproj/project.pbxproj | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SettingPresets/base.yml b/SettingPresets/base.yml index 9552b7a0..0cb9ea15 100644 --- a/SettingPresets/base.yml +++ b/SettingPresets/base.yml @@ -42,4 +42,4 @@ GCC_WARN_UNUSED_VARIABLE: YES # Swift Settings PRODUCT_NAME: $(TARGET_NAME) -SWIFT_VERSION: '4.2' +SWIFT_VERSION: '5.0' diff --git a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj index c64a1531..44956535 100644 --- a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj @@ -4132,7 +4132,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = "Production Debug"; @@ -4287,7 +4287,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; VALIDATE_PRODUCT = YES; WATCHOS_DEPLOYMENT_TARGET = 4.0; }; @@ -4356,7 +4356,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; VALIDATE_PRODUCT = YES; WATCHOS_DEPLOYMENT_TARGET = 4.0; }; @@ -4645,7 +4645,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = "Staging Debug"; @@ -4827,7 +4827,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = "Test Debug"; @@ -5028,7 +5028,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; VALIDATE_PRODUCT = YES; WATCHOS_DEPLOYMENT_TARGET = 4.0; }; From 93fb98573283e0b680c3d828526d2582ce1b8163 Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Tue, 2 Apr 2019 22:24:59 +1100 Subject: [PATCH 15/22] use sdk default for SWIFT_OPTIMIZATION_LEVEL in release config (-O) --- SettingPresets/Configs/release.yml | 3 --- Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj | 3 --- 2 files changed, 6 deletions(-) diff --git a/SettingPresets/Configs/release.yml b/SettingPresets/Configs/release.yml index b32b0c58..71664415 100644 --- a/SettingPresets/Configs/release.yml +++ b/SettingPresets/Configs/release.yml @@ -4,6 +4,3 @@ DEBUG_INFORMATION_FORMAT: dwarf-with-dsym ENABLE_NS_ASSERTIONS: NO VALIDATE_PRODUCT: YES - -# Swift Settings -SWIFT_OPTIMIZATION_LEVEL: -Owholemodule diff --git a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj index 44956535..ae1f3cd7 100644 --- a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj @@ -4286,7 +4286,6 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 5.0; VALIDATE_PRODUCT = YES; WATCHOS_DEPLOYMENT_TARGET = 4.0; @@ -4355,7 +4354,6 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 5.0; VALIDATE_PRODUCT = YES; WATCHOS_DEPLOYMENT_TARGET = 4.0; @@ -5027,7 +5025,6 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 5.0; VALIDATE_PRODUCT = YES; WATCHOS_DEPLOYMENT_TARGET = 4.0; From f69fdb508d5854dca973827ac849ebcf8f01488a Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Tue, 2 Apr 2019 22:25:54 +1100 Subject: [PATCH 16/22] set SWIFT_COMPILATION_MODE in release to wholemodule --- SettingPresets/Configs/release.yml | 3 +++ Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj | 3 +++ 2 files changed, 6 insertions(+) diff --git a/SettingPresets/Configs/release.yml b/SettingPresets/Configs/release.yml index 71664415..ce6d9f24 100644 --- a/SettingPresets/Configs/release.yml +++ b/SettingPresets/Configs/release.yml @@ -4,3 +4,6 @@ DEBUG_INFORMATION_FORMAT: dwarf-with-dsym ENABLE_NS_ASSERTIONS: NO VALIDATE_PRODUCT: YES + +# Swift Settings +SWIFT_COMPILATION_MODE: wholemodule diff --git a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj index ae1f3cd7..70985c71 100644 --- a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj @@ -4286,6 +4286,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_COMPILATION_MODE = wholemodule; SWIFT_VERSION = 5.0; VALIDATE_PRODUCT = YES; WATCHOS_DEPLOYMENT_TARGET = 4.0; @@ -4354,6 +4355,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_COMPILATION_MODE = wholemodule; SWIFT_VERSION = 5.0; VALIDATE_PRODUCT = YES; WATCHOS_DEPLOYMENT_TARGET = 4.0; @@ -5025,6 +5027,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_COMPILATION_MODE = wholemodule; SWIFT_VERSION = 5.0; VALIDATE_PRODUCT = YES; WATCHOS_DEPLOYMENT_TARGET = 4.0; From 401dd772eb8f34e5a4e299f2e899f2a116ae3e33 Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Tue, 2 Apr 2019 22:34:33 +1100 Subject: [PATCH 17/22] remove ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES --- .../Products/application.watchapp2.yml | 1 - SettingPresets/Products/application.yml | 1 - .../Project.xcodeproj/project.pbxproj | 24 ------------------- 3 files changed, 26 deletions(-) delete mode 100644 SettingPresets/Products/application.watchapp2.yml delete mode 100644 SettingPresets/Products/application.yml diff --git a/SettingPresets/Products/application.watchapp2.yml b/SettingPresets/Products/application.watchapp2.yml deleted file mode 100644 index 19d40c81..00000000 --- a/SettingPresets/Products/application.watchapp2.yml +++ /dev/null @@ -1 +0,0 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES: YES diff --git a/SettingPresets/Products/application.yml b/SettingPresets/Products/application.yml deleted file mode 100644 index 19d40c81..00000000 --- a/SettingPresets/Products/application.yml +++ /dev/null @@ -1 +0,0 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES: YES diff --git a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj index 70985c71..2ca67cc4 100644 --- a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj @@ -2138,7 +2138,6 @@ 00FD318C7418F3351FC0074451FC8AF5 /* Test Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/watchOS", @@ -2231,7 +2230,6 @@ 06E4383A2687EAD5877836CD308F610F /* Staging Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = ( @@ -2476,7 +2474,6 @@ 196FEEE6C4B0DDE53AD16BD6E5645F0E /* Test Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -2508,7 +2505,6 @@ 20803EC42C26E4EA13474E5A694068D1 /* Production Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/watchOS", @@ -2525,7 +2521,6 @@ 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"; @@ -2720,7 +2715,6 @@ 3FFEE1ED324166B88F5F9A451E59A29C /* Test Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -2804,7 +2798,6 @@ 4621C6C8A78FBB1CF4078178688742F9 /* Production Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -3001,7 +2994,6 @@ 545342CFDF7810F2EBFFFC5EEE5B87A6 /* Production Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = ( @@ -3364,7 +3356,6 @@ 7931F229200F89B8CDC8A5E3B755C52E /* Test Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = ( @@ -3398,7 +3389,6 @@ 7B2A1BE6CA654E9903A4C6802DBCE440 /* Staging Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/watchOS", @@ -3604,7 +3594,6 @@ 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"; @@ -3618,7 +3607,6 @@ 943D402E936EC5BD391F9FD0C7D926EA /* Production Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -3675,7 +3663,6 @@ 97009625463EC8B19F53007A9D102A56 /* Staging Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -3721,7 +3708,6 @@ 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"; @@ -3938,7 +3924,6 @@ AABC1E325EADF86C5137D659051CC749 /* Production Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/watchOS", @@ -3966,7 +3951,6 @@ AE37A01B34B4B956E784082C03DEB579 /* Production Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = ( @@ -4028,7 +4012,6 @@ B008685BA25BB8FD771F0AE3B59FA06C /* Staging Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = ( @@ -4193,7 +4176,6 @@ 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"; @@ -4296,7 +4278,6 @@ C4397CDA0D458BAD55C911B0A4DC7868 /* Staging Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/watchOS", @@ -4429,7 +4410,6 @@ 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"; @@ -4443,7 +4423,6 @@ CBE9D80AD0719511A13A889E867077CC /* Staging Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -4532,7 +4511,6 @@ DC80DC0AF0B4F2B51DAB0A5276F79F05 /* Test Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = ( @@ -4554,7 +4532,6 @@ 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"; @@ -4891,7 +4868,6 @@ F3AC6A112F81D0958A316D820549143D /* Test Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/watchOS", From a7613064b45e5149febe89f1ad7d45f95aa4df8c Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Tue, 2 Apr 2019 22:39:59 +1100 Subject: [PATCH 18/22] update latest xcode version to 10.2 --- Sources/XcodeGenKit/Version.swift | 4 ++-- Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj | 4 ++-- .../xcshareddata/xcschemes/App_Scheme.xcscheme | 2 +- .../xcshareddata/xcschemes/App_iOS Production.xcscheme | 2 +- .../xcshareddata/xcschemes/App_iOS Staging.xcscheme | 2 +- .../xcshareddata/xcschemes/App_iOS Test.xcscheme | 2 +- .../xcshareddata/xcschemes/App_macOS.xcscheme | 2 +- .../xcshareddata/xcschemes/App_watchOS.xcscheme | 2 +- .../xcshareddata/xcschemes/Framework.xcscheme | 2 +- .../Project.xcodeproj/xcshareddata/xcschemes/Tool.xcscheme | 2 +- .../xcshareddata/xcschemes/iMessageApp.xcscheme | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Sources/XcodeGenKit/Version.swift b/Sources/XcodeGenKit/Version.swift index 5acef3f1..63904f67 100644 --- a/Sources/XcodeGenKit/Version.swift +++ b/Sources/XcodeGenKit/Version.swift @@ -4,7 +4,7 @@ import ProjectSpec extension Project { var xcodeVersion: String { - return XCodeVersion.parse(options.xcodeVersion ?? "10.0") + return XCodeVersion.parse(options.xcodeVersion ?? "10.2") } var schemeVersion: String { @@ -16,7 +16,7 @@ extension Project { } var objectVersion: UInt { - return 50 + return 51 } public func validateMinimumXcodeGenVersion(_ xcodeGenVersion: Version) throws { diff --git a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj index 2ca67cc4..dc91f913 100644 --- a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 51; objects = { /* Begin PBXAggregateTarget section */ @@ -1430,7 +1430,7 @@ 0FBAE303E3CFC2ABAC876A7719B30922 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1000; + LastUpgradeCheck = 1020; TargetAttributes = { 020A320BB3736FCDE6CC4E703EE69AC0 = { ProvisioningStyle = Automatic; diff --git a/Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/App_Scheme.xcscheme b/Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/App_Scheme.xcscheme index b0efd3fd..c9a35a5b 100644 --- a/Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/App_Scheme.xcscheme +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/App_Scheme.xcscheme @@ -1,6 +1,6 @@ Date: Tue, 2 Apr 2019 23:13:37 +1100 Subject: [PATCH 19/22] generate carthage fixture --- .../CarthageProject/Project.xcodeproj/project.pbxproj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Tests/Fixtures/CarthageProject/Project.xcodeproj/project.pbxproj b/Tests/Fixtures/CarthageProject/Project.xcodeproj/project.pbxproj index af08556f..b809ab72 100644 --- a/Tests/Fixtures/CarthageProject/Project.xcodeproj/project.pbxproj +++ b/Tests/Fixtures/CarthageProject/Project.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 51; objects = { /* Begin PBXBuildFile section */ @@ -312,7 +312,7 @@ 0FBAE303E3CFC2ABAC876A7719B30922 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1000; + LastUpgradeCheck = 1020; }; buildConfigurationList = D91E14E36EC0B415578456F264E0161E /* Build configuration list for PBXProject "Project" */; compatibilityVersion = "Xcode 9.3"; @@ -409,8 +409,8 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.2; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_VERSION = 5.0; VALIDATE_PRODUCT = YES; }; name = Release; @@ -582,7 +582,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; From c73bad3312703685c5c2624b11e847ee30923fe6 Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Thu, 4 Apr 2019 23:32:55 +1100 Subject: [PATCH 20/22] Fix optional file sources --- Sources/XcodeGenKit/SourceGenerator.swift | 9 ++++--- .../SourceGeneratorTests.swift | 24 +++++++++++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/Sources/XcodeGenKit/SourceGenerator.swift b/Sources/XcodeGenKit/SourceGenerator.swift index a6014092..4ffe1cc0 100644 --- a/Sources/XcodeGenKit/SourceGenerator.swift +++ b/Sources/XcodeGenKit/SourceGenerator.swift @@ -463,11 +463,6 @@ class SourceGenerator { /// creates source files private func getSourceFiles(targetType: PBXProductType, targetSource: TargetSource, path: Path) throws -> [SourceFile] { - if targetSource.optional && !Path(targetSource.path).exists { - // Is optional so if it doesn't exist just return an empty array - return [] - } - // generate excluded paths targetSourceExcludePaths = getSourceExcludes(targetSource: targetSource) @@ -521,6 +516,10 @@ class SourceGenerator { sourceFiles.append(sourceFile) case .group: + if targetSource.optional && !Path(targetSource.path).exists { + // This group is missing, so if's optional just return an empty array + return [] + } let (groupSourceFiles, groups) = try getGroupSources(targetType: targetType, targetSource: targetSource, path: path, isBaseGroup: true) let group = groups.first! if let name = targetSource.name { diff --git a/Tests/XcodeGenKitTests/SourceGeneratorTests.swift b/Tests/XcodeGenKitTests/SourceGeneratorTests.swift index 97c7dc9c..68eec0ce 100644 --- a/Tests/XcodeGenKitTests/SourceGeneratorTests.swift +++ b/Tests/XcodeGenKitTests/SourceGeneratorTests.swift @@ -589,6 +589,30 @@ class SourceGeneratorTests: XCTestCase { "group2", ] } + + $0.it("adds missing optional files and folders") { + + let target = Target(name: "Test", type: .application, platform: .iOS, sources: [ + TargetSource(path: "File1.swift", optional: true), + TargetSource(path: "File2.swift", type: .file, optional: true), + TargetSource(path: "Group", type: .folder, optional: true), + ]) + let project = Project(basePath: directoryPath, name: "Test", targets: [target]) + let pbxProj = try project.generatePbxProj() + try pbxProj.expectFile(paths: ["File1.swift"]) + try pbxProj.expectFile(paths: ["File2.swift"]) + } + + $0.it("allows missing optional groups") { + + let target = Target(name: "Test", type: .application, platform: .iOS, sources: [ + TargetSource(path: "Group1", optional: true), + TargetSource(path: "Group2", type: .group, optional: true), + TargetSource(path: "Group3", type: .group, optional: true), + ]) + let project = Project(basePath: directoryPath, name: "Test", targets: [target]) + _ = try project.generatePbxProj() + } } } } From d9001e70eaf4de70da91623f89ac4d8019cf4c64 Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Thu, 4 Apr 2019 23:40:33 +1100 Subject: [PATCH 21/22] update changelog --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7018e4fa..2268f84d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ #### Changed - Updated to xcodeproj 6.7.0 including its performance improvements [#536](https://github.com/yonaskolb/XcodeGen/pull/536) @yonaskolb +#### Fixed +- Fixed `optional` file sources not being added to the project [#557](https://github.com/yonaskolb/XcodeGen/pull/557) @yonaskolb + ## 2.4.0 #### Fixed: @@ -33,7 +36,7 @@ #### Fixed - Sources outside a project spec's directory will be correctly referenced as relative paths in the project file. [#524](https://github.com/yonaskolb/XcodeGen/pull/524) -- Fixed error when `optional` path is missing [#527](https://github.com/yonaskolb/XcodeGen/pull/527) @yonaskolb +- Fixed error when `optional` directory source is missing [#527](https://github.com/yonaskolb/XcodeGen/pull/527) @yonaskolb - Fixed excludes within included spec [#535](https://github.com/yonaskolb/XcodeGen/pull/535) @yonaskolb - Fixed paths in target templates within included files not being relative [#537](https://github.com/yonaskolb/XcodeGen/pull/537) @yonaskolb - Fix multi-platform target templates [#541](https://github.com/yonaskolb/XcodeGen/pull/541) @yonaskolb From 3a03f0b33839e9b19995c5c31885a29fe8bd815c Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Sat, 6 Apr 2019 20:37:56 +1100 Subject: [PATCH 22/22] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7018e4fa..92643f69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ #### Changed - Updated to xcodeproj 6.7.0 including its performance improvements [#536](https://github.com/yonaskolb/XcodeGen/pull/536) @yonaskolb +- Updated default generated settings for Xcode 10.2 [#555](https://github.com/yonaskolb/XcodeGen/pull/555) @yonaskolb ## 2.4.0