From 9fe5509b5e3f282c62e2ed2e667d0802882adc7a Mon Sep 17 00:00:00 2001 From: plamen5kov Date: Mon, 5 Mar 2018 11:13:47 +0200 Subject: [PATCH 1/4] fix: find correct apk name when --release passed --- lib/services/android-project-service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/services/android-project-service.ts b/lib/services/android-project-service.ts index d0073652a2..51a704ca45 100644 --- a/lib/services/android-project-service.ts +++ b/lib/services/android-project-service.ts @@ -109,7 +109,8 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject private getDeviceBuildOutputPath(currentPath: string, projectData: IProjectData): string { const currentPlatformData: IDictionary = this.$projectDataService.getNSValue(projectData.projectDir, constants.TNS_ANDROID_RUNTIME_NAME); const platformVersion = currentPlatformData && currentPlatformData[constants.VERSION_STRING]; - const normalizedPath = path.join(currentPath, "debug"); + const buildType = this.$options.release === true ? "release" : "debug"; + const normalizedPath = path.join(currentPath, buildType); if (semver.valid(platformVersion)) { const gradleAndroidPluginVersion3xx = "4.0.0"; From e437bd3f0fc12d1e913fd13bc0173d06c685d613 Mon Sep 17 00:00:00 2001 From: plamen5kov Date: Tue, 6 Mar 2018 09:54:04 +0200 Subject: [PATCH 2/4] refactor: don't use static options --- lib/definitions/platform.d.ts | 4 ++-- lib/definitions/project.d.ts | 1 + lib/services/android-project-service.ts | 8 +++++--- lib/services/ios-project-service.ts | 4 +++- lib/services/livesync/livesync-service.ts | 2 +- lib/services/platform-service.ts | 22 ++++++++++++---------- test/platform-commands.ts | 4 +++- test/stubs.ts | 8 ++++++-- 8 files changed, 33 insertions(+), 20 deletions(-) diff --git a/lib/definitions/platform.d.ts b/lib/definitions/platform.d.ts index fdf144481f..35d5850992 100644 --- a/lib/definitions/platform.d.ts +++ b/lib/definitions/platform.d.ts @@ -81,7 +81,7 @@ interface IPlatformService extends IBuildPlatformAction, NodeJS.EventEmitter { * @param {string} @optional outputPath Directory containing build information and artifacts. * @returns {Promise} true indicates that the application should be installed. */ - shouldInstall(device: Mobile.IDevice, projectData: IProjectData, outputPath?: string): Promise; + shouldInstall(device: Mobile.IDevice, projectData: IProjectData, release: boolean, outputPath?: string): Promise; /** * Determines whether the project should undergo the prepare process. @@ -260,7 +260,7 @@ interface IPlatformData { projectRoot: string; normalizedPlatformName: string; appDestinationDirectoryPath: string; - deviceBuildOutputPath: string; + deviceBuildOutputPath(options: IRelease): string; emulatorBuildOutputPath?: string; getValidPackageNames(buildOptions: { isReleaseBuild?: boolean, isForDevice?: boolean }): string[]; frameworkFilesExtensions: string[]; diff --git a/lib/definitions/project.d.ts b/lib/definitions/project.d.ts index cc0ee62403..d6f2f8e670 100644 --- a/lib/definitions/project.d.ts +++ b/lib/definitions/project.d.ts @@ -140,6 +140,7 @@ interface IPlatformProjectServiceBase { interface IBuildForDevice { buildForDevice: boolean; + release: boolean; } interface INativePrepare { diff --git a/lib/services/android-project-service.ts b/lib/services/android-project-service.ts index 51a704ca45..0db4613fd9 100644 --- a/lib/services/android-project-service.ts +++ b/lib/services/android-project-service.ts @@ -83,7 +83,9 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject platformProjectService: this, emulatorServices: this.$androidEmulatorServices, projectRoot: projectRoot, - deviceBuildOutputPath: this.getDeviceBuildOutputPath(path.join(...deviceBuildOutputArr), projectData), + deviceBuildOutputPath: (options: IRelease): string => { + return this.getDeviceBuildOutputPath(path.join(...deviceBuildOutputArr), projectData, options); + }, getValidPackageNames: (buildOptions: { isReleaseBuild?: boolean, isForDevice?: boolean }): string[] => { const buildMode = buildOptions.isReleaseBuild ? Configurations.Release.toLowerCase() : Configurations.Debug.toLowerCase(); @@ -106,10 +108,10 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject return this._platformData; } - private getDeviceBuildOutputPath(currentPath: string, projectData: IProjectData): string { + private getDeviceBuildOutputPath(currentPath: string, projectData: IProjectData, options: IRelease): string { const currentPlatformData: IDictionary = this.$projectDataService.getNSValue(projectData.projectDir, constants.TNS_ANDROID_RUNTIME_NAME); const platformVersion = currentPlatformData && currentPlatformData[constants.VERSION_STRING]; - const buildType = this.$options.release === true ? "release" : "debug"; + const buildType = options.release === true ? "release" : "debug"; const normalizedPath = path.join(currentPath, buildType); if (semver.valid(platformVersion)) { diff --git a/lib/services/ios-project-service.ts b/lib/services/ios-project-service.ts index 2efaea3163..588d6379f4 100644 --- a/lib/services/ios-project-service.ts +++ b/lib/services/ios-project-service.ts @@ -71,7 +71,9 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ platformProjectService: this, emulatorServices: this.$iOSEmulatorServices, projectRoot: projectRoot, - deviceBuildOutputPath: path.join(projectRoot, "build", "device"), + deviceBuildOutputPath: (options: IRelease): string => { + return path.join(projectRoot, "build", "device"); + }, emulatorBuildOutputPath: path.join(projectRoot, "build", "emulator"), getValidPackageNames: (buildOptions: { isReleaseBuild?: boolean, isForDevice?: boolean }): string[] => { if (buildOptions.isForDevice) { diff --git a/lib/services/livesync/livesync-service.ts b/lib/services/livesync/livesync-service.ts index 5e71fef48d..40eb8c1970 100644 --- a/lib/services/livesync/livesync-service.ts +++ b/lib/services/livesync/livesync-service.ts @@ -413,7 +413,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi await this.trackAction(action, platform, options); - const shouldInstall = await this.$platformService.shouldInstall(options.device, options.projectData, options.deviceBuildInfoDescriptor.outputPath); + const shouldInstall = await this.$platformService.shouldInstall(options.device, options.projectData, options.release, options.deviceBuildInfoDescriptor.outputPath); if (shouldInstall) { await this.$platformService.installApplication(options.device, { release: false }, options.projectData, pathToBuildItem, options.deviceBuildInfoDescriptor.outputPath); appInstalledOnDeviceResult.appInstalled = true; diff --git a/lib/services/platform-service.ts b/lib/services/platform-service.ts index e09da69dcd..2d3c06134e 100644 --- a/lib/services/platform-service.ts +++ b/lib/services/platform-service.ts @@ -333,7 +333,7 @@ export class PlatformService extends EventEmitter implements IPlatformService { const platformData = this.$platformsData.getPlatformData(platform, projectData); const forDevice = !buildConfig || buildConfig.buildForDevice; - outputPath = outputPath || (forDevice ? platformData.deviceBuildOutputPath : platformData.emulatorBuildOutputPath || platformData.deviceBuildOutputPath); + outputPath = outputPath || (forDevice ? platformData.deviceBuildOutputPath(buildConfig) : platformData.emulatorBuildOutputPath || platformData.deviceBuildOutputPath(buildConfig)); if (!this.$fs.exists(outputPath)) { return true; } @@ -433,7 +433,7 @@ export class PlatformService extends EventEmitter implements IPlatformService { this.$fs.writeJson(buildInfoFile, buildInfo); } - public async shouldInstall(device: Mobile.IDevice, projectData: IProjectData, outputPath?: string): Promise { + public async shouldInstall(device: Mobile.IDevice, projectData: IProjectData, release: boolean, outputPath?: string): Promise { const platform = device.deviceInfo.platform; if (!(await device.applicationManager.isApplicationInstalled(projectData.projectId))) { return true; @@ -441,7 +441,7 @@ export class PlatformService extends EventEmitter implements IPlatformService { const platformData = this.$platformsData.getPlatformData(platform, projectData); const deviceBuildInfo: IBuildInfo = await this.getDeviceBuildInfo(device, projectData); - const localBuildInfo = this.getBuildInfo(platform, platformData, { buildForDevice: !device.isEmulator }, outputPath); + const localBuildInfo = this.getBuildInfo(platform, platformData, { buildForDevice: !device.isEmulator, release: false }, outputPath); return !localBuildInfo || !deviceBuildInfo || deviceBuildInfo.buildTime !== localBuildInfo.buildTime; } @@ -469,7 +469,9 @@ export class PlatformService extends EventEmitter implements IPlatformService { if (!buildConfig.release) { const deviceFilePath = await this.getDeviceBuildInfoFilePath(device, projectData); - const buildInfoFilePath = outputFilePath || this.getBuildOutputPath(device.deviceInfo.platform, platformData, { buildForDevice: !device.isEmulator }); + const options = buildConfig; + options.buildForDevice = !device.isEmulator; + const buildInfoFilePath = outputFilePath || this.getBuildOutputPath(device.deviceInfo.platform, platformData, options); const appIdentifier = projectData.projectId; await device.fileSystem.putFile(path.join(buildInfoFilePath, buildInfoFileName), deviceFilePath, appIdentifier); @@ -515,8 +517,8 @@ export class PlatformService extends EventEmitter implements IPlatformService { this.$logger.out("Skipping package build. No changes detected on the native side. This will be fast!"); } - if (deployInfo.deployOptions.forceInstall || shouldBuild || (await this.shouldInstall(device, deployInfo.projectData))) { - await this.installApplication(device, buildConfig, deployInfo.projectData, installPackageFile, deployInfo.outputPath); + if (deployInfo.deployOptions.forceInstall || shouldBuild || (await this.shouldInstall(device, deployInfo.projectData, buildConfig.release))) { + await this.installApplication(device, buildConfig, deployInfo.projectData); } else { this.$logger.out("Skipping install."); } @@ -552,10 +554,10 @@ export class PlatformService extends EventEmitter implements IPlatformService { private getBuildOutputPath(platform: string, platformData: IPlatformData, options: IBuildForDevice): string { if (platform.toLowerCase() === this.$devicePlatformsConstants.iOS.toLowerCase()) { - return options.buildForDevice ? platformData.deviceBuildOutputPath : platformData.emulatorBuildOutputPath; + return options.buildForDevice ? platformData.deviceBuildOutputPath(options) : platformData.emulatorBuildOutputPath; } - return platformData.deviceBuildOutputPath; + return platformData.deviceBuildOutputPath(options); } private async getDeviceBuildInfoFilePath(device: Mobile.IDevice, projectData: IProjectData): Promise { @@ -765,11 +767,11 @@ export class PlatformService extends EventEmitter implements IPlatformService { } public getLatestApplicationPackageForDevice(platformData: IPlatformData, buildConfig: IBuildConfig, outputPath?: string): IApplicationPackage { - return this.getLatestApplicationPackage(outputPath || platformData.deviceBuildOutputPath, platformData.getValidPackageNames({ isForDevice: true, isReleaseBuild: buildConfig.release })); + return this.getLatestApplicationPackage(outputPath || platformData.deviceBuildOutputPath(buildConfig), platformData.getValidPackageNames({ isForDevice: true, isReleaseBuild: buildConfig.release })); } public getLatestApplicationPackageForEmulator(platformData: IPlatformData, buildConfig: IBuildConfig, outputPath?: string): IApplicationPackage { - return this.getLatestApplicationPackage(outputPath || platformData.emulatorBuildOutputPath || platformData.deviceBuildOutputPath, platformData.getValidPackageNames({ isForDevice: false, isReleaseBuild: buildConfig.release })); + return this.getLatestApplicationPackage(outputPath || platformData.emulatorBuildOutputPath || platformData.deviceBuildOutputPath(buildConfig), platformData.getValidPackageNames({ isForDevice: false, isReleaseBuild: buildConfig.release })); } private async updatePlatform(platform: string, version: string, platformTemplate: string, projectData: IProjectData, config: IPlatformOptions): Promise { diff --git a/test/platform-commands.ts b/test/platform-commands.ts index fd0bf7a9d7..2e75f1075b 100644 --- a/test/platform-commands.ts +++ b/test/platform-commands.ts @@ -35,7 +35,9 @@ class PlatformData implements IPlatformData { }; emulatorServices: Mobile.IEmulatorPlatformServices = null; projectRoot = ""; - deviceBuildOutputPath = ""; + deviceBuildOutputPath = (buildTypeOption: IRelease) => { + return ""; + } getValidPackageNames = (buildOptions: { isForDevice?: boolean, isReleaseBuild?: boolean }) => [""]; validPackageNamesForDevice: string[] = []; frameworkFilesExtensions = [".jar", ".dat"]; diff --git a/test/stubs.ts b/test/stubs.ts index 096c196dc3..5d253890cc 100644 --- a/test/stubs.ts +++ b/test/stubs.ts @@ -304,7 +304,9 @@ export class PlatformProjectServiceStub extends EventEmitter implements IPlatfor platformProjectService: this, emulatorServices: undefined, projectRoot: "", - deviceBuildOutputPath: "", + deviceBuildOutputPath: (buildTypeOption: IRelease) => { + return ""; + }, getValidPackageNames: (buildOptions: { isForDevice?: boolean, isReleaseBuild?: boolean }) => [], frameworkFilesExtensions: [], appDestinationDirectoryPath: "", @@ -415,7 +417,9 @@ export class PlatformsDataStub extends EventEmitter implements IPlatformsData { projectRoot: "", normalizedPlatformName: "", appDestinationDirectoryPath: "", - deviceBuildOutputPath: "", + deviceBuildOutputPath: (buildTypeOption: IRelease) => { + return ""; + }, getValidPackageNames: (buildOptions: { isForDevice?: boolean, isReleaseBuild?: boolean }) => [], frameworkFilesExtensions: [], relativeToFrameworkConfigurationFilePath: "", From d5c4eed782f75d1ac54fab754f3176a60b5a6f4b Mon Sep 17 00:00:00 2001 From: plamen5kov Date: Tue, 6 Mar 2018 16:59:57 +0200 Subject: [PATCH 3/4] refactor: update after review --- lib/definitions/platform.d.ts | 4 ++-- lib/definitions/project.d.ts | 5 ++++- lib/services/android-project-service.ts | 2 +- lib/services/ios-project-service.ts | 2 +- lib/services/livesync/livesync-service.ts | 2 +- lib/services/platform-service.ts | 20 ++++++++++---------- test/platform-commands.ts | 2 +- test/stubs.ts | 4 ++-- 8 files changed, 22 insertions(+), 19 deletions(-) diff --git a/lib/definitions/platform.d.ts b/lib/definitions/platform.d.ts index 35d5850992..3edeb6af49 100644 --- a/lib/definitions/platform.d.ts +++ b/lib/definitions/platform.d.ts @@ -81,7 +81,7 @@ interface IPlatformService extends IBuildPlatformAction, NodeJS.EventEmitter { * @param {string} @optional outputPath Directory containing build information and artifacts. * @returns {Promise} true indicates that the application should be installed. */ - shouldInstall(device: Mobile.IDevice, projectData: IProjectData, release: boolean, outputPath?: string): Promise; + shouldInstall(device: Mobile.IDevice, projectData: IProjectData, release: IRelease, outputPath?: string): Promise; /** * Determines whether the project should undergo the prepare process. @@ -260,7 +260,7 @@ interface IPlatformData { projectRoot: string; normalizedPlatformName: string; appDestinationDirectoryPath: string; - deviceBuildOutputPath(options: IRelease): string; + getDeviceBuildOutputPath(options: IRelease): string; emulatorBuildOutputPath?: string; getValidPackageNames(buildOptions: { isReleaseBuild?: boolean, isForDevice?: boolean }): string[]; frameworkFilesExtensions: string[]; diff --git a/lib/definitions/project.d.ts b/lib/definitions/project.d.ts index d6f2f8e670..d71b9a6583 100644 --- a/lib/definitions/project.d.ts +++ b/lib/definitions/project.d.ts @@ -140,7 +140,10 @@ interface IPlatformProjectServiceBase { interface IBuildForDevice { buildForDevice: boolean; - release: boolean; +} + +interface IShouldInstall extends IBuildForDevice, IRelease { + } interface INativePrepare { diff --git a/lib/services/android-project-service.ts b/lib/services/android-project-service.ts index 0db4613fd9..0b7c230ef1 100644 --- a/lib/services/android-project-service.ts +++ b/lib/services/android-project-service.ts @@ -83,7 +83,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject platformProjectService: this, emulatorServices: this.$androidEmulatorServices, projectRoot: projectRoot, - deviceBuildOutputPath: (options: IRelease): string => { + getDeviceBuildOutputPath: (options: IRelease): string => { return this.getDeviceBuildOutputPath(path.join(...deviceBuildOutputArr), projectData, options); }, getValidPackageNames: (buildOptions: { isReleaseBuild?: boolean, isForDevice?: boolean }): string[] => { diff --git a/lib/services/ios-project-service.ts b/lib/services/ios-project-service.ts index 588d6379f4..ab12660aab 100644 --- a/lib/services/ios-project-service.ts +++ b/lib/services/ios-project-service.ts @@ -71,7 +71,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ platformProjectService: this, emulatorServices: this.$iOSEmulatorServices, projectRoot: projectRoot, - deviceBuildOutputPath: (options: IRelease): string => { + getDeviceBuildOutputPath: (options: IRelease): string => { return path.join(projectRoot, "build", "device"); }, emulatorBuildOutputPath: path.join(projectRoot, "build", "emulator"), diff --git a/lib/services/livesync/livesync-service.ts b/lib/services/livesync/livesync-service.ts index 40eb8c1970..da16aea9fc 100644 --- a/lib/services/livesync/livesync-service.ts +++ b/lib/services/livesync/livesync-service.ts @@ -413,7 +413,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi await this.trackAction(action, platform, options); - const shouldInstall = await this.$platformService.shouldInstall(options.device, options.projectData, options.release, options.deviceBuildInfoDescriptor.outputPath); + const shouldInstall = await this.$platformService.shouldInstall(options.device, options.projectData, options, options.deviceBuildInfoDescriptor.outputPath); if (shouldInstall) { await this.$platformService.installApplication(options.device, { release: false }, options.projectData, pathToBuildItem, options.deviceBuildInfoDescriptor.outputPath); appInstalledOnDeviceResult.appInstalled = true; diff --git a/lib/services/platform-service.ts b/lib/services/platform-service.ts index 2d3c06134e..3c1194f637 100644 --- a/lib/services/platform-service.ts +++ b/lib/services/platform-service.ts @@ -333,7 +333,7 @@ export class PlatformService extends EventEmitter implements IPlatformService { const platformData = this.$platformsData.getPlatformData(platform, projectData); const forDevice = !buildConfig || buildConfig.buildForDevice; - outputPath = outputPath || (forDevice ? platformData.deviceBuildOutputPath(buildConfig) : platformData.emulatorBuildOutputPath || platformData.deviceBuildOutputPath(buildConfig)); + outputPath = outputPath || (forDevice ? platformData.getDeviceBuildOutputPath(buildConfig) : platformData.emulatorBuildOutputPath || platformData.getDeviceBuildOutputPath(buildConfig)); if (!this.$fs.exists(outputPath)) { return true; } @@ -433,7 +433,7 @@ export class PlatformService extends EventEmitter implements IPlatformService { this.$fs.writeJson(buildInfoFile, buildInfo); } - public async shouldInstall(device: Mobile.IDevice, projectData: IProjectData, release: boolean, outputPath?: string): Promise { + public async shouldInstall(device: Mobile.IDevice, projectData: IProjectData, isRelease: IRelease, outputPath?: string): Promise { const platform = device.deviceInfo.platform; if (!(await device.applicationManager.isApplicationInstalled(projectData.projectId))) { return true; @@ -441,7 +441,7 @@ export class PlatformService extends EventEmitter implements IPlatformService { const platformData = this.$platformsData.getPlatformData(platform, projectData); const deviceBuildInfo: IBuildInfo = await this.getDeviceBuildInfo(device, projectData); - const localBuildInfo = this.getBuildInfo(platform, platformData, { buildForDevice: !device.isEmulator, release: false }, outputPath); + const localBuildInfo = this.getBuildInfo(platform, platformData, { buildForDevice: !device.isEmulator, release: isRelease.release }, outputPath); return !localBuildInfo || !deviceBuildInfo || deviceBuildInfo.buildTime !== localBuildInfo.buildTime; } @@ -517,7 +517,7 @@ export class PlatformService extends EventEmitter implements IPlatformService { this.$logger.out("Skipping package build. No changes detected on the native side. This will be fast!"); } - if (deployInfo.deployOptions.forceInstall || shouldBuild || (await this.shouldInstall(device, deployInfo.projectData, buildConfig.release))) { + if (deployInfo.deployOptions.forceInstall || shouldBuild || (await this.shouldInstall(device, deployInfo.projectData, buildConfig))) { await this.installApplication(device, buildConfig, deployInfo.projectData); } else { this.$logger.out("Skipping install."); @@ -552,12 +552,12 @@ export class PlatformService extends EventEmitter implements IPlatformService { await this.$devicesService.execute(action, this.getCanExecuteAction(platform, runOptions)); } - private getBuildOutputPath(platform: string, platformData: IPlatformData, options: IBuildForDevice): string { + private getBuildOutputPath(platform: string, platformData: IPlatformData, options: IShouldInstall): string { if (platform.toLowerCase() === this.$devicePlatformsConstants.iOS.toLowerCase()) { - return options.buildForDevice ? platformData.deviceBuildOutputPath(options) : platformData.emulatorBuildOutputPath; + return options.buildForDevice ? platformData.getDeviceBuildOutputPath(options) : platformData.emulatorBuildOutputPath; } - return platformData.deviceBuildOutputPath(options); + return platformData.getDeviceBuildOutputPath(options); } private async getDeviceBuildInfoFilePath(device: Mobile.IDevice, projectData: IProjectData): Promise { @@ -577,7 +577,7 @@ export class PlatformService extends EventEmitter implements IPlatformService { } } - private getBuildInfo(platform: string, platformData: IPlatformData, options: IBuildForDevice, buildOutputPath?: string): IBuildInfo { + private getBuildInfo(platform: string, platformData: IPlatformData, options: IShouldInstall, buildOutputPath?: string): IBuildInfo { buildOutputPath = buildOutputPath || this.getBuildOutputPath(platform, platformData, options); const buildInfoFile = path.join(buildOutputPath, buildInfoFileName); if (this.$fs.exists(buildInfoFile)) { @@ -767,11 +767,11 @@ export class PlatformService extends EventEmitter implements IPlatformService { } public getLatestApplicationPackageForDevice(platformData: IPlatformData, buildConfig: IBuildConfig, outputPath?: string): IApplicationPackage { - return this.getLatestApplicationPackage(outputPath || platformData.deviceBuildOutputPath(buildConfig), platformData.getValidPackageNames({ isForDevice: true, isReleaseBuild: buildConfig.release })); + return this.getLatestApplicationPackage(outputPath || platformData.getDeviceBuildOutputPath(buildConfig), platformData.getValidPackageNames({ isForDevice: true, isReleaseBuild: buildConfig.release })); } public getLatestApplicationPackageForEmulator(platformData: IPlatformData, buildConfig: IBuildConfig, outputPath?: string): IApplicationPackage { - return this.getLatestApplicationPackage(outputPath || platformData.emulatorBuildOutputPath || platformData.deviceBuildOutputPath(buildConfig), platformData.getValidPackageNames({ isForDevice: false, isReleaseBuild: buildConfig.release })); + return this.getLatestApplicationPackage(outputPath || platformData.emulatorBuildOutputPath || platformData.getDeviceBuildOutputPath(buildConfig), platformData.getValidPackageNames({ isForDevice: false, isReleaseBuild: buildConfig.release })); } private async updatePlatform(platform: string, version: string, platformTemplate: string, projectData: IProjectData, config: IPlatformOptions): Promise { diff --git a/test/platform-commands.ts b/test/platform-commands.ts index 2e75f1075b..3e638d3ca1 100644 --- a/test/platform-commands.ts +++ b/test/platform-commands.ts @@ -35,7 +35,7 @@ class PlatformData implements IPlatformData { }; emulatorServices: Mobile.IEmulatorPlatformServices = null; projectRoot = ""; - deviceBuildOutputPath = (buildTypeOption: IRelease) => { + getDeviceBuildOutputPath = (buildTypeOption: IRelease) => { return ""; } getValidPackageNames = (buildOptions: { isForDevice?: boolean, isReleaseBuild?: boolean }) => [""]; diff --git a/test/stubs.ts b/test/stubs.ts index 5d253890cc..c1e26bf437 100644 --- a/test/stubs.ts +++ b/test/stubs.ts @@ -304,7 +304,7 @@ export class PlatformProjectServiceStub extends EventEmitter implements IPlatfor platformProjectService: this, emulatorServices: undefined, projectRoot: "", - deviceBuildOutputPath: (buildTypeOption: IRelease) => { + getDeviceBuildOutputPath: (buildTypeOption: IRelease) => { return ""; }, getValidPackageNames: (buildOptions: { isForDevice?: boolean, isReleaseBuild?: boolean }) => [], @@ -417,7 +417,7 @@ export class PlatformsDataStub extends EventEmitter implements IPlatformsData { projectRoot: "", normalizedPlatformName: "", appDestinationDirectoryPath: "", - deviceBuildOutputPath: (buildTypeOption: IRelease) => { + getDeviceBuildOutputPath: (buildTypeOption: IRelease) => { return ""; }, getValidPackageNames: (buildOptions: { isForDevice?: boolean, isReleaseBuild?: boolean }) => [], From 40f507444627bf28c592f9c19fe60d1fc53ea569 Mon Sep 17 00:00:00 2001 From: plamen5kov Date: Wed, 7 Mar 2018 12:49:45 +0200 Subject: [PATCH 4/4] chore: rename variable --- lib/services/platform-service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/services/platform-service.ts b/lib/services/platform-service.ts index 3c1194f637..0eaea50425 100644 --- a/lib/services/platform-service.ts +++ b/lib/services/platform-service.ts @@ -433,7 +433,7 @@ export class PlatformService extends EventEmitter implements IPlatformService { this.$fs.writeJson(buildInfoFile, buildInfo); } - public async shouldInstall(device: Mobile.IDevice, projectData: IProjectData, isRelease: IRelease, outputPath?: string): Promise { + public async shouldInstall(device: Mobile.IDevice, projectData: IProjectData, release: IBuildConfig, outputPath?: string): Promise { const platform = device.deviceInfo.platform; if (!(await device.applicationManager.isApplicationInstalled(projectData.projectId))) { return true; @@ -441,7 +441,7 @@ export class PlatformService extends EventEmitter implements IPlatformService { const platformData = this.$platformsData.getPlatformData(platform, projectData); const deviceBuildInfo: IBuildInfo = await this.getDeviceBuildInfo(device, projectData); - const localBuildInfo = this.getBuildInfo(platform, platformData, { buildForDevice: !device.isEmulator, release: isRelease.release }, outputPath); + const localBuildInfo = this.getBuildInfo(platform, platformData, { buildForDevice: !device.isEmulator, release: release.release }, outputPath); return !localBuildInfo || !deviceBuildInfo || deviceBuildInfo.buildTime !== localBuildInfo.buildTime; }