Skip to content

Commit cb14f6c

Browse files
yyosifovdtopuzov
authored andcommitted
Adding configuration build parameter to the archive functionality (#2695)
1 parent e743965 commit cb14f6c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lib/services/ios-project-service.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,11 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
176176
* Archive the Xcode project to .xcarchive.
177177
* Returns the path to the .xcarchive.
178178
*/
179-
public async archive(projectData: IProjectData, options?: { archivePath?: string }): Promise<string> {
179+
public async archive(projectData: IProjectData, buildConfig?: IBuildConfig, options?: { archivePath?: string }): Promise<string> {
180180
let projectRoot = this.getPlatformData(projectData).projectRoot;
181181
let archivePath = options && options.archivePath ? path.resolve(options.archivePath) : path.join(projectRoot, "/build/archive/", projectData.projectName + ".xcarchive");
182-
let args = ["archive", "-archivePath", archivePath]
182+
let args = ["archive", "-archivePath", archivePath, "-configuration",
183+
(!buildConfig || buildConfig.release) ? "Release" : "Debug" ]
183184
.concat(this.xcbuildProjectArgs(projectRoot, projectData, "scheme"));
184185
await this.$childProcess.spawnFromEvent("xcodebuild", args, "exit", { stdio: 'inherit' });
185186
return archivePath;
@@ -456,7 +457,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
456457
}
457458

458459
private async createIpa(projectRoot: string, projectData: IProjectData, buildConfig: IBuildConfig): Promise<string> {
459-
let xarchivePath = await this.archive(projectData);
460+
let xarchivePath = await this.archive(projectData, buildConfig);
460461
let exportFileIpa = await this.exportDevelopmentArchive(projectData,
461462
buildConfig,
462463
{

test/ios-project-service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ describe("iOSProjectService", () => {
159159
return {
160160
run: async (): Promise<void> => {
161161
if (hasCustomArchivePath) {
162-
resultArchivePath = await iOSProjectService.archive(projectData, { archivePath: options.archivePath });
162+
resultArchivePath = await iOSProjectService.archive(projectData, null, { archivePath: options.archivePath });
163163
} else {
164-
resultArchivePath = await iOSProjectService.archive(projectData);
164+
resultArchivePath = await iOSProjectService.archive(projectData, null);
165165
}
166166
},
167167
assert: () => {

0 commit comments

Comments
 (0)