A Gradle plugin for PhraseApp to receive/download/update strings in your Android application.
You have to apply this plugin into your top-level build.gradle[.kts]
file and
set up the phraseApp
extension:
buildscript {
repositories {
maven {
url = uri("https://maven.pkg.github.com/GCX-HCI/grandcentrix-PhraseAppGradlePlugin")
}
}
dependencies {
classpath 'net.grandcentrix:phraseappgradleplugin:1.0.0'
}
}
apply plugin: 'net.grandcentrix.phraseapp'
phraseApp {
projectId = "projectId"
userToken = "userToken"
destinationDir = file("app/src/main/res/")
languages = [new Language("phraseapp-en-id-xxx", "values"), new Language("phraseapp-de-id-xxx", "values-de")]
tags = ["android", "common"]
}
Kotlin DSL:
buildscript {
repositories {
maven {
url = uri("https://maven.pkg.github.com/GCX-HCI/grandcentrix-PhraseAppGradlePlugin")
}
}
dependencies {
classpath("net.grandcentrix:phraseappgradleplugin:1.0.0")
}
}
apply(plugin = "net.grandcentrix.phraseapp")
configure<PhraseAppExtension> {
projectId.set("projectId")
userToken.set("userToken")
destinationDir.set(file("app/src/main/res/"))
languages.set(listOf(Language("phraseapp-en-id-xxx", "values"), Language("phraseapp-de-id-xxx", "values-de")))
tags.set(listOf("android", "common"))
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'net.grandcentrix:PhraseAppGradlePlugin:1.0.0'
}
}
apply plugin: 'net.grandcentrix.phraseapp'
phraseApp {
projectId = "projectId"
userToken = "userToken"
destinationDir = file("app/src/main/res/")
languages = [new Language("phraseapp-en-id-xxx", "values"), new Language("phraseapp-de-id-xxx", "values-de")]
tags = ["android", "common"]
}
Kotlin DSL:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath("net.grandcentrix:PhraseAppGradlePlugin:1.0.0")
}
}
apply(plugin = "net.grandcentrix.phraseapp")
configure<PhraseAppExtension> {
projectId.set("projectId")
userToken.set("userToken")
destinationDir.set(file("app/src/main/res/"))
languages.set(listOf(Language("phraseapp-en-id-xxx", "values"), Language("phraseapp-de-id-xxx", "values-de")))
tags.set(listOf("android", "common"))
}
Beside of the tags all properties are required!
You can then update your strings with the updateStrings
tasks.
Note: This task does always a network call an can't be cached! Therefore make sure you use it only if required.
Copyright 2019 grandcentrix GmbH
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.