This is an automated email from the ASF dual-hosted git repository.

benw pushed a commit to branch gradle-improvements
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git

commit 753cc26a77cf827fb8e7122839cee4ac8fe10696
Author: Ben Weidig <[email protected]>
AuthorDate: Sat Aug 16 12:25:27 2025 +0200

    TAP5-2809: more modern gradle syntax/features
---
 beanmodel/build.gradle                 | 15 ++++--
 build.gradle                           | 70 +++++++++++++++------------
 plastic/build.gradle                   |  8 +++-
 quickstart/build.gradle                | 53 ++++++++++++---------
 tapestry-beanvalidator/build.gradle    |  8 +++-
 tapestry-core/build.gradle             | 87 ++++++++++++++++++++++------------
 tapestry-hibernate/build.gradle        | 11 +++--
 tapestry-http/build.gradle             |  6 ++-
 tapestry-ioc-jcache/build.gradle       |  2 +-
 tapestry-ioc/build.gradle              |  2 +-
 tapestry-jpa/build.gradle              | 10 ++--
 tapestry-json/build.gradle             |  2 +-
 tapestry-kaptcha/build.gradle          |  2 +-
 tapestry-openapi-viewer/build.gradle   |  2 +-
 tapestry-rest-jackson/build.gradle     |  4 +-
 tapestry-spring/build.gradle           | 22 ++++-----
 tapestry-upload/build.gradle           |  2 +-
 tapestry-version-migrator/build.gradle |  2 +-
 tapestry-webresources/build.gradle     | 15 +++---
 19 files changed, 194 insertions(+), 129 deletions(-)

diff --git a/beanmodel/build.gradle b/beanmodel/build.gradle
index 3e5ec01fe..68391ae01 100644
--- a/beanmodel/build.gradle
+++ b/beanmodel/build.gradle
@@ -23,9 +23,11 @@ dependencies {
     testImplementation libs.spock.core
 }
 
-clean.delete generateGrammarSource.outputDirectory
+tasks.named('clean') {
+    delete generateGrammarSource.outputDirectory
+}
 
-compileJava {
+tasks.named('compileJava', JavaCompile) {
     dependsOn generateGrammarSource
     options.fork = true
     options.forkOptions.memoryMaximumSize = '512M'
@@ -33,6 +35,13 @@ compileJava {
 
 tasks.named('sourcesJar') {
     dependsOn 'generateGrammarSource'
+    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
 }
 
-sourceSets.main.java.srcDirs += generateGrammarSource.outputDirectory
+sourceSets {
+    main {
+        java {
+            srcDir generateGrammarSource.outputDirectory
+        }
+    }
+}
diff --git a/build.gradle b/build.gradle
index 6a03cbbfb..5ace0cef1 100755
--- a/build.gradle
+++ b/build.gradle
@@ -81,6 +81,9 @@ configurations {
 dependencies {
     if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) {
         javadoc project(':tapestry-javadoc')
+        meta providers.provider {
+            tasks.named('aggregateJavadoc').get().outputs.files
+        }
     }
 
     // From tapestry-ioc:
@@ -116,7 +119,9 @@ subprojects {
         }
     }
 
-    assemble.dependsOn(processResources, compileJava, jar)
+    tasks.named('assemble') {
+        dependsOn processResources, compileJava, jar
+    }
 
     artifacts {
         archives sourcesJar
@@ -215,7 +220,7 @@ subprojects {
         }
     }
 
-    task uploadPublished {
+    tasks.register('uploadPublished') {
         doFirst {
             if (!canDeploy) {
                 throw new InvalidUserDataException("Missing upload 
credentials. Set '${deployUsernameProperty}' and '${deployPasswordProperty}' 
root project properties.")
@@ -228,12 +233,13 @@ subprojects {
 // Cribbed from 
https://github.com/hibernate/hibernate-core/blob/master/release/release.gradle#L19
 
 tasks.register('aggregateJavadoc', Javadoc) {
-    dependsOn configurations.javadoc
     group = 'Documentation'
     description = 'Build the aggregated JavaDocs for all modules'
 
+    dependsOn configurations.javadoc
+
     maxMemory = '512m'
-    destinationDir = file("${buildDir}/documentation/javadocs")
+    destinationDir = 
layout.buildDirectory.dir('documentation/javadocs').get().asFile
 
     def tapestryStylesheet = file('src/javadoc/stylesheet7.css')
     int thisYear = java.time.Year.now().getValue()
@@ -310,13 +316,10 @@ tasks.register('typeScriptDocs') {
     dependsOn(project(':tapestry-core').tasks.named('generateTypeScriptDocs'))
 }
 
-dependencies {
-    if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) {
-        meta aggregateJavadoc.outputs.files
-    }
-}
-
 tasks.register('combinedJacocoReport', JacocoReport) {
+    group = 'Verification'
+    description = 'Generates combined JaCoCo coverage report for all 
subprojects'
+    
     def excludedProjects = [
         'quickstart',
         'beanmodel',
@@ -347,7 +350,7 @@ tasks.register('combinedJacocoReport', JacocoReport) {
     reports {
         html {
             required = true
-            destination = file("${buildDir}/reports/jacoco")
+            outputLocation = layout.buildDirectory.dir('reports/jacoco')
         }
         xml.required = false
         csv.required = false
@@ -356,7 +359,7 @@ tasks.register('combinedJacocoReport', JacocoReport) {
 
 tasks.register('continuousIntegration') {
     group = 'Verification'
-    description 'Runs a full CI build: assembles all artifacts, runs all 
checks, and generates aggregate reports.'
+    description = 'Runs a full CI build: assembles all artifacts, runs all 
checks, and generates aggregate reports.'
 
     def dependants = [
         'tapestry-core:testWithPrototypeAndRequireJsDisabled',
@@ -376,12 +379,12 @@ tasks.register('continuousIntegration') {
 
 
 tasks.register('zippedSources', Zip) {
-    description "Creates a combined Zip file of all sub-project's sources"
-    group 'Release artifact'
+    group = 'Release artifact'
+    description = "Creates a combined Zip file of all sub-project's sources"
     
-    dependsOn('tapestry-core:compileTypeScript')
+    dependsOn 'tapestry-core:compileTypeScript'
 
-    destinationDirectory = buildDir
+    destinationDirectory = layout.buildDirectory
     archiveBaseName = 'apache-tapestry'
     version project.version
     archiveClassifier = 'sources'
@@ -400,45 +403,46 @@ tasks.register('zippedSources', Zip) {
     exclude '**/es-modules/***.js'
 }
 
-task zippedApidoc(type: Zip) {
-    description "Zip archive of the project's aggregate JavaDoc and TypeScript 
documentation"
-    group 'Release artifact'
+tasks.register('zippedApidoc', Zip) {
+    group = 'Release artifact'
+    description = "Zip archive of the project's aggregate JavaDoc and 
TypeScript documentation"
 
-    dependsOn(typeScriptDocs)
-    dependsOn(aggregateJavadoc)
+    dependsOn typeScriptDocs
+    dependsOn aggregateJavadoc
 
-    destinationDirectory = buildDir
+    destinationDirectory = layout.buildDirectory
     archiveBaseName = 'apache-tapestry'
     version project.version
     archiveClassifier = 'apidocs'
 
-    from file('src/docroot-template'), {
+    from(file('src/docroot-template')) {
         filter ReplaceTokens, tokens: [version: project.version]
         include '*.html'
     }
 
-    from file('src/docroot-template'), {
+    from(file('src/docroot-template')) {
         exclude '*.html'
     }
 
-    into 'apidocs', {
+    into('apidocs') {
         from aggregateJavadoc.outputs.files
     }
 
-    into 'typescript', {
+    into('typescript') {
         from typeScriptDocs.outputs.files
     }
 }
 
 tasks.register('zippedBinaries', Zip) {
+    group 'Release artifact'
     description 'Zip archive of binaries of each sub-project'
+
     // TODO: Plus dependencies?
-    group 'Release artifact'
     // This may create a few unwanted dependencies, but does
     // seem to ensure that the subprojects are created
     inputs.files subprojects*.configurations*.archives.artifacts.files
 
-    destinationDirectory = buildDir
+    destinationDirectory = layout.buildDirectory
     archiveBaseName = 'apache-tapestry'
     version project.version
     archiveClassifier = 'bin'
@@ -480,12 +484,12 @@ if (canDeploy) {
         upload.extendsFrom archives, signatures
     }
 
-    task generateChecksums(type: GenerateChecksums) {
+    tasks.register('generateChecksums', GenerateChecksums) {
         group 'Release artifact'
         description 'Creates MD5/SHA256 checksums for archives of source and 
JavaDoc'
 
         source tasks.withType(Zip)
-        outputDir = file("${buildDir}/checksums")
+        outputDir = layout.buildDirectory.dir('checksums')
     }
 
     // This requires that you have the apacheArchivesFolder property 
configured in your
@@ -513,13 +517,17 @@ if (canDeploy) {
     }
 
     tasks.register('generateRelease') {
-        dependsOn subprojects.assemble, subprojects.uploadPublished, 
subprojects.publish, copyArchives
         group 'Release artifact'
         description 'Generates and uploads a final release to Apache Nexus and 
copies archives for deployment'
+
+        dependsOn subprojects.assemble, subprojects.uploadPublished, 
subprojects.publish, copyArchives
     }
 }
 
 tasks.register('updateBootstrap') {
+    group = 'Maintenance'
+    description = 'Updates the included Bootstrap dependencies from GitHub'
+
     doLast {
         def bootstrapVersion = '3.3.7'
         def target = new File(temporaryDir, 'bootstrap.zip')
diff --git a/plastic/build.gradle b/plastic/build.gradle
index b8a53e12f..b4a60dfb7 100644
--- a/plastic/build.gradle
+++ b/plastic/build.gradle
@@ -9,4 +9,10 @@ dependencies {
 }
 
 // add vendored ASM
-sourceSets.main.java.srcDir 'src/external/java'
+sourceSets {
+    main {
+        java {
+            srcDir 'src/external/java'
+        }
+    }
+}
\ No newline at end of file
diff --git a/quickstart/build.gradle b/quickstart/build.gradle
index 6d300bb24..69dfa88a8 100644
--- a/quickstart/build.gradle
+++ b/quickstart/build.gradle
@@ -1,50 +1,55 @@
 import org.apache.tools.ant.filters.FixCrLfFilter
 import org.apache.tools.ant.filters.ReplaceTokens
 
-task copyGradleWrapper(type: Copy) {
-    ext.srcDir = file("$buildDir/wrapper")
+tasks.register('copyGradleWrapper', Copy) {
+    group = 'Build Setup'
+    description = 'Copies Gradle wrapper files to archetype resources'
 
+    def srcDir = layout.buildDirectory.dir('wrapper')
     inputs.dir srcDir
-    outputs.dir file("$buildDir/resources/main/archetype-resources")
+    outputs.dir layout.buildDirectory.dir('resources/main/archetype-resources')
 
     from srcDir
-    into file("$buildDir/resources/main/archetype-resources")
-
+    into layout.buildDirectory.dir('resources/main/archetype-resources')
     exclude '.gradle'
 }
 
-task addGradleWrapper(type: Exec) {
-    workingDir "$buildDir/wrapper"
-    commandLine "${rootProject.projectDir}/gradlew", 'wrapper', 
'--gradle-version', '8.14.2'
+tasks.register('addGradleWrapper', Exec) {
+    group = 'Build Setup'
+    description = 'Generates Gradle wrapper in temporary directory'
 
+    workingDir = layout.buildDirectory.dir('wrapper')
+    commandLine = ["${rootProject.projectDir}/gradlew", 'wrapper', 
'--gradle-version', '8.14.2']
     standardOutput = new ByteArrayOutputStream()
 
-    ext.output = {
-        return standardOutput.toString()
-    }
-
     doFirst {
-        def wrapperDirectory = new File(buildDir, 'wrapper')
+        def wrapperDirectory = 
layout.buildDirectory.dir('wrapper').get().asFile
         wrapperDirectory.mkdirs()
 
         def settings = new File(wrapperDirectory, 'settings.gradle')
-        new FileOutputStream(settings).close()
+        settings.createNewFile()
     }
 
-    finalizedBy 'copyGradleWrapper'
+    finalizedBy copyGradleWrapper
 }
 
-task addWrappers(dependsOn: [addGradleWrapper]) {
+tasks.register('addWrappers') {
+    group = 'Build Setup'
+    description = 'Coordinates wrapper generation tasks'
+
+    dependsOn addGradleWrapper
 }
 
-task processFiltered(type: Copy) {
-    ext.srcDir = file('src/main/resources-filtered')
+tasks.register('processFiltered', Copy) {
+    group = 'Build'
+    description = 'Processes filtered resources with token replacement'
 
+    def srcDir = layout.projectDirectory.dir('src/main/resources-filtered')
     inputs.dir srcDir
-    outputs.dir sourceSets.main.output.resourcesDir
+    outputs.dir layout.buildDirectory.dir('resources/main')
 
     from srcDir
-    into sourceSets.main.output.resourcesDir
+    into layout.buildDirectory.dir('resources/main')
 
     filter(FixCrLfFilter)
     filter(ReplaceTokens, tokens: [
@@ -65,8 +70,10 @@ task processFiltered(type: Copy) {
     ])
 }
 
-processResources.dependsOn([addWrappers, processFiltered])
+tasks.named('processResources') {
+    dependsOn addWrappers, processFiltered
+}
 
-jar {
-    dependsOn(copyGradleWrapper)
+tasks.named('jar') {
+    dependsOn copyGradleWrapper
 }
diff --git a/tapestry-beanvalidator/build.gradle 
b/tapestry-beanvalidator/build.gradle
index cebf92705..bee604967 100644
--- a/tapestry-beanvalidator/build.gradle
+++ b/tapestry-beanvalidator/build.gradle
@@ -21,10 +21,14 @@ dependencies {
 }
 
 // Start up the test app, useful when debugging failing integration tests
-task runTestApp303(type:JavaExec) {
+tasks.register('runTestApp303', JavaExec) {
     mainClass = 'org.apache.tapestry5.test.JettyRunner'
     args '-d', 'src/test/webapp', '-p', '8080'
     classpath += project.sourceSets.test.runtimeClasspath
 }
 
-jar.manifest.attributes 'Tapestry-Module-Classes': 
'org.apache.tapestry5.beanvalidator.modules.BeanValidatorModule'
+tasks.named('jar', Jar) {
+    manifest {
+        attributes 'Tapestry-Module-Classes': 
'org.apache.tapestry5.beanvalidator.modules.BeanValidatorModule'
+    }
+}
diff --git a/tapestry-core/build.gradle b/tapestry-core/build.gradle
index fb0c442ef..1b7d89108 100644
--- a/tapestry-core/build.gradle
+++ b/tapestry-core/build.gradle
@@ -8,8 +8,8 @@ import org.apache.tools.ant.filters.ReplaceTokens
 
 description = 'Central module for Tapestry, containing all core services and 
components'
 
-def mainGeneratedDir = 'src/main/generated'
-def testGeneratedDir = 'src/test/generated'
+def npmWorkingDir = 'src/main/typescript/'
+def npmExec = TapestryBuildLogic.isWindows() ? 'npm.cmd' : 'npm'
 
 dependencies {
     api project(':tapestry-ioc')
@@ -35,19 +35,17 @@ dependencies {
     testRuntimeOnly libs.guice
 }
 
-def npmWorkingDir = 'src/main/typescript/'
-def npmExec = TapestryBuildLogic.isWindows() ? 'npm.cmd' : 'npm'
-
 tasks.register('npmInstall', Exec) {
-    group 'TypeScript'
-    description "Runs npm install"
+    group = 'TypeScript'
+    description = 'Runs npm install'
     
     workingDir = npmWorkingDir
     commandLine npmExec, 'install'
 }
 
 tasks.register('compileTypeScriptToAmd', Exec) {
-    group 'TypeScript'
+    group = 'TypeScript'
+    description = 'Compiles TypeScript to AMD modules'
 
     dependsOn npmInstall
 
@@ -56,7 +54,8 @@ tasks.register('compileTypeScriptToAmd', Exec) {
 }
 
 tasks.register('compileTypeScriptToEsModule', Exec) {
-    group 'TypeScript'
+    group = 'TypeScript'
+    description = 'Compiles TypeScript to ES modules'
 
     dependsOn npmInstall
     
@@ -66,35 +65,51 @@ tasks.register('compileTypeScriptToEsModule', Exec) {
 
 tasks.register('compileTypeScript', Delete) {
     group = 'TypeScript'
+    description = 'Compiles all TypeScript variants'
+
+    dependsOn compileTypeScriptToAmd, compileTypeScriptToEsModule
+}
 
-    dependsOn(compileTypeScriptToAmd)
-    dependsOn(compileTypeScriptToEsModule)
+tasks.named('sourcesJar') {
+    dependsOn compileTypeScript
 }
 
 tasks.register('generateTypeScriptDocs', Exec) {
-    group 'TypeScript'
+    group = 'TypeScript'
+    description = 'Generates TypeScript documentation'
 
     dependsOn npmInstall
-    
+
     workingDir = npmWorkingDir
     commandLine npmExec, 'run', 'docs'
 }
 
 tasks.register('cleanTypeScriptFiles', Delete) {
-    delete fileTree("src/main/resources/META-INF/assets/es-modules/t5/core") {
-        include '**.js'
+    group = 'TypeScript'
+    description = 'Cleans generated TypeScript files'
+
+    delete fileTree('src/main/resources/META-INF/assets/es-modules/t5/core') {
+        include '**/*.js'
     }
-    delete fileTree("src/main/resources/META-INF/modules/t5/core") {
-        include '**.js'
+    delete fileTree('src/main/resources/META-INF/modules/t5/core') {
+        include '**/*.js'
     }
-    delete "src/main/typescript/docs"
+    delete 'src/main/typescript/docs'
+}
+
+tasks.named('processResources') {
+    dependsOn compileTypeScript
+}
+
+tasks.named('clean') {
+    dependsOn cleanTypeScriptFiles
 }
 
-processResources.dependsOn compileTypeScript
-clean.dependsOn cleanTypeScriptFiles
 
 // Not sure why this is necessary:
-compileTestGroovy.dependsOn compileTestJava
+tasks.named('compileTestGroovy') {
+    dependsOn compileTestJava
+}
 
 test {
     // Needed to have XMLTokenStreamTests.testStreamEncoding() passing on Java 
9+
@@ -118,6 +133,7 @@ test {
     tasks.register("runTest${appName.capitalize()}", JavaExec) {
         group = 'Application'
         description = "Starts the ${appName} integration test app, useful when 
debugging."
+
         mainClass = 'org.apache.tapestry5.test.JettyRunner'
         args '-d', "src/test/${appName}", '-p', '8080'
         classpath = sourceSets.test.runtimeClasspath
@@ -127,17 +143,26 @@ test {
 // Default is jQuery and Require.js enabled, so here are the tests for the
 // other combinations
 
-task testWithJqueryAndRequireJsDisabled(type: Test) {
-    systemProperties."tapestry.javascript-infrastructure-provider" = 'jquery'
-    systemProperties."tapestry.require-js-enabled" = 'false'
+tasks.register('testWithJqueryAndRequireJsDisabled', Test) {
+    group = 'Verification'
+    description = 'Runs tests with jQuery and Require.js disabled'
+
+    systemProperty 'tapestry.javascript-infrastructure-provider', 'jquery'
+    systemProperty 'tapestry.require-js-enabled', 'false'
+}
+
+tasks.register('testWithPrototypeAndRequireJsEnabled', Test) {
+    group = 'Verification'  
+    description = 'Runs tests with Prototype and Require.js enabled'
+
+    systemProperty 'tapestry.javascript-infrastructure-provider', 'prototype'
+    systemProperty 'tapestry.require-js-enabled', 'true'
 }
 
-task testWithPrototypeAndRequireJsEnabled(type: Test) {
-    systemProperties."tapestry.javascript-infrastructure-provider" = 
'prototype'
-    systemProperties."tapestry.require-js-enabled" = 'true'
-}  
+tasks.register('testWithPrototypeAndRequireJsDisabled', Test) {
+    group = 'Verification'
+    description = 'Runs tests with Prototype and Require.js disabled'
 
-task testWithPrototypeAndRequireJsDisabled(type: Test) {
-    systemProperties."tapestry.javascript-infrastructure-provider" = 
'prototype'
-    systemProperties."tapestry.require-js-enabled" = 'false'
+    systemProperty 'tapestry.javascript-infrastructure-provider', 'prototype'
+    systemProperty 'tapestry.require-js-enabled', 'false'
 }
diff --git a/tapestry-hibernate/build.gradle b/tapestry-hibernate/build.gradle
index 4fb26a60f..e0f20ce41 100644
--- a/tapestry-hibernate/build.gradle
+++ b/tapestry-hibernate/build.gradle
@@ -18,11 +18,16 @@ dependencies {
     
testRuntimeOnly("${libs.hsqldb.get().module.group}:${libs.hsqldb.get().module.name}:${libs.hsqldb.get().version}:jdk8")
 }
 
-jar.manifest.attributes 'Tapestry-Module-Classes': 
'org.apache.tapestry5.hibernate.web.modules.HibernateModule'
-
-task runTestApp0(type:JavaExec) {
+tasks.register('runTestApp0', JavaExec) {
     description = 'Start tapestry-hibernate integration test app, useful when 
debugging failing integration tests'
+
     mainClass = 'org.apache.tapestry5.test.JettyRunner'
     args '-d', 'src/test/webapp', '-p', '8080'
     classpath += project.sourceSets.test.runtimeClasspath
 }
+
+tasks.named('jar', Jar) {
+    manifest {
+        attributes 'Tapestry-Module-Classes': 
'org.apache.tapestry5.hibernate.web.modules.HibernateModule'
+    }
+}
\ No newline at end of file
diff --git a/tapestry-http/build.gradle b/tapestry-http/build.gradle
index b91bb13d6..ad18b1498 100644
--- a/tapestry-http/build.gradle
+++ b/tapestry-http/build.gradle
@@ -25,9 +25,11 @@ dependencies {
 }
 
 // Not sure why this is necessary:
-compileTestGroovy.dependsOn compileTestJava
+tasks.named('compileTestGroovy') {
+    dependsOn compileTestJava
+}
 
-jar {
+tasks.named('jar', Jar) {
     from('src/main/filtered-resources') {
         filter(ReplaceTokens, tokens: [version: project.parent.version])
     }
diff --git a/tapestry-ioc-jcache/build.gradle b/tapestry-ioc-jcache/build.gradle
index c285da968..cd0277613 100644
--- a/tapestry-ioc-jcache/build.gradle
+++ b/tapestry-ioc-jcache/build.gradle
@@ -23,7 +23,7 @@ dependencies {
     testRuntimeOnly moduleLibs.infinispanJcache /* Just to be able to run the 
tests */
 }
 
-jar {
+tasks.named('jar', Jar) {
     manifest {
         attributes 'Tapestry-Module-Classes': 
'org.apache.tapestry5.jcache.module.JCacheModule'
     }
diff --git a/tapestry-ioc/build.gradle b/tapestry-ioc/build.gradle
index 31cd32795..e8a3e3ee6 100644
--- a/tapestry-ioc/build.gradle
+++ b/tapestry-ioc/build.gradle
@@ -22,7 +22,7 @@ dependencies {
 
 }
 
-test {
+tasks.named('test', Test) {
     // Override the master build.gradle
     systemProperties.remove('tapestry.service-reloading-enabled')
 }
diff --git a/tapestry-jpa/build.gradle b/tapestry-jpa/build.gradle
index 616244556..d1aa62b83 100644
--- a/tapestry-jpa/build.gradle
+++ b/tapestry-jpa/build.gradle
@@ -26,16 +26,16 @@ dependencies {
     testImplementation libs.testng
 }
 
-(1..6).each { i ->
-    tasks.register("runTestApp$i", JavaExec) {
-        description = "Start app$i integration test app, useful when debugging 
failing integration tests"
+(1..6).each {
+    tasks.register("runTestApp${it}", JavaExec) {
+        description = "Start app${it} integration test app, useful when 
debugging failing integration tests"
         mainClass = 'org.apache.tapestry5.test.JettyRunner'
-        args '-d', "src/test/app$i", '-p', '8080'
+        args '-d', "src/test/app${it}", '-p', '8080'
         classpath = project.sourceSets.test.runtimeClasspath
     }
 }
 
-jar {
+tasks.named('jar', Jar) {
     manifest {
         attributes 'Tapestry-Module-Classes': 
'org.apache.tapestry5.jpa.modules.JpaModule'
     }
diff --git a/tapestry-json/build.gradle b/tapestry-json/build.gradle
index 45095cc81..9d71e30d7 100644
--- a/tapestry-json/build.gradle
+++ b/tapestry-json/build.gradle
@@ -11,7 +11,7 @@ dependencies {
     testImplementation project(":tapestry-func")
 }
 
-jar {
+tasks.named('jar', Jar) {
     manifest {
         attributes 'Tapestry-Module-Classes': 
'org.apache.tapestry5.json.modules.JSONModule'
     }
diff --git a/tapestry-kaptcha/build.gradle b/tapestry-kaptcha/build.gradle
index 4757d2928..343262a42 100644
--- a/tapestry-kaptcha/build.gradle
+++ b/tapestry-kaptcha/build.gradle
@@ -17,7 +17,7 @@ dependencies {
     testImplementation project(':tapestry-test')
 }
 
-jar {
+tasks.named('jar', Jar) {
     manifest {
         attributes 'Tapestry-Module-Classes': 
'org.apache.tapestry5.kaptcha.modules.KaptchaModule'
     }
diff --git a/tapestry-openapi-viewer/build.gradle 
b/tapestry-openapi-viewer/build.gradle
index 293166257..d05c0086c 100644
--- a/tapestry-openapi-viewer/build.gradle
+++ b/tapestry-openapi-viewer/build.gradle
@@ -6,7 +6,7 @@ dependencies {
     testImplementation libs.jakarta.servlet.api
 }
 
-jar {
+tasks.named('jar', Jar) {
     manifest {
         attributes 'Tapestry-Module-Classes': 
'org.apache.tapestry5.openapiviewer.modules.TapestryOpenApiViewerModule'
     }
diff --git a/tapestry-rest-jackson/build.gradle 
b/tapestry-rest-jackson/build.gradle
index 74c390a63..e05193b39 100644
--- a/tapestry-rest-jackson/build.gradle
+++ b/tapestry-rest-jackson/build.gradle
@@ -2,7 +2,7 @@ def moduleLibs = [
     jsonschemaGenerator: 'com.github.victools:jsonschema-generator:4.20.0',
 ]
 
-description = "Support for using Jackson Databind with the Tapestry REST 
support"
+description = 'Support for using Jackson Databind with the Tapestry REST 
support'
 
 dependencies {
     implementation project(':tapestry-core')
@@ -13,7 +13,7 @@ dependencies {
     provided libs.jakarta.servlet.api
 }
 
-jar {
+tasks.named('jar', Jar) {
     manifest {
         attributes 'Tapestry-Module-Classes': 
'org.apache.tapestry5.rest.jackson.modules.RestJacksonModule'
     }
diff --git a/tapestry-spring/build.gradle b/tapestry-spring/build.gradle
index 51eb4edc4..7385ee42c 100644
--- a/tapestry-spring/build.gradle
+++ b/tapestry-spring/build.gradle
@@ -23,21 +23,17 @@ dependencies {
     testImplementation project(':tapestry-test')
 }
 
-task runTestApp(type:JavaExec) {
-    description 'Start tapestry-spring integration test app, useful when 
debugging failing integration tests'
-    main = 'org.apache.tapestry5.test.JettyRunner'
-    args '-d', 'src/test/webapp', '-p', '8080'
-    classpath += project.sourceSets.test.runtimeClasspath
-}
-
-task runTestApp1(type:JavaExec) {
-    description 'Start tapestry-spring integration test app 1, useful when 
debugging failing integration tests'
-    main = 'org.apache.tapestry5.test.JettyRunner'
-    args '-d', 'src/test/webapp1', '-p', '8080'
-    classpath += project.sourceSets.test.runtimeClasspath
+['', '1'].each { suffix ->
+    tasks.register("runTestApp${suffix}", JavaExec) {
+        group = 'Application'
+        description = "Start tapestry-spring integration test app${suffix}, 
useful when debugging failing integration tests"
+        mainClass = 'org.apache.tapestry5.test.JettyRunner'
+        args '-d', "src/test/webapp${suffix}", '-p', '8080'
+        classpath += project.sourceSets.test.runtimeClasspath
+    }
 }
 
-jar {
+tasks.named('jar', Jar) {
     manifest {
         attributes 'Tapestry-Module-Classes': 
'org.apache.tapestry5.spring.modules.SpringModule'
     }
diff --git a/tapestry-upload/build.gradle b/tapestry-upload/build.gradle
index ee96ec7c7..69a9e7443 100644
--- a/tapestry-upload/build.gradle
+++ b/tapestry-upload/build.gradle
@@ -20,7 +20,7 @@ dependencies {
     testImplementation project(':tapestry-test')
 }
 
-jar {
+tasks.named('jar', Jar) {
     manifest {
         attributes 'Tapestry-Module-Classes': 
'org.apache.tapestry5.upload.modules.UploadModule'
     }
diff --git a/tapestry-version-migrator/build.gradle 
b/tapestry-version-migrator/build.gradle
index 7a211631d..4a19631fa 100644
--- a/tapestry-version-migrator/build.gradle
+++ b/tapestry-version-migrator/build.gradle
@@ -12,7 +12,7 @@ tasks.withType(Test).configureEach {
     }
 }
 
-jar {
+tasks.named('jar', Jar) {
     manifest {
         attributes 'Main-Class': 'org.apache.tapestry5.versionmigrator.Main'
     }
diff --git a/tapestry-webresources/build.gradle 
b/tapestry-webresources/build.gradle
index 38b43a70b..943d36fdb 100644
--- a/tapestry-webresources/build.gradle
+++ b/tapestry-webresources/build.gradle
@@ -18,11 +18,10 @@ dependencies {
     api moduleLibs.closureCompiler
 
     implementation moduleLibs.less4j
+    implementation moduleLibs.rhino
 
     compileOnly moduleLibs.autoValueAnnotations
 
-    implementation moduleLibs.rhino
-
     testImplementation project(':tapestry-test')
     testImplementation project(':tapestry-runner')
 
@@ -35,14 +34,18 @@ dependencies {
     testImplementation libs.webdrivermanager
 }
 
+
 test {
     systemProperties(
-            'geb.build.reportsDir': "${reporting.baseDir}/geb",
-            'tapestry.compiled-asset-cache-dir': 
"${buildDir}/compiled-asset-cache",
-            'tapestry.production-mode': 'false')
+        'geb.build.reportsDir': "$reporting.baseDir/geb",
+        'tapestry.compiled-asset-cache-dir': "$buildDir/compiled-asset-cache",
+        'tapestry.production-mode': 'false',
+        'tapestry.compress-whitespace': 'false',
+        'tapestry.combine-scripts': 'false'
+    )
 }
 
-jar {
+tasks.named('jar', Jar) {
     manifest {
         attributes 'Tapestry-Module-Classes': 
'org.apache.tapestry5.webresources.modules.WebResourcesModule'
     }

Reply via email to