Skip to content
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
12 changes: 12 additions & 0 deletions lib/services/ios/xcodebuild-args-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,18 @@ export class XcodebuildArgsService implements IXcodebuildArgsService {
extraArgs.push(`${swiftUIBootProperty}=${swiftUIBootValue}`);
}

// Swift macro/compiler-plugin SPM targets must be code-signed with a
// development team when building for a device. Pass DEVELOPMENT_TEAM as a
// command-line build setting so it applies to SPM package targets too.
const developmentTeamProperty = "DEVELOPMENT_TEAM";
const developmentTeamValue = this.$xcconfigService.readPropertyValue(
BUILD_SETTINGS_FILE_PATH,
developmentTeamProperty,
);
if (developmentTeamValue) {
extraArgs.push(`${developmentTeamProperty}=${developmentTeamValue}`);
}

if (this.$fs.exists(xcworkspacePath)) {
return ["-workspace", xcworkspacePath, ...extraArgs];
}
Expand Down
18 changes: 18 additions & 0 deletions test/services/ios/xcodebuild-args-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,24 @@ describe("xcodebuildArgsService", () => {
assert.include(actualArgs, "SWIFT_ENABLE_EXPLICIT_MODULES=YES");
assert.notInclude(actualArgs, "SWIFT_ENABLE_EXPLICIT_MODULES=NO");
});

it("should include DEVELOPMENT_TEAM from build.xcconfig", () => {
const injector = createTestInjector({
logLevel: "INFO",
hasProjectWorkspace: false,
buildXcconfigContent: "DEVELOPMENT_TEAM = TEAM123",
});
const xcodebuildArgsService: IXcodebuildArgsService = injector.resolve(
"xcodebuildArgsService",
);

const actualArgs = xcodebuildArgsService.getXcodeProjectArgs(
<any>{ projectRoot, normalizedPlatformName },
<any>{ projectName, appResourcesDirectoryPath },
);

assert.include(actualArgs, "DEVELOPMENT_TEAM=TEAM123");
});
});

describe("getBuildForSimulatorArgs", () => {
Expand Down