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

RNMT-5885 change pods configuration build dir #3

Merged
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
6 changes: 4 additions & 2 deletions bin/templates/scripts/cordova/lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ function getXcodeBuildArgs (projectName, projectPath, configuration, isDevice, b
];
buildActions = ['archive'];
settings = [
customArgs.configuration_build_dir || `CONFIGURATION_BUILD_DIR=${path.join(projectPath, 'build', 'device')}`,
customArgs.shared_precomps_dir || `SHARED_PRECOMPS_DIR=${path.join(projectPath, 'build', 'sharedpch')}`
];
// Add other matched flags to otherFlags to let xcodebuild present an appropriate error.
Expand All @@ -348,7 +347,6 @@ function getXcodeBuildArgs (projectName, projectPath, configuration, isDevice, b
];
buildActions = ['build'];
settings = [
customArgs.configuration_build_dir || `CONFIGURATION_BUILD_DIR=${path.join(projectPath, 'build', 'emulator')}`,
customArgs.shared_precomps_dir || `SHARED_PRECOMPS_DIR=${path.join(projectPath, 'build', 'sharedpch')}`
];
// Add other matched flags to otherFlags to let xcodebuild present an appropriate error.
Expand All @@ -358,6 +356,10 @@ function getXcodeBuildArgs (projectName, projectPath, configuration, isDevice, b
}
}

if (customArgs.configuration_build_dir) {
settings.push(customArgs.configuration_build_dir);
}

return options.concat(buildActions).concat(settings).concat(customArgs.otherFlags);
}

Expand Down
22 changes: 8 additions & 14 deletions tests/spec/unit/build.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ describe('build', () => {
'-archivePath',
'TestProjectName.xcarchive',
'archive',
`CONFIGURATION_BUILD_DIR=${path.join(testProjectPath, 'build', 'device')}`,
`SHARED_PRECOMPS_DIR=${path.join(testProjectPath, 'build', 'sharedpch')}`
]);
expect(args.length).toEqual(13);
expect(args.length).toEqual(12);
});

it('should generate appropriate args if buildFlags are passed in', () => {
Expand Down Expand Up @@ -78,8 +77,8 @@ describe('build', () => {
'-archivePath',
'TestArchivePathFlag',
'archive',
'CONFIGURATION_BUILD_DIR=TestConfigBuildDirFlag',
'SHARED_PRECOMPS_DIR=TestSharedPrecompsDirFlag'
'SHARED_PRECOMPS_DIR=TestSharedPrecompsDirFlag',
'CONFIGURATION_BUILD_DIR=TestConfigBuildDirFlag'
]);
expect(args.length).toEqual(13);
});
Expand All @@ -99,10 +98,9 @@ describe('build', () => {
'-archivePath',
'TestProjectName.xcarchive',
'archive',
`CONFIGURATION_BUILD_DIR=${path.join(testProjectPath, 'build', 'device')}`,
`SHARED_PRECOMPS_DIR=${path.join(testProjectPath, 'build', 'sharedpch')}`
]);
expect(args.length).toEqual(13);
expect(args.length).toEqual(12);
});

it('should generate appropriate args for simulator', () => {
Expand All @@ -120,10 +118,9 @@ describe('build', () => {
'-destination',
'platform=iOS Simulator,name=iPhone 5s',
'build',
`CONFIGURATION_BUILD_DIR=${path.join(testProjectPath, 'build', 'emulator')}`,
`SHARED_PRECOMPS_DIR=${path.join(testProjectPath, 'build', 'sharedpch')}`
]);
expect(args.length).toEqual(13);
expect(args.length).toEqual(12);
});

it('should add matched flags that are not overriding for device', () => {
Expand All @@ -143,12 +140,11 @@ describe('build', () => {
'-archivePath',
'TestProjectName.xcarchive',
'archive',
`CONFIGURATION_BUILD_DIR=${path.join(testProjectPath, 'build', 'device')}`,
`SHARED_PRECOMPS_DIR=${path.join(testProjectPath, 'build', 'sharedpch')}`,
'-sdk',
'TestSdkFlag'
]);
expect(args.length).toEqual(15);
expect(args.length).toEqual(14);
});

it('should add matched flags that are not overriding for simulator', () => {
Expand All @@ -168,12 +164,11 @@ describe('build', () => {
'-destination',
'platform=iOS Simulator,name=iPhone 5s',
'build',
`CONFIGURATION_BUILD_DIR=${path.join(testProjectPath, 'build', 'emulator')}`,
`SHARED_PRECOMPS_DIR=${path.join(testProjectPath, 'build', 'sharedpch')}`,
'-archivePath',
'TestArchivePathFlag'
]);
expect(args.length).toEqual(15);
expect(args.length).toEqual(14);
});

it('should generate appropriate args for automatic provisioning', () => {
Expand All @@ -192,10 +187,9 @@ describe('build', () => {
'TestProjectName.xcarchive',
'-allowProvisioningUpdates',
'archive',
`CONFIGURATION_BUILD_DIR=${path.join(testProjectPath, 'build', 'device')}`,
`SHARED_PRECOMPS_DIR=${path.join(testProjectPath, 'build', 'sharedpch')}`
]);
expect(args.length).toEqual(14);
expect(args.length).toEqual(13);
});
});

Expand Down