Currently it is not easily possible to have different phrase configurations per flavor or multiple configurations for e.g. common strings and flavor specific strings.
The plugin relies one one phrase config that needs to be present when the tasks (check, clean, download, upload) are created. Therefore we cannot create custom tasks (e.g. <flavor>PhraseappDownload).
There are several issues:
- A global
phrase config needs to be present, even if I don't know what credentials to put in when I have different ones for different flavors
// Global definition needed
phraseapp { ... }
- A custom
phraseappDownload task won't take the specified custom phrase config, because the original task was already created with the global config before.
// Custom task
tasks.register<DefaultTask>("flavorPhraseappDownload") {
phraseapp { ... }
finalizedBy("phraseappDownload")
}
- When registering a new task of the same type as the original task with e.g.
tasks.register<phraseapp.DownloadTask>, it will complain about all the missing properties that would normally be passed in to the original task during its creation in the PhraseAppPlugin class. So we would need to set every single value and not only the mandatory ones. This could probably be a solution to achieve flavor specific configs but is cumbersome
// Task of same type
tasks.register<phraseapp.DownloadTask>("flavorPhraseappDownload") {
baseUrl.set(...)
projectId.set(...)
authToken.set(...)
resFolders.set(...)
platform.set(...)
output.set(...)
overrideDefaultFile.set(...)
exceptions.set(...)
placeholder.set(...)
localeNameRegex.set(...)
}
Currently it is not easily possible to have different phrase configurations per flavor or multiple configurations for e.g. common strings and flavor specific strings.
The plugin relies one one
phraseconfig that needs to be present when the tasks (check, clean, download, upload) are created. Therefore we cannot create custom tasks (e.g.<flavor>PhraseappDownload).There are several issues:
phraseconfig needs to be present, even if I don't know what credentials to put in when I have different ones for different flavorsphraseappDownloadtask won't take the specified customphraseconfig, because the original task was already created with the global config before.tasks.register<phraseapp.DownloadTask>, it will complain about all the missing properties that would normally be passed in to the original task during its creation in thePhraseAppPluginclass. So we would need to set every single value and not only the mandatory ones. This could probably be a solution to achieve flavor specific configs but is cumbersome