add: xgettext and po2js tasks
This commit is contained in:
parent
b91ee88304
commit
244b92d750
2 changed files with 41 additions and 10 deletions
49
build.gradle
49
build.gradle
|
@ -65,6 +65,11 @@ dependencies {
|
||||||
implementation 'xmlrpc:xmlrpc:2.0.1'
|
implementation 'xmlrpc:xmlrpc:2.0.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def rhinoJar = configurations.library.files.find { jar ->
|
||||||
|
jar.name.startsWith('rhino')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
startScripts {
|
startScripts {
|
||||||
applicationName = 'helma'
|
applicationName = 'helma'
|
||||||
classpath = files('../launcher.jar')
|
classpath = files('../launcher.jar')
|
||||||
|
@ -196,8 +201,8 @@ task update {
|
||||||
}
|
}
|
||||||
|
|
||||||
task jsdoc(type: Exec) {
|
task jsdoc(type: Exec) {
|
||||||
|
description 'Generates JSDoc API documentation for the included JavaScript modules.'
|
||||||
group 'Documentation'
|
group 'Documentation'
|
||||||
description 'Generates JSDoc API documentation for the included JavaScript modules'
|
|
||||||
|
|
||||||
def sources = ['modules/core', 'modules/helma', 'modules/jala/code']
|
def sources = ['modules/core', 'modules/helma', 'modules/jala/code']
|
||||||
def destination = "${project.buildDir}/docs/jsdoc"
|
def destination = "${project.buildDir}/docs/jsdoc"
|
||||||
|
@ -214,13 +219,41 @@ task jsdoc(type: Exec) {
|
||||||
ignoreExitValue true
|
ignoreExitValue true
|
||||||
}
|
}
|
||||||
|
|
||||||
task rhinoShell(type: JavaExec) {
|
task xgettext(type: JavaExec) {
|
||||||
group 'Application'
|
description 'Extracts translatable message strings from source code.'
|
||||||
description 'Runs the interactive Rhino JavaScript shell'
|
group 'i18n'
|
||||||
|
|
||||||
def rhinoJar = configurations.library.files.find { jar ->
|
classpath = files('launcher.jar')
|
||||||
jar.name.startsWith('rhino')
|
main = 'helma.main.launcher.Commandline'
|
||||||
}
|
|
||||||
|
// TODO: Decouple from Antville app
|
||||||
|
args = [
|
||||||
|
// Root.extractMessages is currently located in antville/code/Global/i18n.js
|
||||||
|
'antville.extractMessages',
|
||||||
|
'modules/jala/util/HopKit/scripts/MessageParser.js',
|
||||||
|
'code compat',
|
||||||
|
'apps/antville/i18n/antville.pot'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
task po2js(type: JavaExec) {
|
||||||
|
description 'Converts translated message strings from PO format to JavaScript.'
|
||||||
|
group 'i18n'
|
||||||
|
|
||||||
|
classpath = files(rhinoJar)
|
||||||
|
main = 'org.mozilla.javascript.tools.shell.Main'
|
||||||
|
|
||||||
|
// TODO: Decouple from Antville app
|
||||||
|
args = [
|
||||||
|
'modules/jala/util/HopKit/scripts/PoParser.js',
|
||||||
|
'apps/antville/i18n',
|
||||||
|
'apps/antville/i18n'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
task rhinoShell(type: JavaExec) {
|
||||||
|
description 'Runs the interactive Rhino JavaScript shell.'
|
||||||
|
group 'Application'
|
||||||
|
|
||||||
classpath = files(rhinoJar)
|
classpath = files(rhinoJar)
|
||||||
main = 'org.mozilla.javascript.tools.shell.Main'
|
main = 'org.mozilla.javascript.tools.shell.Main'
|
||||||
|
@ -231,8 +264,8 @@ task rhinoShell(type: JavaExec) {
|
||||||
// Call this task with a function definition using the `-P` parameter, e.g.
|
// Call this task with a function definition using the `-P` parameter, e.g.
|
||||||
// `./gradlew commandLine -Pfunction=manage.getAllApplications`
|
// `./gradlew commandLine -Pfunction=manage.getAllApplications`
|
||||||
task commandLine(type: JavaExec) {
|
task commandLine(type: JavaExec) {
|
||||||
|
description 'Runs a function in a Helma application with `-Pfunction=app.functionName`.'
|
||||||
group 'Application'
|
group 'Application'
|
||||||
description 'Runs a function in a Helma application with `-Pfunction=app.functionName`'
|
|
||||||
|
|
||||||
classpath = files('launcher.jar')
|
classpath = files('launcher.jar')
|
||||||
main = 'helma.main.launcher.Commandline'
|
main = 'helma.main.launcher.Commandline'
|
||||||
|
|
|
@ -3,5 +3,3 @@ jar {
|
||||||
from 'src/main/java/helma/main/launcher/manifest.txt'
|
from 'src/main/java/helma/main/launcher/manifest.txt'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//startScripts.enabled = false
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue