Skip to content

Support multiple configurations e.g for flavors #9

@jakobulbrich

Description

@jakobulbrich

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:

  1. 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 { ... }
  1. 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")
}
  1. 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(...)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions