From bcba5fbf17d95719643ce298b0b0c06c3b0cc80c Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Mon, 13 Jul 2015 18:11:51 +0300 Subject: [PATCH] Do not delete values dirs During project preparation, we should not delete values directories as they contain specific information, which is important for android builds (strings.xml file for example). --- lib/services/android-project-service.ts | 5 +++-- lib/services/platform-service.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/services/android-project-service.ts b/lib/services/android-project-service.ts index 1561015c85..8f91e6f073 100644 --- a/lib/services/android-project-service.ts +++ b/lib/services/android-project-service.ts @@ -185,9 +185,10 @@ class AndroidProjectService implements IPlatformProjectService { public prepareAppResources(appResourcesDirectoryPath: string): IFuture { return (() => { let resourcesDirPath = path.join(appResourcesDirectoryPath, this.platformData.normalizedPlatformName); - let resourcesDirs = this.$fs.readDirectory(resourcesDirPath).wait(); + let valuesDirRegExp = /^values/; + let resourcesDirs = this.$fs.readDirectory(resourcesDirPath).wait().filter(resDir => !resDir.match(valuesDirRegExp)); _.each(resourcesDirs, resourceDir => { - this.$fs.deleteDirectory(path.join(this.platformData.appResourcesDestinationDirectoryPath, resourceDir)).wait(); + this.$fs.deleteDirectory(path.join(this.platformData.appResourcesDestinationDirectoryPath, resourceDir)).wait(); }); }).future()(); } diff --git a/lib/services/platform-service.ts b/lib/services/platform-service.ts index cd56ec2a34..df0ca19511 100644 --- a/lib/services/platform-service.ts +++ b/lib/services/platform-service.ts @@ -173,7 +173,7 @@ export class PlatformService implements IPlatformService { var appResourcesDirectoryPath = path.join(appDestinationDirectoryPath, constants.APP_RESOURCES_FOLDER_NAME); if (this.$fs.exists(appResourcesDirectoryPath).wait()) { platformData.platformProjectService.prepareAppResources(appResourcesDirectoryPath).wait(); - shell.cp("-R", path.join(appResourcesDirectoryPath, platformData.normalizedPlatformName, "*"), platformData.appResourcesDestinationDirectoryPath); + shell.cp("-Rf", path.join(appResourcesDirectoryPath, platformData.normalizedPlatformName, "*"), platformData.appResourcesDestinationDirectoryPath); this.$fs.deleteDirectory(appResourcesDirectoryPath).wait(); }