Skip to content

Commit 2f0e19e

Browse files
authored
fix: Resolve Xcode stale files warnings (#1496)
Closes GH-1372.
1 parent ff69ddd commit 2f0e19e

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

lib/build.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ function getXcodeBuildArgs (projectPath, configuration, emulatorTarget, buildCon
376376
}
377377

378378
buildActions = ['build'];
379-
settings = [`SYMROOT=${path.join(projectPath, 'build')}`];
379+
settings = [];
380380

381381
if (customArgs.configuration_build_dir) {
382382
settings.push(customArgs.configuration_build_dir);

templates/project/App.xcodeproj/project.pbxproj

+14
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,10 @@
316316
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
317317
COPY_PHASE_STRIP = NO;
318318
DEBUG_INFORMATION_FORMAT = dwarf;
319+
"DEPLOYMENT_LOCATION[sdk=iphonesimulator*]" = YES;
320+
"DEPLOYMENT_LOCATION[sdk=xrsimulator*]" = YES;
321+
"DEPLOYMENT_LOCATION[sdk=macosx*]" = YES;
322+
DSTROOT = "$(SRCROOT)/build";
319323
ENABLE_STRICT_OBJC_MSGSEND = YES;
320324
ENABLE_TESTABILITY = YES;
321325
ENABLE_USER_SCRIPT_SANDBOXING = NO;
@@ -333,6 +337,9 @@
333337
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
334338
GCC_WARN_UNUSED_FUNCTION = YES;
335339
GCC_WARN_UNUSED_VARIABLE = YES;
340+
"INSTALL_PATH[sdk=iphonesimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
341+
"INSTALL_PATH[sdk=xrsimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
342+
"INSTALL_PATH[sdk=macosx*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
336343
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
337344
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
338345
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
@@ -383,6 +390,10 @@
383390
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
384391
COPY_PHASE_STRIP = NO;
385392
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
393+
"DEPLOYMENT_LOCATION[sdk=iphonesimulator*]" = YES;
394+
"DEPLOYMENT_LOCATION[sdk=xrsimulator*]" = YES;
395+
"DEPLOYMENT_LOCATION[sdk=macosx*]" = YES;
396+
DSTROOT = "$(SRCROOT)/build";
386397
ENABLE_NS_ASSERTIONS = NO;
387398
ENABLE_STRICT_OBJC_MSGSEND = YES;
388399
ENABLE_USER_SCRIPT_SANDBOXING = NO;
@@ -394,6 +405,9 @@
394405
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
395406
GCC_WARN_UNUSED_FUNCTION = YES;
396407
GCC_WARN_UNUSED_VARIABLE = YES;
408+
"INSTALL_PATH[sdk=iphonesimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
409+
"INSTALL_PATH[sdk=xrsimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
410+
"INSTALL_PATH[sdk=macosx*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
397411
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
398412
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
399413
MTL_ENABLE_DEBUG_INFO = NO;

tests/spec/unit/build.spec.js

+6-10
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,9 @@ describe('build', () => {
109109
'iphonesimulator',
110110
'-destination',
111111
'platform=iOS Simulator,name=iPhone 5s',
112-
'build',
113-
`SYMROOT=${path.join(testProjectPath, 'build')}`
112+
'build'
114113
]);
115-
expect(args.length).toEqual(12);
114+
expect(args.length).toEqual(11);
116115
});
117116

118117
it('should generate appropriate args for simulator if buildFlags are passed in', () => {
@@ -139,13 +138,12 @@ describe('build', () => {
139138
'-destination',
140139
'TestDestinationFlag',
141140
'build',
142-
`SYMROOT=${path.join(testProjectPath, 'build')}`,
143141
'CONFIGURATION_BUILD_DIR=TestConfigBuildDirFlag',
144142
'SHARED_PRECOMPS_DIR=TestSharedPrecompsDirFlag',
145143
'-archivePath',
146144
'TestArchivePathFlag'
147145
]);
148-
expect(args.length).toEqual(16);
146+
expect(args.length).toEqual(15);
149147
});
150148

151149
it('should add matched flags that are not overriding for device', () => {
@@ -186,11 +184,10 @@ describe('build', () => {
186184
'-destination',
187185
'platform=iOS Simulator,name=iPhone 5s',
188186
'build',
189-
`SYMROOT=${path.join(testProjectPath, 'build')}`,
190187
'-archivePath',
191188
'TestArchivePathFlag'
192189
]);
193-
expect(args.length).toEqual(14);
190+
expect(args.length).toEqual(13);
194191
});
195192

196193
it('should generate appropriate args for automatic provisioning', () => {
@@ -241,10 +238,9 @@ describe('build', () => {
241238
'TestConfiguration',
242239
'-destination',
243240
'generic/platform=macOS,variant=Mac Catalyst',
244-
'build',
245-
`SYMROOT=${path.join(testProjectPath, 'build')}`
241+
'build'
246242
]);
247-
expect(args.length).toEqual(10);
243+
expect(args.length).toEqual(9);
248244
});
249245
});
250246

0 commit comments

Comments
 (0)