Skip to content

Commit 199b293

Browse files
Move skipNativePrepare to deviceDescriptors (#2990)
* Move skipNativePrepare to deviceDescriptors Each device can use different build types - cloud or local. So the `skipNativePrepare` option should be passed per each device, not for the whole livesync operation. * Validate native plugin prepare only when skipNativePrepare is not true
1 parent ac8cf2f commit 199b293

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

lib/definitions/livesync.d.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ interface ILiveSyncDeviceInfo {
8888
* In case it is not passed, the default output for local builds will be used.
8989
*/
9090
outputPath?: string;
91+
92+
/**
93+
* Whether to skip preparing the native platform.
94+
*/
95+
skipNativePrepare?: boolean;
9196
}
9297

9398
/**
@@ -120,11 +125,6 @@ interface ILiveSyncInfo {
120125
* Forces a build before the initial livesync.
121126
*/
122127
clean?: boolean;
123-
124-
/**
125-
* Whether to skip preparing the native platform.
126-
*/
127-
skipNativePrepare?: boolean;
128128
}
129129

130130
interface ILatestAppPackageInstalledSettings extends IDictionary<IDictionary<boolean>> { /* empty */ }

lib/services/livesync/livesync-service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export class LiveSyncService extends EventEmitter implements ILiveSyncService {
237237
deviceBuildInfoDescriptor,
238238
liveSyncData,
239239
settings
240-
}, { skipNativePrepare: liveSyncData.skipNativePrepare });
240+
}, { skipNativePrepare: deviceBuildInfoDescriptor.skipNativePrepare });
241241

242242
const liveSyncResultInfo = await this.getLiveSyncService(platform).fullSync({
243243
projectData, device,
@@ -339,7 +339,7 @@ export class LiveSyncService extends EventEmitter implements ILiveSyncService {
339339
deviceBuildInfoDescriptor,
340340
settings: latestAppPackageInstalledSettings,
341341
modifiedFiles: allModifiedFiles
342-
}, { skipNativePrepare: liveSyncData.skipNativePrepare });
342+
}, { skipNativePrepare: deviceBuildInfoDescriptor.skipNativePrepare });
343343

344344
const service = this.getLiveSyncService(device.deviceInfo.platform);
345345
const settings: ILiveSyncWatchInfo = {

lib/services/platform-service.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ export class PlatformService extends EventEmitter implements IPlatformService {
278278
this.$errors.failWithoutHelp(`Unable to install dependencies. Make sure your package.json is valid and all dependencies are correct. Error is: ${err.message}`);
279279
}
280280

281-
await this.$pluginsService.validate(platformData, projectData);
282281
await this.ensurePlatformInstalled(platform, platformTemplate, projectData, config, nativePrepare);
283282

284283
const bundle = appFilesUpdaterOptions.bundle;
@@ -341,6 +340,8 @@ export class PlatformService extends EventEmitter implements IPlatformService {
341340
}
342341

343342
if (!changesInfo || changesInfo.modulesChanged || appFilesUpdaterOptions.bundle) {
343+
await this.$pluginsService.validate(platformData, projectData);
344+
344345
let appDestinationDirectoryPath = path.join(platformData.appDestinationDirectoryPath, constants.APP_FOLDER_NAME);
345346
let lastModifiedTime = this.$fs.exists(appDestinationDirectoryPath) ? this.$fs.getFsStats(appDestinationDirectoryPath).mtime : null;
346347

0 commit comments

Comments
 (0)