Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Resolve Xcode stale files warnings #1496

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ function getXcodeBuildArgs (projectPath, configuration, emulatorTarget, buildCon
}

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

if (customArgs.configuration_build_dir) {
settings.push(customArgs.configuration_build_dir);
Expand Down
14 changes: 14 additions & 0 deletions templates/project/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
"DEPLOYMENT_LOCATION[sdk=iphonesimulator*]" = YES;
"DEPLOYMENT_LOCATION[sdk=xrsimulator*]" = YES;
"DEPLOYMENT_LOCATION[sdk=macosx*]" = YES;
DSTROOT = "$(SRCROOT)/build";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
Expand All @@ -333,6 +337,9 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
"INSTALL_PATH[sdk=iphonesimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
"INSTALL_PATH[sdk=xrsimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
"INSTALL_PATH[sdk=macosx*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
Expand Down Expand Up @@ -383,6 +390,10 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
"DEPLOYMENT_LOCATION[sdk=iphonesimulator*]" = YES;
"DEPLOYMENT_LOCATION[sdk=xrsimulator*]" = YES;
"DEPLOYMENT_LOCATION[sdk=macosx*]" = YES;
DSTROOT = "$(SRCROOT)/build";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
Expand All @@ -394,6 +405,9 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
"INSTALL_PATH[sdk=iphonesimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
"INSTALL_PATH[sdk=xrsimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
"INSTALL_PATH[sdk=macosx*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = NO;
Expand Down
16 changes: 6 additions & 10 deletions tests/spec/unit/build.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,9 @@ describe('build', () => {
'iphonesimulator',
'-destination',
'platform=iOS Simulator,name=iPhone 5s',
'build',
`SYMROOT=${path.join(testProjectPath, 'build')}`
'build'
]);
expect(args.length).toEqual(12);
expect(args.length).toEqual(11);
});

it('should generate appropriate args for simulator if buildFlags are passed in', () => {
Expand All @@ -139,13 +138,12 @@ describe('build', () => {
'-destination',
'TestDestinationFlag',
'build',
`SYMROOT=${path.join(testProjectPath, 'build')}`,
'CONFIGURATION_BUILD_DIR=TestConfigBuildDirFlag',
'SHARED_PRECOMPS_DIR=TestSharedPrecompsDirFlag',
'-archivePath',
'TestArchivePathFlag'
]);
expect(args.length).toEqual(16);
expect(args.length).toEqual(15);
});

it('should add matched flags that are not overriding for device', () => {
Expand Down Expand Up @@ -186,11 +184,10 @@ describe('build', () => {
'-destination',
'platform=iOS Simulator,name=iPhone 5s',
'build',
`SYMROOT=${path.join(testProjectPath, 'build')}`,
'-archivePath',
'TestArchivePathFlag'
]);
expect(args.length).toEqual(14);
expect(args.length).toEqual(13);
});

it('should generate appropriate args for automatic provisioning', () => {
Expand Down Expand Up @@ -241,10 +238,9 @@ describe('build', () => {
'TestConfiguration',
'-destination',
'generic/platform=macOS,variant=Mac Catalyst',
'build',
`SYMROOT=${path.join(testProjectPath, 'build')}`
'build'
]);
expect(args.length).toEqual(10);
expect(args.length).toEqual(9);
});
});

Expand Down