Skip to content

Commit 013ed91

Browse files
Mitko-Kerezovrosen-vladimirov
authored andcommitted
Respect --bundle option in run command (#3260)
Drop the logic that special cases `release` or `bundle` builds and rely on the service instead.
1 parent c493408 commit 013ed91

File tree

5 files changed

+17
-6
lines changed

5 files changed

+17
-6
lines changed

PublicAPI.md

+2
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,8 @@ const liveSyncData = {
589589
projectDir,
590590
skipWatcher: false,
591591
watchAllFiles: false,
592+
bundle: false,
593+
release: false,
592594
useLiveEdit: false
593595
};
594596

lib/definitions/livesync.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ interface ILiveSyncDeviceInfo extends IOptionalOutputPath, IOptionalDebuggingOpt
111111
/**
112112
* Describes a LiveSync operation.
113113
*/
114-
interface ILiveSyncInfo extends IProjectDir, IEnvOptions {
114+
interface ILiveSyncInfo extends IProjectDir, IEnvOptions, IBundle, IRelease {
115115
/**
116116
* Defines if the watcher should be skipped. If not passed, fs.Watcher will be started.
117117
*/
@@ -152,7 +152,7 @@ interface IProjectDataComposition {
152152
/**
153153
* Desribes object that can be passed to ensureLatestAppPackageIsInstalledOnDevice method.
154154
*/
155-
interface IEnsureLatestAppPackageIsInstalledOnDeviceOptions extends IProjectDataComposition, IEnvOptions {
155+
interface IEnsureLatestAppPackageIsInstalledOnDeviceOptions extends IProjectDataComposition, IEnvOptions, IBundle, IRelease {
156156
device: Mobile.IDevice;
157157
preparedPlatforms: string[];
158158
rebuiltInformation: ILiveSyncBuildInfo[];

lib/services/livesync/livesync-command-helper.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class LiveSyncCommandHelper implements ILiveSyncCommandHelper {
3232
this.$iosDeviceOperations.setShouldDispose(false);
3333
}
3434

35-
if (this.$options.release || this.$options.bundle) {
35+
if (this.$options.release) {
3636
await this.runInReleaseMode(platform);
3737
return;
3838
}
@@ -75,11 +75,12 @@ export class LiveSyncCommandHelper implements ILiveSyncCommandHelper {
7575
skipWatcher: !this.$options.watch,
7676
watchAllFiles: this.$options.syncAllFiles,
7777
clean: this.$options.clean,
78+
bundle: !!this.$options.bundle,
79+
release: this.$options.release,
7880
env: this.$options.env
7981
};
8082

8183
await this.$liveSyncService.liveSync(deviceDescriptors, liveSyncInfo);
82-
8384
}
8485

8586
private async runInReleaseMode(platform: string): Promise<void> {

lib/services/livesync/livesync-service.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
362362
const prepareInfo: IPreparePlatformInfo = {
363363
platform,
364364
appFilesUpdaterOptions: {
365-
bundle: false,
366-
release: false,
365+
bundle: options.bundle,
366+
release: options.release,
367367
},
368368
projectData: options.projectData,
369369
env: options.env,
@@ -459,6 +459,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
459459
deviceBuildInfoDescriptor,
460460
liveSyncData,
461461
settings,
462+
bundle: liveSyncData.bundle,
463+
release: liveSyncData.release,
462464
env: liveSyncData.env
463465
}, { skipNativePrepare: deviceBuildInfoDescriptor.skipNativePrepare });
464466

@@ -564,6 +566,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
564566
deviceBuildInfoDescriptor,
565567
settings: latestAppPackageInstalledSettings,
566568
modifiedFiles: allModifiedFiles,
569+
bundle: liveSyncData.bundle,
570+
release: liveSyncData.release,
567571
env: liveSyncData.env
568572
}, { skipNativePrepare: deviceBuildInfoDescriptor.skipNativePrepare });
569573

lib/services/test-execution-service.ts

+4
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ class TestExecutionService implements ITestExecutionService {
123123
projectDir: projectData.projectDir,
124124
skipWatcher: !this.$options.watch || this.$options.justlaunch,
125125
watchAllFiles: this.$options.syncAllFiles,
126+
bundle: !!this.$options.bundle,
127+
release: this.$options.release,
126128
env: this.$options.env
127129
};
128130

@@ -248,6 +250,8 @@ class TestExecutionService implements ITestExecutionService {
248250
projectDir: projectData.projectDir,
249251
skipWatcher: !this.$options.watch || this.$options.justlaunch,
250252
watchAllFiles: this.$options.syncAllFiles,
253+
bundle: !!this.$options.bundle,
254+
release: this.$options.release,
251255
env: this.$options.env
252256
};
253257

0 commit comments

Comments
 (0)