Skip to content

Commit 3bb46c1

Browse files
committed
Use REXML instead, default back to no key in xcheme, aka, enabled
1 parent d9b5a1a commit 3bb46c1

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

example/app.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
"presentationStyle": "modal"
1414
}
1515
],
16-
"ios": {
17-
"metalAPIValidation": true
18-
},
1916
"resources": {
2017
"android": [
2118
"dist/res",

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,11 +1712,11 @@ EXTERNAL SOURCES:
17121712

17131713
SPEC CHECKSUMS:
17141714
boost: 4cb898d0bf20404aab1850c656dcea009429d6c1
1715-
DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953
1715+
DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5
17161716
Example-Tests: fc629729804712c34ae6c28b9fc1c45619f6636d
17171717
FBLazyVector: 430e10366de01d1e3d57374500b1b150fe482e6d
17181718
fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120
1719-
glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2
1719+
glog: 69ef571f3de08433d766d614c73a9838a06bf7eb
17201720
RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740
17211721
RCTDeprecation: 726d24248aeab6d7180dac71a936bbca6a994ed1
17221722
RCTRequired: a94e7febda6db0345d207e854323c37e3a31d93b

ios/ReactTestApp.xcodeproj/xcshareddata/xcschemes/ReactTestApp.xcscheme

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
ignoresPersistentStateOnLaunch = "NO"
6060
debugDocumentVersioning = "YES"
6161
debugServiceExtension = "internal"
62-
enableGPUValidationMode = "1"
6362
allowLocationSimulation = "YES">
6463
<BuildableProductRunnable
6564
runnableDebuggingMode = "0">

ios/xcode.rb

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
require 'rexml/document'
2+
require 'rexml/xpath'
3+
14
IPHONEOS_DEPLOYMENT_TARGET = 'IPHONEOS_DEPLOYMENT_TARGET'.freeze
25
MACOSX_DEPLOYMENT_TARGET = 'MACOSX_DEPLOYMENT_TARGET'.freeze
36
XROS_DEPLOYMENT_TARGET = 'XROS_DEPLOYMENT_TARGET'.freeze
@@ -25,13 +28,16 @@ def configure_xcschemes!(xcschemes_path, project_root, target_platform, name)
2528
xcscheme = File.join(xcschemes_path, "ReactTestApp.xcscheme")
2629
metal_api_validation = platform_config('metalAPIValidation', project_root, target_platform)
2730

28-
# Oddly enough, to disable Metal API validation, we need to remove the `enableGPUValidationMode` key from the xcscheme file.
29-
# A default Xcode project does not have this key, so lets follow that pattern and only add it if it is enabled.
30-
if metal_api_validation.nil? || metal_api_validation == true
31+
32+
# Oddly enough, to disable Metal API validation, we need to add `enableGPUValidationMode = "1"` to the xcscheme Launch Action.
33+
if metal_api_validation == false
3134
xcscheme_content = File.read(xcscheme)
32-
new_content = xcscheme_content.gsub(/^\s*enableGPUValidationMode\s*=\s*"1"\s*$/, '')
33-
File.write(xcscheme, new_content)
34-
return
35+
doc = REXML::Document.new(xcscheme_content)
36+
doc.root.elements['LaunchAction'].attributes['enableGPUValidationMode'] = '1'
37+
38+
File.open(xcscheme, 'w') do |file|
39+
doc.write(file)
40+
end
3541
end
3642

3743
# Make a copy of the ReactTestApp.xcscheme file with the app name for convenience.

0 commit comments

Comments
 (0)