From cf7cfed68ecb2fe613b43cc665f0fa5af86fa916 Mon Sep 17 00:00:00 2001 From: ionutivan Date: Wed, 4 Mar 2020 17:19:37 +0100 Subject: [PATCH 01/17] Add documentation --- Docs/ProjectSpec.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Docs/ProjectSpec.md b/Docs/ProjectSpec.md index d103e2f6..e078c23e 100644 --- a/Docs/ProjectSpec.md +++ b/Docs/ProjectSpec.md @@ -597,6 +597,7 @@ This is a convenience used to automatically generate schemes for a target based - [ ] **testTargets**: **[[Test Target](#test-target)]** - a list of test targets that should be included in the scheme. These will be added to the build targets and the test entries. Each entry can either be a simple string, or a [Test Target](#test-target) - [ ] **gatherCoverageData**: **Bool** - a boolean that indicates if this scheme should gather coverage data. This defaults to false - [ ] **disableMainThreadChecker**: **Bool** - a boolean that indicates if this scheme should disable disable the Main Thread Checker. This defaults to false +- [ ] **stopOnEveryMainThreadCheckerIssue**: **Bool** - a boolean that indicates if this scheme should stop at every Main Thread Checker issue. This defaults to false - [ ] **language**: **String** - a String that indicates the language used for running and testing. This defaults to nil - [ ] **region**: **String** - a String that indicates the region used for running and testing. This defaults to nil - [ ] **commandLineArguments**: **[String:Bool]** - a dictionary from the argument name (`String`) to if it is enabled (`Bool`). These arguments will be added to the Test, Profile and Run scheme actions From 5487e3ce186c327f4600709760971d641e0b0b8b Mon Sep 17 00:00:00 2001 From: ionutivan Date: Wed, 4 Mar 2020 17:21:18 +0100 Subject: [PATCH 02/17] add property stopOnEveryMainThreadCheckerIssue to the scheme, target scheme and generator --- Sources/ProjectSpec/Scheme.swift | 9 +++++++++ Sources/ProjectSpec/TargetScheme.swift | 9 +++++++++ Sources/XcodeGenKit/SchemeGenerator.swift | 2 ++ 3 files changed, 20 insertions(+) diff --git a/Sources/ProjectSpec/Scheme.swift b/Sources/ProjectSpec/Scheme.swift index 45ed0f15..e7b0059f 100644 --- a/Sources/ProjectSpec/Scheme.swift +++ b/Sources/ProjectSpec/Scheme.swift @@ -95,6 +95,7 @@ public struct Scheme: Equatable { public struct Run: BuildAction { public static let disableMainThreadCheckerDefault = false + public static let stopOnEveryMainThreadCheckerIssueDefault = false public static let debugEnabledDefault = true public var config: String? @@ -103,6 +104,7 @@ public struct Scheme: Equatable { public var postActions: [ExecutionAction] public var environmentVariables: [XCScheme.EnvironmentVariable] public var disableMainThreadChecker: Bool + public var stopOnEveryMainThreadCheckerIssue: Bool public var language: String? public var region: String? public var debugEnabled: Bool @@ -115,6 +117,7 @@ public struct Scheme: Equatable { postActions: [ExecutionAction] = [], environmentVariables: [XCScheme.EnvironmentVariable] = [], disableMainThreadChecker: Bool = disableMainThreadCheckerDefault, + stopOnEveryMainThreadCheckerIssue: Bool = stopOnEveryMainThreadCheckerIssueDefault, language: String? = nil, region: String? = nil, debugEnabled: Bool = debugEnabledDefault, @@ -126,6 +129,7 @@ public struct Scheme: Equatable { self.postActions = postActions self.environmentVariables = environmentVariables self.disableMainThreadChecker = disableMainThreadChecker + self.stopOnEveryMainThreadCheckerIssue = stopOnEveryMainThreadCheckerIssue self.language = language self.region = region self.debugEnabled = debugEnabled @@ -340,6 +344,7 @@ extension Scheme.Run: JSONObjectConvertible { postActions = jsonDictionary.json(atKeyPath: "postActions") ?? [] environmentVariables = try XCScheme.EnvironmentVariable.parseAll(jsonDictionary: jsonDictionary) disableMainThreadChecker = jsonDictionary.json(atKeyPath: "disableMainThreadChecker") ?? Scheme.Run.disableMainThreadCheckerDefault + stopOnEveryMainThreadCheckerIssue = jsonDictionary.json(atKeyPath: "stopOnEveryMainThreadCheckerIssue") ?? Scheme.Run.stopOnEveryMainThreadCheckerIssueDefault language = jsonDictionary.json(atKeyPath: "language") region = jsonDictionary.json(atKeyPath: "region") debugEnabled = jsonDictionary.json(atKeyPath: "debugEnabled") ?? Scheme.Run.debugEnabledDefault @@ -362,6 +367,10 @@ extension Scheme.Run: JSONEncodable { if disableMainThreadChecker != Scheme.Run.disableMainThreadCheckerDefault { dict["disableMainThreadChecker"] = disableMainThreadChecker } + + if stopOnEveryMainThreadCheckerIssue != Scheme.Run.stopOnEveryMainThreadCheckerIssueDefault { + dict["stopOnEveryMainThreadCheckerIssue"] = stopOnEveryMainThreadCheckerIssue + } if debugEnabled != Scheme.Run.debugEnabledDefault { dict["debugEnabled"] = debugEnabled diff --git a/Sources/ProjectSpec/TargetScheme.swift b/Sources/ProjectSpec/TargetScheme.swift index 6337d8d5..f6d01294 100644 --- a/Sources/ProjectSpec/TargetScheme.swift +++ b/Sources/ProjectSpec/TargetScheme.swift @@ -5,6 +5,7 @@ import XcodeProj public struct TargetScheme: Equatable { public static let gatherCoverageDataDefault = false public static let disableMainThreadCheckerDefault = false + public static let stopOnEveryMainThreadCheckerIssueDefault = false public var testTargets: [Scheme.Test.TestTarget] public var configVariants: [String] @@ -12,6 +13,7 @@ public struct TargetScheme: Equatable { public var language: String? public var region: String? public var disableMainThreadChecker: Bool + public var stopOnEveryMainThreadCheckerIssue: Bool public var commandLineArguments: [String: Bool] public var environmentVariables: [XCScheme.EnvironmentVariable] public var preActions: [Scheme.ExecutionAction] @@ -24,6 +26,7 @@ public struct TargetScheme: Equatable { language: String? = nil, region: String? = nil, disableMainThreadChecker: Bool = disableMainThreadCheckerDefault, + stopOnEveryMainThreadCheckerIssue: Bool = stopOnEveryMainThreadCheckerIssueDefault, commandLineArguments: [String: Bool] = [:], environmentVariables: [XCScheme.EnvironmentVariable] = [], preActions: [Scheme.ExecutionAction] = [], @@ -35,6 +38,7 @@ public struct TargetScheme: Equatable { self.language = language self.region = region self.disableMainThreadChecker = disableMainThreadChecker + self.stopOnEveryMainThreadCheckerIssue = stopOnEveryMainThreadCheckerIssue self.commandLineArguments = commandLineArguments self.environmentVariables = environmentVariables self.preActions = preActions @@ -63,6 +67,7 @@ extension TargetScheme: JSONObjectConvertible { language = jsonDictionary.json(atKeyPath: "language") region = jsonDictionary.json(atKeyPath: "region") disableMainThreadChecker = jsonDictionary.json(atKeyPath: "disableMainThreadChecker") ?? TargetScheme.disableMainThreadCheckerDefault + stopOnEveryMainThreadCheckerIssue = jsonDictionary.json(atKeyPath: "stopOnEveryMainThreadCheckerIssue") ?? TargetScheme.stopOnEveryMainThreadCheckerIssueDefault commandLineArguments = jsonDictionary.json(atKeyPath: "commandLineArguments") ?? [:] environmentVariables = try XCScheme.EnvironmentVariable.parseAll(jsonDictionary: jsonDictionary) preActions = jsonDictionary.json(atKeyPath: "preActions") ?? [] @@ -88,6 +93,10 @@ extension TargetScheme: JSONEncodable { if disableMainThreadChecker != TargetScheme.disableMainThreadCheckerDefault { dict["disableMainThreadChecker"] = disableMainThreadChecker } + + if stopOnEveryMainThreadCheckerIssue != TargetScheme.stopOnEveryMainThreadCheckerIssueDefault { + dict["stopOnEveryMainThreadCheckerIssue"] = stopOnEveryMainThreadCheckerIssue + } if let language = language { dict["language"] = language diff --git a/Sources/XcodeGenKit/SchemeGenerator.swift b/Sources/XcodeGenKit/SchemeGenerator.swift index 4e8c04d8..151c6c9e 100644 --- a/Sources/XcodeGenKit/SchemeGenerator.swift +++ b/Sources/XcodeGenKit/SchemeGenerator.swift @@ -235,6 +235,7 @@ public class SchemeGenerator { allowLocationSimulation: allowLocationSimulation, locationScenarioReference: locationScenarioReference, disableMainThreadChecker: scheme.run?.disableMainThreadChecker ?? Scheme.Run.disableMainThreadCheckerDefault, + stopOnEveryMainThreadCheckerIssue: scheme.run?.stopOnEveryMainThreadCheckerIssue ?? Scheme.Run.stopOnEveryMainThreadCheckerIssueDefault, commandlineArguments: launchCommandLineArgs, environmentVariables: launchVariables, language: scheme.run?.language, @@ -302,6 +303,7 @@ extension Scheme { postActions: targetScheme.postActions, environmentVariables: targetScheme.environmentVariables, disableMainThreadChecker: targetScheme.disableMainThreadChecker, + stopOnEveryMainThreadCheckerIssue: targetScheme.stopOnEveryMainThreadCheckerIssue, language: targetScheme.language, region: targetScheme.region ), From 8f103c6b17bb77bac9efda3c535070558ba4dbad Mon Sep 17 00:00:00 2001 From: ionutivan Date: Wed, 4 Mar 2020 17:22:58 +0100 Subject: [PATCH 03/17] add unit tests for the new property --- Tests/ProjectSpecTests/ProjectSpecTests.swift | 1 + Tests/ProjectSpecTests/SpecLoadingTests.swift | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Tests/ProjectSpecTests/ProjectSpecTests.swift b/Tests/ProjectSpecTests/ProjectSpecTests.swift index 1e163163..5a17e6de 100644 --- a/Tests/ProjectSpecTests/ProjectSpecTests.swift +++ b/Tests/ProjectSpecTests/ProjectSpecTests.swift @@ -394,6 +394,7 @@ class ProjectSpecTests: XCTestCase { configVariants: ["foo"], gatherCoverageData: true, disableMainThreadChecker: true, + stopOnEveryMainThreadCheckerIssue: false, commandLineArguments: ["foo": true], environmentVariables: [XCScheme.EnvironmentVariable(variable: "environmentVariable", value: "bar", diff --git a/Tests/ProjectSpecTests/SpecLoadingTests.swift b/Tests/ProjectSpecTests/SpecLoadingTests.swift index c1d3a765..146002dd 100644 --- a/Tests/ProjectSpecTests/SpecLoadingTests.swift +++ b/Tests/ProjectSpecTests/SpecLoadingTests.swift @@ -712,6 +712,7 @@ class SpecLoadingTests: XCTestCase { "language": "en", "region": "US", "disableMainThreadChecker": true, + "stopOnEveryMainThreadCheckerIssue": false, "environmentVariables": [ "TEST_VAR": "TEST_VAL", ], @@ -738,6 +739,7 @@ class SpecLoadingTests: XCTestCase { language: "en", region: "US", disableMainThreadChecker: true, + stopOnEveryMainThreadCheckerIssue: false, commandLineArguments: ["ENV1": true], environmentVariables: [XCScheme.EnvironmentVariable(variable: "TEST_VAR", value: "TEST_VAL", enabled: true)], preActions: [.init(name: "Do Thing", script: "dothing", settingsTarget: "test")], @@ -782,6 +784,7 @@ class SpecLoadingTests: XCTestCase { ], "gatherCoverageData": true, "disableMainThreadChecker": true, + "stopOnEveryMainThreadCheckerIssue": false, ], ] let scheme = try Scheme(name: "Scheme", jsonDictionary: schemeDictionary) @@ -931,6 +934,7 @@ class SpecLoadingTests: XCTestCase { ], "gatherCoverageData": true, "disableMainThreadChecker": true, + "stopOnEveryMainThreadCheckerIssue": false, ], ], ], From dea537db051239f61e0a8bae57f9d3e234abaf1e Mon Sep 17 00:00:00 2001 From: ionutivan Date: Wed, 4 Mar 2020 17:23:28 +0100 Subject: [PATCH 04/17] add performance tests --- Tests/PerformanceTests/TestProject.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/PerformanceTests/TestProject.swift b/Tests/PerformanceTests/TestProject.swift index 0eac0c01..e2e7b372 100644 --- a/Tests/PerformanceTests/TestProject.swift +++ b/Tests/PerformanceTests/TestProject.swift @@ -19,6 +19,7 @@ extension Project { configVariants: ["Test", "Staging", "Prod"], gatherCoverageData: true, disableMainThreadChecker: true, + stopOnEveryMainThreadCheckerIssue: false, commandLineArguments: [ "--command": true, "--command2": false, From 364aa7db121f5c6d084cdecb5f0a04a276fbf58e Mon Sep 17 00:00:00 2001 From: ionutivan Date: Wed, 4 Mar 2020 17:24:27 +0100 Subject: [PATCH 05/17] add integration test by modifying the yaml file --- Tests/Fixtures/TestProject/project.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/Fixtures/TestProject/project.yml b/Tests/Fixtures/TestProject/project.yml index f8af9d7a..4a946709 100644 --- a/Tests/Fixtures/TestProject/project.yml +++ b/Tests/Fixtures/TestProject/project.yml @@ -116,6 +116,7 @@ targets: - App_iOS_UITests gatherCoverageData: true disableMainThreadChecker: true + stopOnEveryMainThreadCheckerIssue: false configVariants: - Test - Staging From dece42e78441c9ffa9a2cb2c7769f0903927e71d Mon Sep 17 00:00:00 2001 From: ionutivan Date: Wed, 4 Mar 2020 21:55:08 +0100 Subject: [PATCH 06/17] change CHANGELOG --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba57121a..e200cef5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Next Version +#### Added +- Added ability to stop on every main thread checker issue on Run schemes and TargetSchemes [#325](https://github.com/yonaskolb/XcodeGen/pull/601) @ionutivan + ## 2.14.0 #### Added From 7e6e0af89f7fb173f582ed5bdb3c16b194812177 Mon Sep 17 00:00:00 2001 From: ionutivan Date: Wed, 4 Mar 2020 21:58:01 +0100 Subject: [PATCH 07/17] change CHANGELOG pull number --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e200cef5..a95c9efd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## Next Version #### Added -- Added ability to stop on every main thread checker issue on Run schemes and TargetSchemes [#325](https://github.com/yonaskolb/XcodeGen/pull/601) @ionutivan +- Added ability to stop on every main thread checker issue on Run schemes and TargetSchemes [#799](https://github.com/yonaskolb/XcodeGen/pull/799) @ionutivan ## 2.14.0 From 6593b6ef015cc76677ca66a6147eb1753e38b592 Mon Sep 17 00:00:00 2001 From: Yonas Kolb Date: Thu, 5 Mar 2020 17:53:39 +1100 Subject: [PATCH 08/17] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c34892f4..ebe42ff9 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ Options: - **--use-cache**: Used to prevent unnecessarily generating the project. If this is set, then a cache file will be written to when a project is generated. If `xcodegen` is later run but the spec and all the files it contains are the same, the project won't be generated. - **--cache-path**: A custom path to use for your cache file. This defaults to `~/.xcodegen/cache/{PROJECT_SPEC_PATH_HASH}` -There are other commands as well. Use `xcodegen help` to see more detailed usage information. +There are other commands as well such as `xcodegen dump` which lets out output the resolved spec in many different formats, or write it to a file. Use `xcodegen help` to see more detailed usage information. ## Editing ```shell From b06bc4903b3803f7432931527d4679cb3f26f6b5 Mon Sep 17 00:00:00 2001 From: ionutivan Date: Thu, 5 Mar 2020 09:19:41 +0100 Subject: [PATCH 09/17] add documentation for Scheme --- Docs/ProjectSpec.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Docs/ProjectSpec.md b/Docs/ProjectSpec.md index e078c23e..5f9e6f28 100644 --- a/Docs/ProjectSpec.md +++ b/Docs/ProjectSpec.md @@ -733,6 +733,7 @@ The different actions share some properties: - [ ] **postActions**: **[[Execution Action](#execution-action)]** - Scripts that are run *after* the action - [ ] **environmentVariables**: **[[Environment Variable](#environment-variable)]** or **[String:String]** - `run`, `test` and `profile` actions can define the environment variables. When passing a dictionary, every key-value entry maps to a corresponding variable that is enabled. - [ ] **disableMainThreadChecker**: **Bool** - `run` and `test` actions can define a boolean that indicates that this scheme should disable the Main Thread Checker. This defaults to false +- [ ] **stopOnEveryMainThreadCheckerIssue**: **Bool** - a boolean that indicates if this scheme should stop at every Main Thread Checker issue. This defaults to false - [ ] **language**: **String** - `run` and `test` actions can define a language that is used for Application Language - [ ] **region**: **String** - `run` and `test` actions can define a language that is used for Application Region - [ ] **debugEnabled**: **Bool** - `run` and `test` actions can define a whether debugger should be used. This defaults to true. From 40902fb422d2ae0c43dfdb36ac11e76a8add0f56 Mon Sep 17 00:00:00 2001 From: ionutivan Date: Thu, 5 Mar 2020 12:59:38 +0100 Subject: [PATCH 10/17] set stopOnEveryMainThreadCheckerIssue true for App_iOS_Tests and App_iOS_UITests --- Tests/Fixtures/TestProject/project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Fixtures/TestProject/project.yml b/Tests/Fixtures/TestProject/project.yml index 4a946709..72d32beb 100644 --- a/Tests/Fixtures/TestProject/project.yml +++ b/Tests/Fixtures/TestProject/project.yml @@ -116,7 +116,7 @@ targets: - App_iOS_UITests gatherCoverageData: true disableMainThreadChecker: true - stopOnEveryMainThreadCheckerIssue: false + stopOnEveryMainThreadCheckerIssue: true configVariants: - Test - Staging From 7ad84d5624cfd45ae5ebf304ef038cd8f87067e5 Mon Sep 17 00:00:00 2001 From: Wooseong Kim Date: Thu, 12 Mar 2020 16:55:03 +0900 Subject: [PATCH 11/17] Fix typo on Carthage Usage part --- Docs/Usage.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Docs/Usage.md b/Docs/Usage.md index 546c12aa..0ed781f6 100644 --- a/Docs/Usage.md +++ b/Docs/Usage.md @@ -122,7 +122,7 @@ By default these all have to be listed if you want to link and use them: ```yml targets: App: - frameworks: + dependencies: - carthage: ReactiveCocoa - carthage: ReactiveMapKit ``` @@ -134,7 +134,7 @@ options: findCarthageFrameworks: true targets: App: - frameworks: + dependencies: - carthage: ReactiveCocoa # will find ReactiveMapKit as well - carthage: OtherCarthageDependency findFrameworks: false # disables the global option From 2252ee4882655a20b6194d6355c20667d565c259 Mon Sep 17 00:00:00 2001 From: ionutivan Date: Tue, 17 Mar 2020 18:29:25 +0100 Subject: [PATCH 12/17] set stopOnEveryMainThreadCheckerIssue to test parsing --- Tests/ProjectSpecTests/SpecLoadingTests.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/ProjectSpecTests/SpecLoadingTests.swift b/Tests/ProjectSpecTests/SpecLoadingTests.swift index 146002dd..43dee43d 100644 --- a/Tests/ProjectSpecTests/SpecLoadingTests.swift +++ b/Tests/ProjectSpecTests/SpecLoadingTests.swift @@ -712,7 +712,7 @@ class SpecLoadingTests: XCTestCase { "language": "en", "region": "US", "disableMainThreadChecker": true, - "stopOnEveryMainThreadCheckerIssue": false, + "stopOnEveryMainThreadCheckerIssue": true, "environmentVariables": [ "TEST_VAR": "TEST_VAL", ], @@ -739,7 +739,7 @@ class SpecLoadingTests: XCTestCase { language: "en", region: "US", disableMainThreadChecker: true, - stopOnEveryMainThreadCheckerIssue: false, + stopOnEveryMainThreadCheckerIssue: true, commandLineArguments: ["ENV1": true], environmentVariables: [XCScheme.EnvironmentVariable(variable: "TEST_VAR", value: "TEST_VAL", enabled: true)], preActions: [.init(name: "Do Thing", script: "dothing", settingsTarget: "test")], @@ -784,7 +784,7 @@ class SpecLoadingTests: XCTestCase { ], "gatherCoverageData": true, "disableMainThreadChecker": true, - "stopOnEveryMainThreadCheckerIssue": false, + "stopOnEveryMainThreadCheckerIssue": true, ], ] let scheme = try Scheme(name: "Scheme", jsonDictionary: schemeDictionary) From 2f0c5ea7a4d76aef121b72c1ae3b171ceae54f89 Mon Sep 17 00:00:00 2001 From: ionutivan Date: Tue, 17 Mar 2020 18:36:51 +0100 Subject: [PATCH 13/17] change test fixtures --- .../xcshareddata/xcschemes/App_iOS Production.xcscheme | 3 ++- .../xcshareddata/xcschemes/App_iOS Staging.xcscheme | 3 ++- .../xcshareddata/xcschemes/App_iOS Test.xcscheme | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/App_iOS Production.xcscheme b/Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/App_iOS Production.xcscheme index 4a0a9733..fd17b922 100644 --- a/Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/App_iOS Production.xcscheme +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/xcshareddata/xcschemes/App_iOS Production.xcscheme @@ -86,7 +86,8 @@ debugDocumentVersioning = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES" - disableMainThreadChecker = "YES"> + disableMainThreadChecker = "YES" + stopOnEveryMainThreadCheckerIssue = "YES"> + disableMainThreadChecker = "YES" + stopOnEveryMainThreadCheckerIssue = "YES"> + disableMainThreadChecker = "YES" + stopOnEveryMainThreadCheckerIssue = "YES"> Date: Wed, 18 Mar 2020 17:13:29 +0900 Subject: [PATCH 14/17] Update Sources/XcodeGenKit/SourceGenerator.swift Co-Authored-By: Yonas Kolb --- Sources/XcodeGenKit/SourceGenerator.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/XcodeGenKit/SourceGenerator.swift b/Sources/XcodeGenKit/SourceGenerator.swift index ca5c050b..961d4f77 100644 --- a/Sources/XcodeGenKit/SourceGenerator.swift +++ b/Sources/XcodeGenKit/SourceGenerator.swift @@ -63,7 +63,7 @@ class SourceGenerator { let absolutePath = project.basePath + path.normalize() - // Get local pakcage's relative path from generating project's root + // Get the local package's relative path from the project root let fileReferencePath = try? absolutePath.relativePath(from: projectDirectory ?? project.basePath).string let fileReference = addObject( From 8dcfd07bd5d00aaaaa35fd6730b38cf623275b63 Mon Sep 17 00:00:00 2001 From: "freddi(Yuki Aki)" Date: Wed, 18 Mar 2020 17:13:50 +0900 Subject: [PATCH 15/17] Update Tests/XcodeGenKitTests/ProjectGeneratorTests.swift Co-Authored-By: Yonas Kolb --- Tests/XcodeGenKitTests/ProjectGeneratorTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/XcodeGenKitTests/ProjectGeneratorTests.swift b/Tests/XcodeGenKitTests/ProjectGeneratorTests.swift index 3885d47b..e8edac2a 100644 --- a/Tests/XcodeGenKitTests/ProjectGeneratorTests.swift +++ b/Tests/XcodeGenKitTests/ProjectGeneratorTests.swift @@ -991,7 +991,7 @@ class ProjectGeneratorTests: XCTestCase { let project = Project(name: "test", targets: [app], packages: [ "XcodeGen": SwiftPackage(url: "http://github.com/yonaskolb/XcodeGen", versionRequirement: .branch("master")), "Codability": SwiftPackage(url: "http://github.com/yonaskolb/Codability", versionRequirement: .exact("1.0.0")), - ], localPackages: ["../XcodeGen" : LocalSwiftPackage(path: "../XcodeGen")], options: .init(localPackagesGroup: "MyPackages")) + ], localPackages: ["XcodeGen" : LocalSwiftPackage(path: "../XcodeGen")], options: .init(localPackagesGroup: "MyPackages")) let pbxProject = try project.generatePbxProj(specValidate: false) let nativeTarget = try unwrap(pbxProject.nativeTargets.first(where: { $0.name == app.name })) From b03ae52c0a710ce64e4ca2ad346a6b57c0fa586d Mon Sep 17 00:00:00 2001 From: freddi Date: Wed, 18 Mar 2020 17:17:43 +0900 Subject: [PATCH 16/17] Removed old localPackages descriptions --- Docs/ProjectSpec.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/ProjectSpec.md b/Docs/ProjectSpec.md index 3ac47e52..a3b43cc4 100644 --- a/Docs/ProjectSpec.md +++ b/Docs/ProjectSpec.md @@ -50,7 +50,7 @@ You can also use environment variables in your configuration file, by using `${S - [ ] **schemes**: **[Scheme](#scheme)** - A list of schemes by name. This allows more control over what is found in [Target Scheme](#target-scheme) - [ ] **targetTemplates**: **[String: [Target Template](#target-template)]** - a list of targets that can be used as templates for actual targets which reference them via a `template` property. They can be used to extract common target settings. Works great in combination with `include`. - [ ] **packages**: **[String: [Swift Package](#swift-package)]** - a map of Swift packages by name -- [ ] **localPackages**: **[String: [Local Swift Package](#local-swift-package)]** - a map of local Swift packages by name. The paths must be directories with a `Package.swift` file in them. If same name remote repo is listed in `packages`, remote repo will be overridden to a local version in `localPackages` for development purposes. We can also use by path list ( `[String]` ). However, local packages that don't mirror remote packages aren't able to be linked to, by `[String]` format. +- [ ] **localPackages**: **[String: [Local Swift Package](#local-swift-package)]** - a map of local Swift packages by name. The paths must be directories with a `Package.swift` file in them. If same name remote repo is listed in `packages`, remote repo will be overridden to a local version in `localPackages` for development purposes. - [ ] **projectReferences**: **[String: [Project Reference](#project-reference)]** - a map of project references by name ### Include From ccdfc52cd28e005a8c355f281837305ae22a835f Mon Sep 17 00:00:00 2001 From: freddi Date: Wed, 18 Mar 2020 17:25:38 +0900 Subject: [PATCH 17/17] Removed not true sentence --- Docs/Usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/Usage.md b/Docs/Usage.md index b4f740c5..21d034b8 100644 --- a/Docs/Usage.md +++ b/Docs/Usage.md @@ -197,7 +197,7 @@ targets: - package: Yams # Yams in local will be used instead of Yams from remote repos ``` -These local packages get put into a `Packages` group in the root of the project by default. This can be changed with `options.localPackagesGroup`. However you can not set it as `dependencies`, and they are only used for overriding `packages`. +These local packages get put into a `Packages` group in the root of the project by default. This can be changed with `options.localPackagesGroup`. ### SDK System frameworks and libs can be linked by using the `sdk` dependency type. You can either specify frameworks or libs by using a `.framework`, `.tbd` or `dylib` filename, respectively