Merge branch 'master' into support-local-sp

This commit is contained in:
freddi(Yuki Aki) 2020-03-18 16:15:55 +09:00 committed by GitHub
commit da930999c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 39 additions and 6 deletions

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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
@ -363,6 +368,10 @@ extension Scheme.Run: JSONEncodable {
dict["disableMainThreadChecker"] = disableMainThreadChecker
}
if stopOnEveryMainThreadCheckerIssue != Scheme.Run.stopOnEveryMainThreadCheckerIssueDefault {
dict["stopOnEveryMainThreadCheckerIssue"] = stopOnEveryMainThreadCheckerIssue
}
if debugEnabled != Scheme.Run.debugEnabledDefault {
dict["debugEnabled"] = debugEnabled
}

View File

@ -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") ?? []
@ -89,6 +94,10 @@ extension TargetScheme: JSONEncodable {
dict["disableMainThreadChecker"] = disableMainThreadChecker
}
if stopOnEveryMainThreadCheckerIssue != TargetScheme.stopOnEveryMainThreadCheckerIssueDefault {
dict["stopOnEveryMainThreadCheckerIssue"] = stopOnEveryMainThreadCheckerIssue
}
if let language = language {
dict["language"] = language
}

View File

@ -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
),

View File

@ -86,7 +86,8 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
disableMainThreadChecker = "YES">
disableMainThreadChecker = "YES"
stopOnEveryMainThreadCheckerIssue = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference

View File

@ -86,7 +86,8 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
disableMainThreadChecker = "YES">
disableMainThreadChecker = "YES"
stopOnEveryMainThreadCheckerIssue = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference

View File

@ -86,7 +86,8 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
disableMainThreadChecker = "YES">
disableMainThreadChecker = "YES"
stopOnEveryMainThreadCheckerIssue = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference

View File

@ -116,6 +116,7 @@ targets:
- App_iOS_UITests
gatherCoverageData: true
disableMainThreadChecker: true
stopOnEveryMainThreadCheckerIssue: true
configVariants:
- Test
- Staging

View File

@ -19,6 +19,7 @@ extension Project {
configVariants: ["Test", "Staging", "Prod"],
gatherCoverageData: true,
disableMainThreadChecker: true,
stopOnEveryMainThreadCheckerIssue: false,
commandLineArguments: [
"--command": true,
"--command2": false,

View File

@ -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",

View File

@ -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,
],
],
],