Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

A Gradle plugin to download strings from PhraseApp

License

Notifications You must be signed in to change notification settings

GCX-HCI/grandcentrix-PhraseAppGradlePlugin

Repository files navigation

DEPRECATED - no longer actively maintained

License Download Build Status

PhraseAppGradlePlugin

A Gradle plugin for PhraseApp to receive/download/update strings in your Android application.

Usage

You have to apply this plugin into your top-level build.gradle[.kts] file and set up the phraseApp extension:

GitHub Packages

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"))
}

JCenter (deprecated)

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.

License

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.

About

A Gradle plugin to download strings from PhraseApp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages