Skip to content

Commit 869bd74

Browse files
Replace plugin variables in all Android .xml files
In case a plugin has plugin variable, during project preparation CLI replaces the usage of the variable in plugin's AndroidManifest with the value set in the current project's package.json. This is not enough, we have to set the variables in all plugin's .xml files, so the value could be used in resource and later read from the JAVA code. Enumarate plugin's files and replace plugin variables in all .xml files.
1 parent 5f3be6e commit 869bd74

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/services/android-project-service.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,11 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
327327
this.$fs.ensureDirectoryExists(resourcesDestinationDirectoryPath).wait();
328328
shell.cp("-Rf", path.join(pluginPlatformsFolderPath, "*"), resourcesDestinationDirectoryPath);
329329

330-
let pluginConfigurationFilePath = path.join(resourcesDestinationDirectoryPath, this.platformData.configurationFileName);
331-
if (this.$fs.exists(pluginConfigurationFilePath).wait()) {
332-
this.$pluginVariablesService.interpolate(pluginData, pluginConfigurationFilePath).wait();
333-
}
330+
let files = this.$fs.enumerateFilesInDirectorySync(resourcesDestinationDirectoryPath, file => this.$fs.getFsStats(file).wait().isDirectory() || path.extname(file) === ".xml");
331+
_.each(files, file => {
332+
this.$logger.trace(`Interpolate data for plugin file: ${file}`);
333+
this.$pluginVariablesService.interpolate(pluginData, file).wait();
334+
});
334335
}
335336

336337
// Copy include.gradle file

0 commit comments

Comments
 (0)