mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2024-09-20 00:58:04 +03:00
Merge branch 'support-local-sp' into support-local-sp-with-packages
This commit is contained in:
commit
5eb4c33197
@ -7,6 +7,7 @@
|
||||
|
||||
#### Fixed
|
||||
- Fixed resolving path to local Swift Packages [#796](https://github.com/yonaskolb/XcodeGen/pull/796) @freddi-kit
|
||||
- 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
|
||||
|
||||
|
@ -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
|
||||
@ -598,6 +598,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
|
||||
@ -733,6 +734,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.
|
||||
|
@ -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
|
||||
@ -200,7 +200,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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
),
|
||||
|
@ -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(
|
||||
|
@ -86,7 +86,8 @@
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES"
|
||||
disableMainThreadChecker = "YES">
|
||||
disableMainThreadChecker = "YES"
|
||||
stopOnEveryMainThreadCheckerIssue = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
|
@ -86,7 +86,8 @@
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES"
|
||||
disableMainThreadChecker = "YES">
|
||||
disableMainThreadChecker = "YES"
|
||||
stopOnEveryMainThreadCheckerIssue = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
|
@ -86,7 +86,8 @@
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES"
|
||||
disableMainThreadChecker = "YES">
|
||||
disableMainThreadChecker = "YES"
|
||||
stopOnEveryMainThreadCheckerIssue = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
|
@ -116,6 +116,7 @@ targets:
|
||||
- App_iOS_UITests
|
||||
gatherCoverageData: true
|
||||
disableMainThreadChecker: true
|
||||
stopOnEveryMainThreadCheckerIssue: true
|
||||
configVariants:
|
||||
- Test
|
||||
- Staging
|
||||
|
@ -19,6 +19,7 @@ extension Project {
|
||||
configVariants: ["Test", "Staging", "Prod"],
|
||||
gatherCoverageData: true,
|
||||
disableMainThreadChecker: true,
|
||||
stopOnEveryMainThreadCheckerIssue: false,
|
||||
commandLineArguments: [
|
||||
"--command": true,
|
||||
"--command2": false,
|
||||
|
@ -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",
|
||||
|
@ -712,6 +712,7 @@ class SpecLoadingTests: XCTestCase {
|
||||
"language": "en",
|
||||
"region": "US",
|
||||
"disableMainThreadChecker": true,
|
||||
"stopOnEveryMainThreadCheckerIssue": true,
|
||||
"environmentVariables": [
|
||||
"TEST_VAR": "TEST_VAL",
|
||||
],
|
||||
@ -738,6 +739,7 @@ class SpecLoadingTests: XCTestCase {
|
||||
language: "en",
|
||||
region: "US",
|
||||
disableMainThreadChecker: true,
|
||||
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")],
|
||||
@ -782,6 +784,7 @@ class SpecLoadingTests: XCTestCase {
|
||||
],
|
||||
"gatherCoverageData": true,
|
||||
"disableMainThreadChecker": true,
|
||||
"stopOnEveryMainThreadCheckerIssue": true,
|
||||
],
|
||||
]
|
||||
let scheme = try Scheme(name: "Scheme", jsonDictionary: schemeDictionary)
|
||||
@ -931,6 +934,7 @@ class SpecLoadingTests: XCTestCase {
|
||||
],
|
||||
"gatherCoverageData": true,
|
||||
"disableMainThreadChecker": true,
|
||||
"stopOnEveryMainThreadCheckerIssue": false,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
@ -992,7 +992,7 @@ class ProjectGeneratorTests: XCTestCase {
|
||||
"XcodeGen": SwiftPackage(kind: .remote(url: "http://github.com/yonaskolb/XcodeGen", versionRequirement: .branch("master"))),
|
||||
"Codability": SwiftPackage(kind: .remote(url: "http://github.com/yonaskolb/Codability", versionRequirement: .exact("1.0.0"))),
|
||||
"Yams": SwiftPackage(kind: .local(path: "../Yams"))
|
||||
], 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 }))
|
||||
|
Loading…
Reference in New Issue
Block a user