mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Add support to disable "Thread Performance Checker" (#1380)
* Add disableThreadPerformanceChecker scheme option * Update changelog
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
- Added `scheme.enableGPUValidationMode` #1294 @LouisLWang
|
||||
- Added visionOS support #1379 @shiba1014
|
||||
- Added ability to disable Thread performance checker in Schemes #1380 @piellarda
|
||||
|
||||
### Changed
|
||||
|
||||
|
||||
@@ -786,6 +786,7 @@ This is a convenience used to automatically generate schemes for a target based
|
||||
- [ ] **coverageTargets**: **[[Testable Target Reference](#testable-target-reference) - a list of targets to gather code coverage. Each entry can either be a simple string, a string using [Project Reference](#project-reference) or [Testable Target Reference](#testable-target-reference)
|
||||
- [ ] **disableMainThreadChecker**: **Bool** - a boolean that indicates if 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
|
||||
- [ ] **disableThreadPerformanceChecker**: **Bool** - a boolean that indicates if this scheme should disable the Thread Performance Checker. This defaults to false
|
||||
- [ ] **buildImplicitDependencies**: **Bool** - Flag to determine if Xcode should build implicit dependencies of this scheme. By default this is `true` if not set.
|
||||
- [ ] **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
|
||||
@@ -937,6 +938,7 @@ The different actions share some properties:
|
||||
- [ ] **enableGPUValidationMode**: **GPUValidationMode** - Property value set for `Metal API Validation`. Possible values are `enabled`, `disabled`, `extended`. Default 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
|
||||
- [ ] **disableThreadPerformanceChecker**: **Bool** - `run` action can define a boolean that indicates that this scheme should disable the Thread Performance Checker. 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.
|
||||
|
||||
@@ -127,6 +127,7 @@ public struct Scheme: Equatable {
|
||||
public struct Run: BuildAction {
|
||||
public static let disableMainThreadCheckerDefault = false
|
||||
public static let stopOnEveryMainThreadCheckerIssueDefault = false
|
||||
public static let disableThreadPerformanceCheckerDefault = false
|
||||
public static let debugEnabledDefault = true
|
||||
|
||||
public var config: String?
|
||||
@@ -138,6 +139,7 @@ public struct Scheme: Equatable {
|
||||
public var enableGPUValidationMode: XCScheme.LaunchAction.GPUValidationMode
|
||||
public var disableMainThreadChecker: Bool
|
||||
public var stopOnEveryMainThreadCheckerIssue: Bool
|
||||
public var disableThreadPerformanceChecker: Bool
|
||||
public var language: String?
|
||||
public var region: String?
|
||||
public var askForAppToLaunch: Bool?
|
||||
@@ -160,6 +162,7 @@ public struct Scheme: Equatable {
|
||||
enableGPUValidationMode: XCScheme.LaunchAction.GPUValidationMode = XCScheme.LaunchAction.GPUValidationMode.enabled,
|
||||
disableMainThreadChecker: Bool = disableMainThreadCheckerDefault,
|
||||
stopOnEveryMainThreadCheckerIssue: Bool = stopOnEveryMainThreadCheckerIssueDefault,
|
||||
disableThreadPerformanceChecker: Bool = disableThreadPerformanceCheckerDefault,
|
||||
language: String? = nil,
|
||||
region: String? = nil,
|
||||
askForAppToLaunch: Bool? = nil,
|
||||
@@ -179,6 +182,7 @@ public struct Scheme: Equatable {
|
||||
self.enableGPUFrameCaptureMode = enableGPUFrameCaptureMode
|
||||
self.enableGPUValidationMode = enableGPUValidationMode
|
||||
self.stopOnEveryMainThreadCheckerIssue = stopOnEveryMainThreadCheckerIssue
|
||||
self.disableThreadPerformanceChecker = disableThreadPerformanceChecker
|
||||
self.language = language
|
||||
self.region = region
|
||||
self.askForAppToLaunch = askForAppToLaunch
|
||||
@@ -480,6 +484,7 @@ extension Scheme.Run: JSONObjectConvertible {
|
||||
}
|
||||
disableMainThreadChecker = jsonDictionary.json(atKeyPath: "disableMainThreadChecker") ?? Scheme.Run.disableMainThreadCheckerDefault
|
||||
stopOnEveryMainThreadCheckerIssue = jsonDictionary.json(atKeyPath: "stopOnEveryMainThreadCheckerIssue") ?? Scheme.Run.stopOnEveryMainThreadCheckerIssueDefault
|
||||
disableThreadPerformanceChecker = jsonDictionary.json(atKeyPath: "disableThreadPerformanceChecker") ?? Scheme.Run.disableThreadPerformanceCheckerDefault
|
||||
language = jsonDictionary.json(atKeyPath: "language")
|
||||
region = jsonDictionary.json(atKeyPath: "region")
|
||||
debugEnabled = jsonDictionary.json(atKeyPath: "debugEnabled") ?? Scheme.Run.debugEnabledDefault
|
||||
@@ -535,6 +540,10 @@ extension Scheme.Run: JSONEncodable {
|
||||
dict["stopOnEveryMainThreadCheckerIssue"] = stopOnEveryMainThreadCheckerIssue
|
||||
}
|
||||
|
||||
if disableThreadPerformanceChecker != Scheme.Run.disableThreadPerformanceCheckerDefault {
|
||||
dict["disableThreadPerformanceChecker"] = disableThreadPerformanceChecker
|
||||
}
|
||||
|
||||
if debugEnabled != Scheme.Run.debugEnabledDefault {
|
||||
dict["debugEnabled"] = debugEnabled
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ public struct TargetScheme: Equatable {
|
||||
public static let gatherCoverageDataDefault = false
|
||||
public static let disableMainThreadCheckerDefault = false
|
||||
public static let stopOnEveryMainThreadCheckerIssueDefault = false
|
||||
public static let disableThreadPerformanceCheckerDefault = false
|
||||
public static let buildImplicitDependenciesDefault = true
|
||||
|
||||
public var testTargets: [Scheme.Test.TestTarget]
|
||||
@@ -17,6 +18,7 @@ public struct TargetScheme: Equatable {
|
||||
public var region: String?
|
||||
public var disableMainThreadChecker: Bool
|
||||
public var stopOnEveryMainThreadCheckerIssue: Bool
|
||||
public var disableThreadPerformanceChecker: Bool
|
||||
public var buildImplicitDependencies: Bool
|
||||
public var commandLineArguments: [String: Bool]
|
||||
public var environmentVariables: [XCScheme.EnvironmentVariable]
|
||||
@@ -36,6 +38,7 @@ public struct TargetScheme: Equatable {
|
||||
region: String? = nil,
|
||||
disableMainThreadChecker: Bool = disableMainThreadCheckerDefault,
|
||||
stopOnEveryMainThreadCheckerIssue: Bool = stopOnEveryMainThreadCheckerIssueDefault,
|
||||
disableThreadPerformanceChecker: Bool = disableThreadPerformanceCheckerDefault,
|
||||
buildImplicitDependencies: Bool = buildImplicitDependenciesDefault,
|
||||
commandLineArguments: [String: Bool] = [:],
|
||||
environmentVariables: [XCScheme.EnvironmentVariable] = [],
|
||||
@@ -53,6 +56,7 @@ public struct TargetScheme: Equatable {
|
||||
self.region = region
|
||||
self.disableMainThreadChecker = disableMainThreadChecker
|
||||
self.stopOnEveryMainThreadCheckerIssue = stopOnEveryMainThreadCheckerIssue
|
||||
self.disableThreadPerformanceChecker = disableThreadPerformanceChecker
|
||||
self.buildImplicitDependencies = buildImplicitDependencies
|
||||
self.commandLineArguments = commandLineArguments
|
||||
self.environmentVariables = environmentVariables
|
||||
@@ -104,6 +108,7 @@ extension TargetScheme: JSONObjectConvertible {
|
||||
region = jsonDictionary.json(atKeyPath: "region")
|
||||
disableMainThreadChecker = jsonDictionary.json(atKeyPath: "disableMainThreadChecker") ?? TargetScheme.disableMainThreadCheckerDefault
|
||||
stopOnEveryMainThreadCheckerIssue = jsonDictionary.json(atKeyPath: "stopOnEveryMainThreadCheckerIssue") ?? TargetScheme.stopOnEveryMainThreadCheckerIssueDefault
|
||||
disableThreadPerformanceChecker = jsonDictionary.json(atKeyPath: "disableThreadPerformanceChecker") ?? TargetScheme.disableThreadPerformanceCheckerDefault
|
||||
buildImplicitDependencies = jsonDictionary.json(atKeyPath: "buildImplicitDependencies") ?? TargetScheme.buildImplicitDependenciesDefault
|
||||
commandLineArguments = jsonDictionary.json(atKeyPath: "commandLineArguments") ?? [:]
|
||||
environmentVariables = try XCScheme.EnvironmentVariable.parseAll(jsonDictionary: jsonDictionary)
|
||||
@@ -142,6 +147,10 @@ extension TargetScheme: JSONEncodable {
|
||||
dict["stopOnEveryMainThreadCheckerIssue"] = stopOnEveryMainThreadCheckerIssue
|
||||
}
|
||||
|
||||
if disableThreadPerformanceChecker != TargetScheme.disableThreadPerformanceCheckerDefault {
|
||||
dict["disableThreadPerformanceChecker"] = disableThreadPerformanceChecker
|
||||
}
|
||||
|
||||
if buildImplicitDependencies != TargetScheme.buildImplicitDependenciesDefault {
|
||||
dict["buildImplicitDependencies"] = buildImplicitDependencies
|
||||
}
|
||||
|
||||
@@ -343,6 +343,7 @@ public class SchemeGenerator {
|
||||
enableGPUFrameCaptureMode: scheme.run?.enableGPUFrameCaptureMode ?? XCScheme.LaunchAction.defaultGPUFrameCaptureMode,
|
||||
enableGPUValidationMode: scheme.run?.enableGPUValidationMode ?? XCScheme.LaunchAction.defaultGPUValidationMode,
|
||||
disableMainThreadChecker: scheme.run?.disableMainThreadChecker ?? Scheme.Run.disableMainThreadCheckerDefault,
|
||||
disablePerformanceAntipatternChecker: scheme.run?.disableThreadPerformanceChecker ?? Scheme.Run.disableThreadPerformanceCheckerDefault,
|
||||
stopOnEveryMainThreadCheckerIssue: scheme.run?.stopOnEveryMainThreadCheckerIssue ?? Scheme.Run.stopOnEveryMainThreadCheckerIssueDefault,
|
||||
commandlineArguments: launchCommandLineArgs,
|
||||
environmentVariables: launchVariables,
|
||||
@@ -468,6 +469,7 @@ extension Scheme {
|
||||
environmentVariables: targetScheme.environmentVariables,
|
||||
disableMainThreadChecker: targetScheme.disableMainThreadChecker,
|
||||
stopOnEveryMainThreadCheckerIssue: targetScheme.stopOnEveryMainThreadCheckerIssue,
|
||||
disableThreadPerformanceChecker: targetScheme.disableThreadPerformanceChecker,
|
||||
language: targetScheme.language,
|
||||
region: targetScheme.region,
|
||||
storeKitConfiguration: targetScheme.storeKitConfiguration
|
||||
|
||||
@@ -561,6 +561,7 @@ class ProjectSpecTests: XCTestCase {
|
||||
storeKitConfiguration: "Configuration.storekit",
|
||||
disableMainThreadChecker: true,
|
||||
stopOnEveryMainThreadCheckerIssue: false,
|
||||
disableThreadPerformanceChecker: true,
|
||||
commandLineArguments: ["foo": true],
|
||||
environmentVariables: [XCScheme.EnvironmentVariable(variable: "environmentVariable",
|
||||
value: "bar",
|
||||
@@ -601,6 +602,7 @@ class ProjectSpecTests: XCTestCase {
|
||||
configVariants: ["foo"],
|
||||
gatherCoverageData: true,
|
||||
disableMainThreadChecker: true,
|
||||
disableThreadPerformanceChecker: true,
|
||||
commandLineArguments: ["foo": true],
|
||||
environmentVariables: [XCScheme.EnvironmentVariable(variable: "environmentVariable",
|
||||
value: "bar",
|
||||
|
||||
@@ -869,6 +869,7 @@ class SpecLoadingTests: XCTestCase {
|
||||
"region": "US",
|
||||
"disableMainThreadChecker": true,
|
||||
"stopOnEveryMainThreadCheckerIssue": true,
|
||||
"disableThreadPerformanceChecker": true,
|
||||
"environmentVariables": [
|
||||
"TEST_VAR": "TEST_VAL",
|
||||
],
|
||||
@@ -903,6 +904,7 @@ class SpecLoadingTests: XCTestCase {
|
||||
region: "US",
|
||||
disableMainThreadChecker: true,
|
||||
stopOnEveryMainThreadCheckerIssue: true,
|
||||
disableThreadPerformanceChecker: true,
|
||||
commandLineArguments: ["ENV1": true],
|
||||
environmentVariables: [XCScheme.EnvironmentVariable(variable: "TEST_VAR", value: "TEST_VAL", enabled: true)],
|
||||
preActions: [.init(name: "Do Thing", script: "dothing", settingsTarget: "test")],
|
||||
@@ -941,6 +943,7 @@ class SpecLoadingTests: XCTestCase {
|
||||
"launchAutomaticallySubstyle": 2,
|
||||
"enableGPUFrameCaptureMode": "disabled",
|
||||
"storeKitConfiguration": "Configuration.storekit",
|
||||
"disableThreadPerformanceChecker": true,
|
||||
],
|
||||
"test": [
|
||||
"config": "debug",
|
||||
@@ -995,6 +998,7 @@ class SpecLoadingTests: XCTestCase {
|
||||
let expectedRun = Scheme.Run(
|
||||
config: "debug",
|
||||
enableGPUFrameCaptureMode: .disabled,
|
||||
disableThreadPerformanceChecker: true,
|
||||
launchAutomaticallySubstyle: "2",
|
||||
storeKitConfiguration: "Configuration.storekit"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user