From 85b910c4b957b3571ffd1132c40d3b4fc45bf958 Mon Sep 17 00:00:00 2001 From: Dimitar Kerezov Date: Mon, 23 Oct 2017 15:33:34 +0300 Subject: [PATCH] Pass additional env flags to webpack --- lib/commands/build-command-helper.ts | 12 ++++++++++-- lib/definitions/cloud-build-service.d.ts | 2 +- lib/services/cloud-build-service.ts | 11 ++++++++++- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/lib/commands/build-command-helper.ts b/lib/commands/build-command-helper.ts index ca89c39..50a1fb2 100644 --- a/lib/commands/build-command-helper.ts +++ b/lib/commands/build-command-helper.ts @@ -32,7 +32,14 @@ export class BuildCommandHelper implements IBuildCommandHelper { } const pathToProvision = this.$options.provision ? path.resolve(this.$options.provision) : ""; - const projectSettings = { projectDir: this.$projectData.projectDir, projectId: this.$projectData.projectId, projectName: this.$projectData.projectName, nativescriptData, clean: this.$options.clean }; + const projectSettings: IProjectSettings = { + nativescriptData, + projectDir: this.$projectData.projectDir, + projectId: this.$projectData.projectId, + projectName: this.$projectData.projectName, + clean: this.$options.clean, + env: this.$options.env + }; const buildConfiguration = this.$options.release ? CLOUD_BUILD_CONFIGURATIONS.RELEASE : CLOUD_BUILD_CONFIGURATIONS.DEBUG; return { projectSettings, @@ -82,7 +89,8 @@ export class BuildCommandHelper implements IBuildCommandHelper { keyStoreAlias: this.$options.keyStoreAlias, keyStoreAliasPassword: this.$options.keyStoreAliasPassword, keyStorePassword: this.$options.keyStorePassword, - keyStorePath: this.$options.keyStorePath + keyStorePath: this.$options.keyStorePath, + env: this.$options.env }, this.$options.platformTemplate); } else { const buildData = this.getCloudBuildData(platform); diff --git a/lib/definitions/cloud-build-service.d.ts b/lib/definitions/cloud-build-service.d.ts index 58cc761..b246eaf 100644 --- a/lib/definitions/cloud-build-service.d.ts +++ b/lib/definitions/cloud-build-service.d.ts @@ -149,7 +149,7 @@ interface IItmsPlistOptions { /** * Describes the project settings required for different operations. */ -interface IProjectSettings { +interface IProjectSettings extends IEnvOptions { /** * The directory where the project is located. This should be the path to the directory where application's package.json is located. */ diff --git a/lib/services/cloud-build-service.ts b/lib/services/cloud-build-service.ts index 7ba2db3..5eb6da6 100644 --- a/lib/services/cloud-build-service.ts +++ b/lib/services/cloud-build-service.ts @@ -296,7 +296,16 @@ export class CloudBuildService extends CloudService implements ICloudBuildServic }; this.emitStepChanged(buildId, constants.BUILD_STEP_NAME.PREPARE, constants.BUILD_STEP_PROGRESS.START); - await this.$platformService.preparePlatform(platform, appFilesUpdaterOptions, null, projectData, config, [], { skipNativePrepare: true }); + await this.$platformService.preparePlatform({ + platform, + appFilesUpdaterOptions, + projectData, + config, + filesToSync: [], + nativePrepare: { skipNativePrepare: true }, + platformTemplate: null, + env: projectSettings.env + }); this.emitStepChanged(buildId, constants.BUILD_STEP_NAME.PREPARE, constants.BUILD_STEP_PROGRESS.END); }