Switch to tasks.register() to define custom tasks

This commit is contained in:
Tobi Schäfer 2024-06-15 23:06:35 +02:00
parent 87675fd6cd
commit 608fd695c4
Signed by: tobi
GPG key ID: 91FAE6FE2EBAC4C8
5 changed files with 11 additions and 11 deletions

View file

@ -156,7 +156,7 @@ installDist {
dependsOn build dependsOn build
} }
task processSource(type: Sync) { tasks.register('processSource', Sync) {
def gitOutput = new ByteArrayOutputStream() def gitOutput = new ByteArrayOutputStream()
exec { exec {
@ -175,7 +175,7 @@ task processSource(type: Sync) {
} into "${project.buildDir}/src" } into "${project.buildDir}/src"
} }
task update { tasks.register('update') {
dependsOn installDist dependsOn installDist
def rsyncArgs = ['--archive', '--filter', '- backups'] def rsyncArgs = ['--archive', '--filter', '- backups']
@ -221,7 +221,7 @@ task update {
} }
} }
task jsdoc(type: Exec) { tasks.register('jsdoc', Exec) {
description 'Generates JSDoc API documentation for the included JavaScript modules.' description 'Generates JSDoc API documentation for the included JavaScript modules.'
group 'Documentation' group 'Documentation'
@ -235,7 +235,7 @@ task jsdoc(type: Exec) {
args = ['jsdoc', '-d', "$destination"].plus(sources) args = ['jsdoc', '-d', "$destination"].plus(sources)
} }
task xgettext(type: JavaExec) { tasks.register('xgettext', JavaExec) {
description 'Extracts translatable message strings from source code.' description 'Extracts translatable message strings from source code.'
group 'i18n' group 'i18n'
@ -252,7 +252,7 @@ task xgettext(type: JavaExec) {
] ]
} }
task po2js(type: JavaExec) { tasks.register('po2js', JavaExec) {
description 'Converts translated message strings from PO format to JavaScript.' description 'Converts translated message strings from PO format to JavaScript.'
group 'i18n' group 'i18n'
@ -267,7 +267,7 @@ task po2js(type: JavaExec) {
] ]
} }
task rhinoShell(type: JavaExec) { tasks.register('rhinoShell', JavaExec) {
description 'Runs the interactive Rhino JavaScript shell.' description 'Runs the interactive Rhino JavaScript shell.'
group 'Application' group 'Application'
@ -279,7 +279,7 @@ 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) { tasks.register('commandLine', JavaExec) {
description 'Runs a function in a Helma application with `-Pfunction=app.functionName`.' description 'Runs a function in a Helma application with `-Pfunction=app.functionName`.'
group 'Application' group 'Application'

View file

@ -12,7 +12,7 @@ processResources.enabled = false
processTestResources.enabled = false processTestResources.enabled = false
test.enabled = false test.enabled = false
task deps(type: Copy) { tasks.register('deps', Copy) {
from sourceSets.main.runtimeClasspath from sourceSets.main.runtimeClasspath
into '.' into '.'
} }

View file

@ -15,7 +15,7 @@ processResources.enabled = false
processTestResources.enabled = false processTestResources.enabled = false
test.enabled = false test.enabled = false
task deps(type: Copy) { tasks.register('deps', Copy) {
from sourceSets.main.runtimeClasspath from sourceSets.main.runtimeClasspath
into 'lib' into 'lib'
} }

View file

@ -10,7 +10,7 @@ processResources.enabled = false
processTestResources.enabled = false processTestResources.enabled = false
test.enabled = false test.enabled = false
task deps(type: Copy) { tasks.register('deps', Copy) {
from sourceSets.main.runtimeClasspath from sourceSets.main.runtimeClasspath
into 'lib' into 'lib'
} }

View file

@ -10,7 +10,7 @@ processResources.enabled = false
processTestResources.enabled = false processTestResources.enabled = false
test.enabled = false test.enabled = false
task deps(type: Copy) { tasks.register('deps', Copy) {
from sourceSets.main.runtimeClasspath from sourceSets.main.runtimeClasspath
into 'code' into 'code'
} }