Skip to content

Commit bcba5fb

Browse files
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).
1 parent 373c6bb commit bcba5fb

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/services/android-project-service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,10 @@ class AndroidProjectService implements IPlatformProjectService {
185185
public prepareAppResources(appResourcesDirectoryPath: string): IFuture<void> {
186186
return (() => {
187187
let resourcesDirPath = path.join(appResourcesDirectoryPath, this.platformData.normalizedPlatformName);
188-
let resourcesDirs = this.$fs.readDirectory(resourcesDirPath).wait();
188+
let valuesDirRegExp = /^values/;
189+
let resourcesDirs = this.$fs.readDirectory(resourcesDirPath).wait().filter(resDir => !resDir.match(valuesDirRegExp));
189190
_.each(resourcesDirs, resourceDir => {
190-
this.$fs.deleteDirectory(path.join(this.platformData.appResourcesDestinationDirectoryPath, resourceDir)).wait();
191+
this.$fs.deleteDirectory(path.join(this.platformData.appResourcesDestinationDirectoryPath, resourceDir)).wait();
191192
});
192193
}).future<void>()();
193194
}

lib/services/platform-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export class PlatformService implements IPlatformService {
173173
var appResourcesDirectoryPath = path.join(appDestinationDirectoryPath, constants.APP_RESOURCES_FOLDER_NAME);
174174
if (this.$fs.exists(appResourcesDirectoryPath).wait()) {
175175
platformData.platformProjectService.prepareAppResources(appResourcesDirectoryPath).wait();
176-
shell.cp("-R", path.join(appResourcesDirectoryPath, platformData.normalizedPlatformName, "*"), platformData.appResourcesDestinationDirectoryPath);
176+
shell.cp("-Rf", path.join(appResourcesDirectoryPath, platformData.normalizedPlatformName, "*"), platformData.appResourcesDestinationDirectoryPath);
177177
this.$fs.deleteDirectory(appResourcesDirectoryPath).wait();
178178
}
179179

0 commit comments

Comments
 (0)