From 9c22e654fd928b5ab8738afa96bbddb4dab2659b Mon Sep 17 00:00:00 2001 From: DimitarTachev Date: Fri, 20 Sep 2019 17:36:27 +0300 Subject: [PATCH 1/2] fix: pass the skipNativePrepare value from the deploy controller --- lib/controllers/deploy-controller.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/controllers/deploy-controller.ts b/lib/controllers/deploy-controller.ts index 8c51ac20c3..bffb70425a 100644 --- a/lib/controllers/deploy-controller.ts +++ b/lib/controllers/deploy-controller.ts @@ -11,7 +11,11 @@ export class DeployController { const executeAction = async (device: Mobile.IDevice) => { const deviceDescriptor = _.find(deviceDescriptors, dd => dd.identifier === device.deviceInfo.identifier); - await this.$prepareController.prepare(deviceDescriptor.buildData); + const prepareData = { + ...deviceDescriptor.buildData, + nativePrepare: { skipNativePrepare: !!deviceDescriptor.skipNativePrepare } + }; + await this.$prepareController.prepare(prepareData); const packageFilePath = await deviceDescriptor.buildAction(); await this.$deviceInstallAppService.installOnDevice(device, { ...deviceDescriptor.buildData, buildForDevice: !device.isEmulator }, packageFilePath); }; From 1e17777946550e4cef3c694824ee51e1290c18e0 Mon Sep 17 00:00:00 2001 From: DimitarTachev Date: Fri, 20 Sep 2019 17:37:21 +0300 Subject: [PATCH 2/2] fix: set the env.skipSnapshotTools based on the skipNativeValue in order to avoid local snapshots along with their requirements during cloud builds --- lib/services/webpack/webpack-compiler-service.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/services/webpack/webpack-compiler-service.ts b/lib/services/webpack/webpack-compiler-service.ts index 2a6a1bb378..80457719b3 100644 --- a/lib/services/webpack/webpack-compiler-service.ts +++ b/lib/services/webpack/webpack-compiler-service.ts @@ -174,11 +174,18 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp Object.assign(envData, appPath && { appPath }, - appResourcesPath && { appResourcesPath }, + appResourcesPath && { appResourcesPath } ); envData.verbose = envData.verbose || this.$logger.isVerbose(); envData.production = envData.production || prepareData.release; + // The snapshot generation is wrongly located in the Webpack plugin. + // It should be moved in the Native Prepare of the CLI or a Gradle task in the Runtime. + // As a workaround, we skip the mksnapshot, xxd and android-ndk calls based on skipNativePrepare. + // In this way the plugin will prepare only the snapshot JS entry without any native prepare and + // we will able to execute cloud builds with snapshot without having any local snapshot or Docker setup. + // TODO: Remove this flag when we remove the native part from the plugin. + envData.skipSnapshotTools = prepareData.nativePrepare && prepareData.nativePrepare.skipNativePrepare; if (prepareData.env && (prepareData.env.sourceMap === false || prepareData.env.sourceMap === 'false')) { delete envData.sourceMap;