Skip to content

Commit

Permalink
Fix ordering of diagnostics scheme options (#704)
Browse files Browse the repository at this point in the history
- The ordering for the runtime checker (main thread, thread performance) were incorrect
- This aligns the order with the order created by Xcode

Test Plan:

- Verify order matches that created by Xcode

e.g.

```xml
<TestAction
      buildConfiguration = "Debug"
      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
      customLLDBInitFile = "/bar/foo"
      shouldUseLaunchSchemeArgsEnv = "YES"
      disableMainThreadChecker = "YES"
      language = "en"
      region = "GB"
      localizableStringsDataGatheringEnabled = "YES">
      <Testables>
      </Testables>
   </TestAction>
   <LaunchAction
      buildConfiguration = "Debug"
      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
      customLLDBInitFile = "/foo/bar"
      disableMainThreadChecker = "YES"
      disablePerformanceAntipatternChecker = "YES"
      launchStyle = "0"
      useCustomWorkingDirectory = "NO"
      ignoresPersistentStateOnLaunch = "NO"
      debugDocumentVersioning = "YES"
      debugServiceExtension = "internal"
      allowLocationSimulation = "YES">
      <BuildableProductRunnable
         runnableDebuggingMode = "0">
         <BuildableReference
            BuildableIdentifier = "primary"
            BlueprintIdentifier = "FB9BD24F2872C2BB00F272D3"
            BuildableName = "AppWithExts.app"
            BlueprintName = "AppWithExts"
            ReferencedContainer = "container:AppWithExts.xcodeproj">
         </BuildableReference>
      </BuildableProductRunnable>
   </LaunchAction>
```
  • Loading branch information
kwridan authored Jul 14, 2022
1 parent 490057a commit 099c64c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,19 @@ let attributesOrder: [String: [String]] = [
"selectedLauncherIdentifier",
"customLLDBInitFile",
"language",
"shouldUseLaunchSchemeArgsEnv",
"disableMainThreadChecker",
"region",
"codeCoverageEnabled",
"onlyGenerateCoverageForSpecifiedTargets",
"shouldUseLaunchSchemeArgsEnv",
],
"LaunchAction": [
"buildConfiguration",
"selectedDebuggerIdentifier",
"selectedLauncherIdentifier",
"customLLDBInitFile",
"disableMainThreadChecker",
"disablePerformanceAntipatternChecker",
"language",
"region",
"launchStyle",
Expand Down
15 changes: 12 additions & 3 deletions Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class AEXML_XcodeFormatTests: XCTestCase {
buildConfiguration = "Debug"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
customLLDBInitFile = "$(BAZEL_LLDB_INIT)"
disableMainThreadChecker = "YES"
disablePerformanceAntipatternChecker = "YES"
launchStyle = "0"
askForAppToLaunch = "YES"
allowLocationSimulation = "YES">
Expand All @@ -40,7 +42,8 @@ class AEXML_XcodeFormatTests: XCTestCase {
buildConfiguration = "Debug"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
customLLDBInitFile = "$(BAZEL_LLDB_INIT)"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
disableMainThreadChecker = "YES">
</TestAction>
"""

Expand Down Expand Up @@ -98,7 +101,9 @@ class AEXML_XcodeFormatTests: XCTestCase {
"customLLDBInitFile": "$(BAZEL_LLDB_INIT)",
"launchStyle": "0",
"askForAppToLaunch": "YES",
"allowLocationSimulation": "YES"
"allowLocationSimulation": "YES",
"disableMainThreadChecker": "YES",
"disablePerformanceAntipatternChecker": "YES",
]
)
}
Expand All @@ -108,6 +113,8 @@ class AEXML_XcodeFormatTests: XCTestCase {
expectedXML: expectedLaunchActionXml.cleaned,
childName: "LaunchAction",
attributes: [
"disableMainThreadChecker": "YES",
"disablePerformanceAntipatternChecker": "YES",
"customLLDBInitFile": "$(BAZEL_LLDB_INIT)",
"allowLocationSimulation": "YES",
"buildConfiguration": "Debug",
Expand All @@ -126,7 +133,8 @@ class AEXML_XcodeFormatTests: XCTestCase {
"buildConfiguration": "Debug",
"customLLDBInitFile": "$(BAZEL_LLDB_INIT)",
"selectedLauncherIdentifier": "Xcode.DebuggerFoundation.Launcher.LLDB",
"shouldUseLaunchSchemeArgsEnv": "YES"
"shouldUseLaunchSchemeArgsEnv": "YES",
"disableMainThreadChecker": "YES",
]
)
}
Expand All @@ -136,6 +144,7 @@ class AEXML_XcodeFormatTests: XCTestCase {
expectedXML: expectedTestActionXml.cleaned,
childName: "TestAction",
attributes: [
"disableMainThreadChecker": "YES",
"shouldUseLaunchSchemeArgsEnv": "YES",
"buildConfiguration": "Debug",
"customLLDBInitFile": "$(BAZEL_LLDB_INIT)",
Expand Down

0 comments on commit 099c64c

Please sign in to comment.