use jruby for android
This commit is contained in:
parent
b52de34ce9
commit
b610e30065
1 changed files with 27 additions and 8 deletions
35
README.md
35
README.md
|
@ -174,14 +174,33 @@ Now, whenever you build your application, Xcode will automatically invoke Twine
|
|||
|
||||
### Android Studio/Gradle
|
||||
|
||||
Add the following task at the top level in app/build.gradle:
|
||||
Add the following code at the top level in app/build.gradle:
|
||||
```
|
||||
task generateLocalizations {
|
||||
String script = 'if hash twine 2>/dev/null; then twine generate-localization-file twine.txt ./src/main/res/values/generated_strings.xml; fi'
|
||||
exec {
|
||||
executable "sh"
|
||||
args '-c', script
|
||||
}
|
||||
buildscript {
|
||||
repositories { jcenter() }
|
||||
|
||||
dependencies {
|
||||
/* check jruby-gradle.org for the latest release */
|
||||
classpath "com.github.jruby-gradle:jruby-gradle-plugin:1.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'com.github.jruby-gradle.base'
|
||||
|
||||
dependencies {
|
||||
jrubyExec 'rubygems:twine:1.0.3'
|
||||
}
|
||||
|
||||
|
||||
task generateLocalizations (type: JRubyExec) {
|
||||
dependsOn jrubyPrepare
|
||||
jrubyArgs '-S'
|
||||
script "twine"
|
||||
scriptArgs 'generate-localization-file', 'twine.txt', './src/main/res/values/generated_strings.xml'
|
||||
}
|
||||
|
||||
preBuild {
|
||||
dependsOn generateLocalizations
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -224,4 +243,4 @@ Many thanks to all of the contributors to the Twine project, including:
|
|||
[djangopo]: https://docs.djangoproject.com/en/dev/topics/i18n/translation/
|
||||
[tizen]: https://developer.tizen.org/documentation/articles/localization
|
||||
[flash]: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/resources/IResourceManager.html#getString()
|
||||
[printf]: https://en.wikipedia.org/wiki/Printf_format_string
|
||||
[printf]: https://en.wikipedia.org/wiki/Printf_format_string
|
||||
|
|
Reference in a new issue