From 86ac9bd33f52f9929ce0622c118e6b8a9801394a Mon Sep 17 00:00:00 2001 From: fatme Date: Thu, 15 Mar 2018 17:16:16 +0200 Subject: [PATCH 1/3] Support multiple .apk files produced from gradle build --- lib/constants.ts | 1 + lib/definitions/platform.d.ts | 14 +++- lib/definitions/project.d.ts | 4 -- lib/services/android-project-service.ts | 38 ++++------- lib/services/ios-project-service.ts | 14 ++-- lib/services/platform-service.ts | 76 ++++++++++++++-------- test/platform-commands.ts | 6 +- test/platform-service.ts | 85 ++++++++++++++++++++++++- test/stubs.ts | 12 ++-- 9 files changed, 171 insertions(+), 79 deletions(-) diff --git a/lib/constants.ts b/lib/constants.ts index be62b65a9b..c8f5e556b6 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -33,6 +33,7 @@ export const CONFIG_NS_FILE_NAME = "nsconfig.json"; export const CONFIG_NS_APP_RESOURCES_ENTRY = "appResourcesPath"; export const CONFIG_NS_APP_ENTRY = "appPath"; export const DEPENDENCIES_JSON_NAME = "dependencies.json"; +export const APK_EXTENSION_NAME = ".apk"; export class PackageVersion { static NEXT = "next"; diff --git a/lib/definitions/platform.d.ts b/lib/definitions/platform.d.ts index 3221dc3002..190467ddd0 100644 --- a/lib/definitions/platform.d.ts +++ b/lib/definitions/platform.d.ts @@ -260,9 +260,9 @@ interface IPlatformData { projectRoot: string; normalizedPlatformName: string; appDestinationDirectoryPath: string; - getDeviceBuildOutputPath(options: IRelease): string; + deviceBuildOutputPath: string; emulatorBuildOutputPath?: string; - getValidPackageNames(buildOptions: { isReleaseBuild?: boolean, isForDevice?: boolean }): string[]; + getValidBuildOutputData(buildOptions: IBuildOutputOptions): IValidBuildOutputData; frameworkFilesExtensions: string[]; frameworkDirectoriesExtensions?: string[]; frameworkDirectoriesNames?: string[]; @@ -273,6 +273,16 @@ interface IPlatformData { fastLivesyncFileExtensions: string[]; } +interface IValidBuildOutputData { + packageNames: string[]; + regexes?: RegExp[]; +} + +interface IBuildOutputOptions { + isReleaseBuild?: boolean; + isForDevice?: boolean; +} + interface IPlatformsData { availablePlatforms: any; platformsNames: string[]; diff --git a/lib/definitions/project.d.ts b/lib/definitions/project.d.ts index c816078097..8c8710fa94 100644 --- a/lib/definitions/project.d.ts +++ b/lib/definitions/project.d.ts @@ -142,10 +142,6 @@ interface IBuildForDevice { buildForDevice: boolean; } -interface IShouldInstall extends IBuildForDevice, IRelease { - -} - interface INativePrepare { skipNativePrepare: boolean; } diff --git a/lib/services/android-project-service.ts b/lib/services/android-project-service.ts index caf3e4fe01..4deed265ed 100644 --- a/lib/services/android-project-service.ts +++ b/lib/services/android-project-service.ts @@ -83,18 +83,19 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject platformProjectService: this, emulatorServices: this.$androidEmulatorServices, projectRoot: projectRoot, - getDeviceBuildOutputPath: (options: IRelease): string => { - return this.getDeviceBuildOutputPath(path.join(...deviceBuildOutputArr), projectData, options); - }, - getValidPackageNames: (buildOptions: { isReleaseBuild?: boolean, isForDevice?: boolean }): string[] => { + deviceBuildOutputPath: path.join(...deviceBuildOutputArr), + getValidBuildOutputData: (buildOptions: IBuildOutputOptions): IValidBuildOutputData => { const buildMode = buildOptions.isReleaseBuild ? Configurations.Release.toLowerCase() : Configurations.Debug.toLowerCase(); - return [ - `${packageName}-${buildMode}.apk`, - `${projectData.projectName}-${buildMode}.apk`, - `${projectData.projectName}.apk`, - `app-${buildMode}.apk` - ]; + return { + packageNames: [ + `${packageName}-${buildMode}${constants.APK_EXTENSION_NAME}`, + `${projectData.projectName}-${buildMode}${constants.APK_EXTENSION_NAME}`, + `${projectData.projectName}${constants.APK_EXTENSION_NAME}`, + `${constants.APP_FOLDER_NAME}-${buildMode}${constants.APK_EXTENSION_NAME}` + ], + regexes: [new RegExp(`${constants.APP_FOLDER_NAME}-.*-(${Configurations.Debug}|${Configurations.Release})${constants.APK_EXTENSION_NAME}`), new RegExp(`${packageName}-.*-(${Configurations.Debug}|${Configurations.Release})${constants.APK_EXTENSION_NAME}`)] + }; }, frameworkFilesExtensions: [".jar", ".dat", ".so"], configurationFileName: constants.MANIFEST_FILE_NAME, @@ -108,23 +109,6 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject return this._platformData; } - 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 = options.release === true ? "release" : "debug"; - const normalizedPath = path.join(currentPath, buildType); - - if (semver.valid(platformVersion)) { - const gradleAndroidPluginVersion3xx = "4.0.0"; - const normalizedPlatformVersion = `${semver.major(platformVersion)}.${semver.minor(platformVersion)}.0`; - if (semver.lt(normalizedPlatformVersion, gradleAndroidPluginVersion3xx)) { - return currentPath; - } - } - - return normalizedPath; - } - // TODO: Remove prior to the 4.0 CLI release @Pip3r4o @PanayotCankov // Similar to the private method of the same name in platform-service. private getCurrentPlatformVersion(platformData: IPlatformData, projectData: IProjectData): string { diff --git a/lib/services/ios-project-service.ts b/lib/services/ios-project-service.ts index 4e92d9d7ac..9233827a3a 100644 --- a/lib/services/ios-project-service.ts +++ b/lib/services/ios-project-service.ts @@ -72,16 +72,18 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ platformProjectService: this, emulatorServices: this.$iOSEmulatorServices, projectRoot: projectRoot, - getDeviceBuildOutputPath: (options: IRelease): string => { - return path.join(projectRoot, "build", "device"); - }, + deviceBuildOutputPath: path.join(projectRoot, "build", "device"), emulatorBuildOutputPath: path.join(projectRoot, "build", "emulator"), - getValidPackageNames: (buildOptions: { isReleaseBuild?: boolean, isForDevice?: boolean }): string[] => { + getValidBuildOutputData: (buildOptions: IBuildOutputOptions): IValidBuildOutputData => { if (buildOptions.isForDevice) { - return [`${projectData.projectName}.ipa`]; + return { + packageNames: [`${projectData.projectName}.ipa`] + }; } - return [`${projectData.projectName}.app`, `${projectData.projectName}.zip`]; + return { + packageNames: [`${projectData.projectName}.app`, `${projectData.projectName}.zip`] + }; }, frameworkFilesExtensions: [".a", ".framework", ".bin"], frameworkDirectoriesExtensions: [".framework"], diff --git a/lib/services/platform-service.ts b/lib/services/platform-service.ts index 480b8cfd32..0056544f27 100644 --- a/lib/services/platform-service.ts +++ b/lib/services/platform-service.ts @@ -342,13 +342,13 @@ export class PlatformService extends EventEmitter implements IPlatformService { const platformData = this.$platformsData.getPlatformData(platform, projectData); const forDevice = !buildConfig || buildConfig.buildForDevice; - outputPath = outputPath || (forDevice ? platformData.getDeviceBuildOutputPath(buildConfig) : platformData.emulatorBuildOutputPath || platformData.getDeviceBuildOutputPath(buildConfig)); + outputPath = outputPath || (forDevice ? platformData.deviceBuildOutputPath : platformData.emulatorBuildOutputPath || platformData.deviceBuildOutputPath); if (!this.$fs.exists(outputPath)) { return true; } - const packageNames = platformData.getValidPackageNames({ isForDevice: forDevice }); - const packages = this.getApplicationPackages(outputPath, packageNames); + const validBuildOutputData = platformData.getValidBuildOutputData({ isForDevice: forDevice }); + const packages = this.getApplicationPackages(outputPath, validBuildOutputData); if (packages.length === 0) { return true; } @@ -450,7 +450,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: release.release }, outputPath); + const localBuildInfo = this.getBuildInfo(platform, platformData, { buildForDevice: !device.isEmulator }, outputPath); return !localBuildInfo || !deviceBuildInfo || deviceBuildInfo.buildTime !== localBuildInfo.buildTime; } @@ -561,12 +561,12 @@ export class PlatformService extends EventEmitter implements IPlatformService { await this.$devicesService.execute(action, this.getCanExecuteAction(platform, runOptions)); } - private getBuildOutputPath(platform: string, platformData: IPlatformData, options: IShouldInstall): string { + private getBuildOutputPath(platform: string, platformData: IPlatformData, options: IBuildForDevice): string { if (platform.toLowerCase() === this.$devicePlatformsConstants.iOS.toLowerCase()) { - return options.buildForDevice ? platformData.getDeviceBuildOutputPath(options) : platformData.emulatorBuildOutputPath; + return options.buildForDevice ? platformData.deviceBuildOutputPath : platformData.emulatorBuildOutputPath; } - return platformData.getDeviceBuildOutputPath(options); + return platformData.deviceBuildOutputPath; } private async getDeviceBuildInfoFilePath(device: Mobile.IDevice, projectData: IProjectData): Promise { @@ -586,7 +586,7 @@ export class PlatformService extends EventEmitter implements IPlatformService { } } - private getBuildInfo(platform: string, platformData: IPlatformData, options: IShouldInstall, buildOutputPath?: string): IBuildInfo { + private getBuildInfo(platform: string, platformData: IPlatformData, options: IBuildForDevice, buildOutputPath?: string): IBuildInfo { buildOutputPath = buildOutputPath || this.getBuildOutputPath(platform, platformData, options); const buildInfoFile = path.join(buildOutputPath, buildInfoFileName); if (this.$fs.exists(buildInfoFile)) { @@ -746,27 +746,50 @@ export class PlatformService extends EventEmitter implements IPlatformService { return platformData.platformProjectService.isPlatformPrepared(platformData.projectRoot, projectData); } - private getApplicationPackages(buildOutputPath: string, validPackageNames: string[]): IApplicationPackage[] { + private getApplicationPackages(buildOutputPath: string, validBuildOutputData: IValidBuildOutputData): IApplicationPackage[] { // Get latest package` that is produced from build - const candidates = this.$fs.readDirectory(buildOutputPath); - const packages = _.filter(candidates, candidate => { - return _.includes(validPackageNames, candidate); - }).map(currentPackage => { - currentPackage = path.join(buildOutputPath, currentPackage); - - return { - packageName: currentPackage, - time: this.$fs.getFsStats(currentPackage).mtime - }; - }); + let result = this.getApplicationPackagesCore(this.$fs.readDirectory(buildOutputPath).map(filename => path.join(buildOutputPath, filename)), validBuildOutputData.packageNames); + if (result) { + return result; + } + + const candidates = this.$fs.enumerateFilesInDirectorySync(buildOutputPath); + result = this.getApplicationPackagesCore(candidates, validBuildOutputData.packageNames); + if (result) { + return result; + } + + if (validBuildOutputData.regexes && validBuildOutputData.regexes.length) { + return this.createApplicationPackages(candidates.filter(filepath => _.some(validBuildOutputData.regexes, regex => regex.test(path.basename(filepath))))); + } + + return []; + } - return packages; + private getApplicationPackagesCore(candidates: string[], validPackageNames: string[]): IApplicationPackage[] { + const packages = candidates.filter(filePath => _.includes(validPackageNames, path.basename(filePath))); + if (packages.length > 0) { + return this.createApplicationPackages(packages); + } + + return null; + } + + private createApplicationPackages(packages: string[]): IApplicationPackage[] { + return packages.map(filepath => this.createApplicationPackage(filepath)); } - private getLatestApplicationPackage(buildOutputPath: string, validPackageNames: string[]): IApplicationPackage { - let packages = this.getApplicationPackages(buildOutputPath, validPackageNames); + private createApplicationPackage(filepath: string): IApplicationPackage { + return { + packageName: filepath, + time: this.$fs.getFsStats(filepath).mtime + }; + } + + private getLatestApplicationPackage(buildOutputPath: string, validBuildOutputData: IValidBuildOutputData): IApplicationPackage { + let packages = this.getApplicationPackages(buildOutputPath, validBuildOutputData); if (packages.length === 0) { - const packageExtName = path.extname(validPackageNames[0]); + const packageExtName = path.extname(validBuildOutputData.packageNames[0]); this.$errors.fail("No %s found in %s directory", packageExtName, buildOutputPath); } @@ -776,11 +799,11 @@ export class PlatformService extends EventEmitter implements IPlatformService { } public getLatestApplicationPackageForDevice(platformData: IPlatformData, buildConfig: IBuildConfig, outputPath?: string): IApplicationPackage { - return this.getLatestApplicationPackage(outputPath || platformData.getDeviceBuildOutputPath(buildConfig), platformData.getValidPackageNames({ isForDevice: true, isReleaseBuild: buildConfig.release })); + return this.getLatestApplicationPackage(outputPath || platformData.deviceBuildOutputPath, platformData.getValidBuildOutputData({ isForDevice: true, isReleaseBuild: buildConfig.release })); } public getLatestApplicationPackageForEmulator(platformData: IPlatformData, buildConfig: IBuildConfig, outputPath?: string): IApplicationPackage { - return this.getLatestApplicationPackage(outputPath || platformData.emulatorBuildOutputPath || platformData.getDeviceBuildOutputPath(buildConfig), platformData.getValidPackageNames({ isForDevice: false, isReleaseBuild: buildConfig.release })); + return this.getLatestApplicationPackage(outputPath || platformData.emulatorBuildOutputPath || platformData.deviceBuildOutputPath, platformData.getValidBuildOutputData({ isForDevice: false, isReleaseBuild: buildConfig.release })); } private async updatePlatform(platform: string, version: string, platformTemplate: string, projectData: IProjectData, config: IPlatformOptions): Promise { @@ -813,7 +836,6 @@ export class PlatformService extends EventEmitter implements IPlatformService { } else { this.$errors.failWithoutHelp("Native Platform cannot be updated."); } - } private async updatePlatformCore(platformData: IPlatformData, updateOptions: IUpdatePlatformOptions, projectData: IProjectData, config: IPlatformOptions): Promise { diff --git a/test/platform-commands.ts b/test/platform-commands.ts index fc92b9b459..6c96874772 100644 --- a/test/platform-commands.ts +++ b/test/platform-commands.ts @@ -35,10 +35,8 @@ class PlatformData implements IPlatformData { }; emulatorServices: Mobile.IEmulatorPlatformServices = null; projectRoot = ""; - getDeviceBuildOutputPath = (buildTypeOption: IRelease) => { - return ""; - } - getValidPackageNames = (buildOptions: { isForDevice?: boolean, isReleaseBuild?: boolean }) => [""]; + deviceBuildOutputPath = ""; + getValidBuildOutputData = (buildOptions: IBuildOutputOptions) => ({ packageNames: [""] }); validPackageNamesForDevice: string[] = []; frameworkFilesExtensions = [".jar", ".dat"]; appDestinationDirectoryPath = ""; diff --git a/test/platform-service.ts b/test/platform-service.ts index 855bb1e1ae..8faa479779 100644 --- a/test/platform-service.ts +++ b/test/platform-service.ts @@ -88,7 +88,8 @@ function createTestInjector() { testInjector.register("projectChangesService", ProjectChangesLib.ProjectChangesService); testInjector.register("emulatorPlatformService", stubs.EmulatorPlatformService); testInjector.register("analyticsService", { - track: async (): Promise => undefined + track: async (): Promise => undefined, + trackEventActionInGoogleAnalytics: () => Promise.resolve() }); testInjector.register("messages", Messages); testInjector.register("devicePathProvider", {}); @@ -914,4 +915,86 @@ describe('Platform Service Tests', () => { assert.isFalse(warnings.indexOf("has errors") !== -1); }); }); + + describe("build", () => { + function mockData(buildOutput: string[], projectName: string): void { + mockPlatformsData(projectName); + mockFileSystem(buildOutput); + platformService.saveBuildInfoFile = () => undefined; + } + + function mockPlatformsData(projectName: string): void { + const platformsData = testInjector.resolve("platformsData"); + platformsData.getPlatformData = (platform: string) => { + return { + deviceBuildOutputPath: "", + platformProjectService: { + buildProject: () => Promise.resolve(), + on: () => ({}), + removeListener: () => ({}) + }, + getValidBuildOutputData: () => ({ + packageNames: ["app-debug.apk", "app-release.apk", `${projectName}-debug.apk`, `${projectName}-release.apk`], + regexes: [/app-.*-(debug|release).apk/, new RegExp(`${projectName}-.*-(debug|release).apk`)] + }) + }; + }; + } + + function mockFileSystem(enumeratedFiles: string[]): void { + const fs = testInjector.resolve("fs"); + fs.enumerateFilesInDirectorySync = () => enumeratedFiles; + fs.readDirectory = () => []; + fs.getFsStats = () => (({ mtime: new Date() })); + } + + describe("android platform", () => { + function getTestCases(configuration: string, apkName: string) { + return [{ + name: "no additional options are specified in .gradle file", + buildOutput: [`/my/path/${configuration}/${apkName}-${configuration}.apk`], + expectedResult: `/my/path/${configuration}/${apkName}-${configuration}.apk` + }, { + name: "productFlavors are specified in .gradle file", + buildOutput: [`/my/path/arm64Demo/${configuration}/${apkName}-arm64-demo-${configuration}.apk`, + `/my/path/arm64Full/${configuration}/${apkName}-arm64-full-${configuration}.apk`, + `/my/path/armDemo/${configuration}/${apkName}-arm-demo-${configuration}.apk`, + `/my/path/armFull/${configuration}/${apkName}-arm-full-${configuration}.apk`, + `/my/path/x86Demo/${configuration}/${apkName}-x86-demo-${configuration}.apk`, + `/my/path/x86Full/${configuration}/${apkName}-x86-full-${configuration}.apk`], + expectedResult: `/my/path/x86Full/${configuration}/${apkName}-x86-full-${configuration}.apk` + }, { + name: "split options are specified in .gradle file", + buildOutput: [`/my/path/${configuration}/${apkName}-arm64-v8a-${configuration}.apk`, + `/my/path/${configuration}/${apkName}-armeabi-v7a-${configuration}.apk`, + `/my/path/${configuration}/${apkName}-universal-${configuration}.apk`, + `/my/path/${configuration}/${apkName}-x86-${configuration}.apk`], + expectedResult: `/my/path/${configuration}/${apkName}-x86-${configuration}.apk` + }, { + name: "android-runtime has version < 4.0.0", + buildOutput: [`/my/path/apk/${apkName}-${configuration}.apk`], + expectedResult: `/my/path/apk/${apkName}-${configuration}.apk` + }]; + } + + const platform = "Android"; + const buildConfigs = [{buildForDevice: false}, {buildForDevice: true}]; + const apkNames = ["app", "testProj"]; + const configurations = ["debug", "release"]; + + _.each(apkNames, apkName => { + _.each(buildConfigs, buildConfig => { + _.each(configurations, configuration => { + _.each(getTestCases(configuration, apkName), testCase => { + it(`should find correct ${configuration} ${apkName}.apk when ${testCase.name} and buildConfig is ${JSON.stringify(buildConfig)}`, async () => { + mockData(testCase.buildOutput, apkName); + const actualResult = await platformService.buildPlatform(platform, buildConfig, {projectName: ""}); + assert.deepEqual(actualResult, testCase.expectedResult); + }); + }); + }); + }); + }); + }); + }); }); diff --git a/test/stubs.ts b/test/stubs.ts index 70f4e4b08d..c0a6ddfb07 100644 --- a/test/stubs.ts +++ b/test/stubs.ts @@ -304,10 +304,8 @@ export class PlatformProjectServiceStub extends EventEmitter implements IPlatfor platformProjectService: this, emulatorServices: undefined, projectRoot: "", - getDeviceBuildOutputPath: (buildTypeOption: IRelease) => { - return ""; - }, - getValidPackageNames: (buildOptions: { isForDevice?: boolean, isReleaseBuild?: boolean }) => [], + deviceBuildOutputPath: "", + getValidBuildOutputData: (buildOptions: { isForDevice?: boolean, isReleaseBuild?: boolean }) => ({ packageNames: [] }), frameworkFilesExtensions: [], appDestinationDirectoryPath: "", relativeToFrameworkConfigurationFilePath: "", @@ -417,10 +415,8 @@ export class PlatformsDataStub extends EventEmitter implements IPlatformsData { projectRoot: "", normalizedPlatformName: "", appDestinationDirectoryPath: "", - getDeviceBuildOutputPath: (buildTypeOption: IRelease) => { - return ""; - }, - getValidPackageNames: (buildOptions: { isForDevice?: boolean, isReleaseBuild?: boolean }) => [], + deviceBuildOutputPath: "", + getValidBuildOutputData: (buildOptions: { isForDevice?: boolean, isReleaseBuild?: boolean }) => ({ packageNames: []}), frameworkFilesExtensions: [], relativeToFrameworkConfigurationFilePath: "", fastLivesyncFileExtensions: [] From 24fd30529cf0b75e1b100f474eb0a813e2d9d81f Mon Sep 17 00:00:00 2001 From: fatme Date: Mon, 19 Mar 2018 08:21:37 +0200 Subject: [PATCH 2/3] Fix PR comments --- lib/services/ios-project-service.ts | 4 ++-- lib/services/platform-service.ts | 6 +++--- test/stubs.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/services/ios-project-service.ts b/lib/services/ios-project-service.ts index 9233827a3a..ee5d65a1de 100644 --- a/lib/services/ios-project-service.ts +++ b/lib/services/ios-project-service.ts @@ -72,8 +72,8 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ platformProjectService: this, emulatorServices: this.$iOSEmulatorServices, projectRoot: projectRoot, - deviceBuildOutputPath: path.join(projectRoot, "build", "device"), - emulatorBuildOutputPath: path.join(projectRoot, "build", "emulator"), + deviceBuildOutputPath: path.join(projectRoot, constants.BUILD_DIR, "device"), + emulatorBuildOutputPath: path.join(projectRoot, constants.BUILD_DIR, "emulator"), getValidBuildOutputData: (buildOptions: IBuildOutputOptions): IValidBuildOutputData => { if (buildOptions.isForDevice) { return { diff --git a/lib/services/platform-service.ts b/lib/services/platform-service.ts index 0056544f27..94cf094632 100644 --- a/lib/services/platform-service.ts +++ b/lib/services/platform-service.ts @@ -779,10 +779,10 @@ export class PlatformService extends EventEmitter implements IPlatformService { return packages.map(filepath => this.createApplicationPackage(filepath)); } - private createApplicationPackage(filepath: string): IApplicationPackage { + private createApplicationPackage(packageName: string): IApplicationPackage { return { - packageName: filepath, - time: this.$fs.getFsStats(filepath).mtime + packageName, + time: this.$fs.getFsStats(packageName).mtime }; } diff --git a/test/stubs.ts b/test/stubs.ts index c0a6ddfb07..c355a92939 100644 --- a/test/stubs.ts +++ b/test/stubs.ts @@ -305,7 +305,7 @@ export class PlatformProjectServiceStub extends EventEmitter implements IPlatfor emulatorServices: undefined, projectRoot: "", deviceBuildOutputPath: "", - getValidBuildOutputData: (buildOptions: { isForDevice?: boolean, isReleaseBuild?: boolean }) => ({ packageNames: [] }), + getValidBuildOutputData: (buildOptions: IBuildOutputOptions) => ({ packageNames: [] }), frameworkFilesExtensions: [], appDestinationDirectoryPath: "", relativeToFrameworkConfigurationFilePath: "", @@ -416,7 +416,7 @@ export class PlatformsDataStub extends EventEmitter implements IPlatformsData { normalizedPlatformName: "", appDestinationDirectoryPath: "", deviceBuildOutputPath: "", - getValidBuildOutputData: (buildOptions: { isForDevice?: boolean, isReleaseBuild?: boolean }) => ({ packageNames: []}), + getValidBuildOutputData: (buildOptions: IBuildOutputOptions) => ({ packageNames: []}), frameworkFilesExtensions: [], relativeToFrameworkConfigurationFilePath: "", fastLivesyncFileExtensions: [] From 6a912c0aba228d0dd7fca3d46026d9f50930ef76 Mon Sep 17 00:00:00 2001 From: Fatme Date: Tue, 20 Mar 2018 13:22:59 +0200 Subject: [PATCH 3/3] Ignore case when creating android project RegExp --- lib/services/android-project-service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/android-project-service.ts b/lib/services/android-project-service.ts index 4deed265ed..2558a2d8bb 100644 --- a/lib/services/android-project-service.ts +++ b/lib/services/android-project-service.ts @@ -94,7 +94,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject `${projectData.projectName}${constants.APK_EXTENSION_NAME}`, `${constants.APP_FOLDER_NAME}-${buildMode}${constants.APK_EXTENSION_NAME}` ], - regexes: [new RegExp(`${constants.APP_FOLDER_NAME}-.*-(${Configurations.Debug}|${Configurations.Release})${constants.APK_EXTENSION_NAME}`), new RegExp(`${packageName}-.*-(${Configurations.Debug}|${Configurations.Release})${constants.APK_EXTENSION_NAME}`)] + regexes: [new RegExp(`${constants.APP_FOLDER_NAME}-.*-(${Configurations.Debug}|${Configurations.Release})${constants.APK_EXTENSION_NAME}`, "i"), new RegExp(`${packageName}-.*-(${Configurations.Debug}|${Configurations.Release})${constants.APK_EXTENSION_NAME}`, "i")] }; }, frameworkFilesExtensions: [".jar", ".dat", ".so"],