You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by th...@apache.org on 2022/01/17 19:12:38 UTC

[tapestry-5] 02/02: TAP5-2699: first pass at upgrading build to latest Gradle (7.3.3)

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

thiagohp pushed a commit to branch latest-java-tests
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git

commit c7d649ed38eaa7b67c5a8f5ec9da713fa1a80ff2
Author: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
AuthorDate: Mon Jan 17 16:12:24 2022 -0300

    TAP5-2699: first pass at upgrading build to latest Gradle (7.3.3)
---
 beanmodel/build.gradle                             |  2 +-
 build.gradle                                       | 32 +++++++++-------------
 .../groovy/t5build/PreprocessCoffeeScript.groovy   |  2 ++
 commons/build.gradle                               |  4 +--
 settings.gradle                                    | 23 +---------------
 tapestry-core/build.gradle                         |  8 +++---
 .../org/apache/tapestry5/func/FlowOperations.java  |  4 +--
 .../java/org/apache/tapestry5/func/Reducer.java    |  4 +--
 tapestry-hibernate-core/build.gradle               |  2 +-
 .../apache/tapestry5/http/AsyncRequestHandler.java |  2 +-
 tapestry-ioc/build.gradle                          | 14 +++++-----
 tapestry-jpa/build.gradle                          |  2 +-
 tapestry-latest-java-tests/build.gradle            |  2 +-
 tapestry-runner/build.gradle                       |  2 +-
 tapestry-test/build.gradle                         |  8 +++---
 15 files changed, 43 insertions(+), 68 deletions(-)

diff --git a/beanmodel/build.gradle b/beanmodel/build.gradle
index e1bb074..9bdd925 100644
--- a/beanmodel/build.gradle
+++ b/beanmodel/build.gradle
@@ -9,7 +9,7 @@ apply plugin: 'antlr'
 buildDir = 'target/gradle-build'
 
 dependencies {
-    implementation project(":plastic")
+    api project(":plastic")
     api project(":tapestry5-annotations")
     api project(":commons")
     implementation "org.slf4j:slf4j-api:${versions.slf4j}"
diff --git a/build.gradle b/build.gradle
index c70e907..b971ef7 100755
--- a/build.gradle
+++ b/build.gradle
@@ -158,7 +158,7 @@ subprojects {
         provided
     }
 
-    apply plugin: "java"
+    apply plugin: "java-library"
     apply plugin: "groovy" // mostly for testing
 
     apply plugin: "project-report"
@@ -288,13 +288,13 @@ subprojects {
         }
     }
 
-//    uploadPublished {
-//
-//        doFirst {
-//            if (!canDeploy) {
-//                throw new InvalidUserDataException("Missing upload credentials. Set '$deployUsernameProperty' and '$deployPasswordProperty' root project properties.")
-//            }
-//        }
+    task uploadPublished {
+
+        doFirst {
+            if (!canDeploy) {
+                throw new InvalidUserDataException("Missing upload credentials. Set '$deployUsernameProperty' and '$deployPasswordProperty' root project properties.")
+            }
+        }
 
         if (canDeploy) {
             repositories {
@@ -319,7 +319,7 @@ subprojects {
                 
             }
         }
-//    }
+    }
 }
 
 subprojects.each { project.evaluationDependsOn(it.name) }
@@ -443,10 +443,10 @@ dependencies {
 task combinedJacocoReport(type:JacocoReport){
   def subprojectsToConsider = subprojects.findAll {it.name != 'quickstart' && it.name != 'beanmodel' && it.name != 'commons' && it.name != 'genericsresolver-guava' && it.name != 'tapestry5-annotations' && it.name != 'tapestry-internal-test' && it.name != 'tapestry-runner' && it.name != 'tapestry-test-constants' && it.name != 'tapestry-test-data' && it.name != 'tapestry-ioc-jcache'}
   dependsOn = subprojectsToConsider.test
-  additionalSourceDirs = files(subprojectsToConsider.sourceSets.main.allSource.srcDirs)
-  sourceDirectories = files(subprojectsToConsider.sourceSets.main.allSource.srcDirs)
-  classDirectories = files(subprojectsToConsider.sourceSets.main.output)
-  executionData = files(subprojectsToConsider.jacocoTestReport.executionData)
+  additionalSourceDirs.from(files(subprojectsToConsider.sourceSets.main.allSource.srcDirs))
+  sourceDirectories.from(files(subprojectsToConsider.sourceSets.main.allSource.srcDirs))
+  classDirectories.from(files(subprojectsToConsider.sourceSets.main.output))
+  executionData.from(files(subprojectsToConsider.jacocoTestReport.executionData))
   jacocoClasspath = files(subprojectsToConsider.jacocoTestReport.jacocoClasspath)
   reports {
       html {
@@ -591,12 +591,6 @@ if (canDeploy) {
         outputDir "$buildDir/sha256"
     }
 
-    if (doSign) {
-        signing {
-            sign configurations.archives
-        }
-    }
-
     // This requires that you have the apacheArchivesFolder property configured in your
     // ~/.gradle/gradle.properties. The folder should be a Subversion workspace for
     // https://dist.apache.org/repos/dist/dev/tapestry
diff --git a/buildSrc/src/main/groovy/t5build/PreprocessCoffeeScript.groovy b/buildSrc/src/main/groovy/t5build/PreprocessCoffeeScript.groovy
index 0b12b65..10c9481 100644
--- a/buildSrc/src/main/groovy/t5build/PreprocessCoffeeScript.groovy
+++ b/buildSrc/src/main/groovy/t5build/PreprocessCoffeeScript.groovy
@@ -13,6 +13,7 @@ class PreprocessCoffeeScript extends DefaultTask {
         group = "build"
     }
 
+    @Internal
     def flavors = ["prototype", "jquery"]
     def srcDir = "src/main/preprocessed-coffeescript"
     def outputDir = "${project.buildDir}/postprocessed-coffeescript"
@@ -60,6 +61,7 @@ class PreprocessCoffeeScript extends DefaultTask {
 
     // Very sloppy; doesn't actually differentiate between #if and #elseif (nesting is not actually
     // supported). Some more C Macro support would be nice, too.
+    @Internal
     def ifPattern = ~/^#(else)?if\s+(\w+)$/
 
     void split(File inputFile, File outputFile, String flavor) {
diff --git a/commons/build.gradle b/commons/build.gradle
index 3e2396b..9caed3f 100644
--- a/commons/build.gradle
+++ b/commons/build.gradle
@@ -8,8 +8,8 @@ description = "Project including common classes for tapestry-core, tapestry-ioc
 buildDir = 'target/gradle-build'
        
 dependencies {
-	implementation project(":plastic")
-	implementation project(":tapestry5-annotations")
+	api project(":plastic")
+	api project(":tapestry5-annotations")
 	implementation project(":tapestry-func")
 }
 
diff --git a/settings.gradle b/settings.gradle
index 5f58e6b..f31e797 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,31 +1,10 @@
-def getJavaLatestMajorVersion() {
-    return 17
-}
-
-def getJavaMajorVersion() {
-    String javaVersion = System.getProperty("java.version")
-    return Integer.parseInt(javaVersion.substring(0, javaVersion.indexOf(".")))
-}
-
-def isJavaLatestMajorVersion() {
-    return getJavaMajorVersion() == getJavaLatestMajorVersion() 
-}
-
-def isWrongJavaLatestMajorVersion() {
-    return getJavaMajorVersion() > getJavaLatestMajorVersion() 
-}
-
-if (isWrongJavaLatestMajorVersion()) {
-    println "Current major Java version is higher than the latest one configured in settings.gradle";
-}
-
 include "plastic", "tapestry5-annotations", "tapestry-test", "tapestry-func", "tapestry-ioc", "tapestry-json", "tapestry-http", "tapestry-core"
 include "tapestry-hibernate-core", "tapestry-hibernate", "tapestry-jmx", "tapestry-upload", "tapestry-spring"
 include "tapestry-beanvalidator", "tapestry-jpa", "tapestry-kaptcha"
 if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
     include "tapestry-javadoc"
 }
-if (isJavaLatestMajorVersion()) {
+if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
     include "tapestry-latest-java-tests"
 }
 include "quickstart", "tapestry-clojure", "tapestry-mongodb"
diff --git a/tapestry-core/build.gradle b/tapestry-core/build.gradle
index 16f1b11..9dcfb45 100644
--- a/tapestry-core/build.gradle
+++ b/tapestry-core/build.gradle
@@ -12,10 +12,10 @@ project.ext {
 clean.delete mainGeneratedDir, testGeneratedDir
 
 dependencies {
-    implementation project(':tapestry-ioc')
-    implementation project(':tapestry-json')
-    implementation project(':beanmodel')
-    implementation project(':tapestry-http')
+    api project(':tapestry-ioc')
+    api project(':tapestry-json')
+    api project(':beanmodel')
+    api project(':tapestry-http')
     
     implementation 'jakarta.annotation:jakarta.annotation-api:1.3.4'
     implementation 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.2'
diff --git a/tapestry-func/src/main/java/org/apache/tapestry5/func/FlowOperations.java b/tapestry-func/src/main/java/org/apache/tapestry5/func/FlowOperations.java
index d4dec34..e087a97 100644
--- a/tapestry-func/src/main/java/org/apache/tapestry5/func/FlowOperations.java
+++ b/tapestry-func/src/main/java/org/apache/tapestry5/func/FlowOperations.java
@@ -18,9 +18,9 @@ import java.util.List;
 import java.util.Set;
 
 /**
- * @param T
+ * @param <T>
  *         the type of data in the flow
- * @param FT
+ * @param <FT>
  *         the type of flow (either {@code Flow<T>} or {@code ZippedFlow<Tuple<T, ?>})
  * @since 5.3
  */
diff --git a/tapestry-func/src/main/java/org/apache/tapestry5/func/Reducer.java b/tapestry-func/src/main/java/org/apache/tapestry5/func/Reducer.java
index 866b7e0..82599e1 100644
--- a/tapestry-func/src/main/java/org/apache/tapestry5/func/Reducer.java
+++ b/tapestry-func/src/main/java/org/apache/tapestry5/func/Reducer.java
@@ -16,8 +16,8 @@ package org.apache.tapestry5.func;
  * A reducer takes an accumulator value and a single value from a collection and computes a new
  * accumulator value.
  *
- * @param A type of accumulator
- * @param T type of collection value
+ * @param <A> type of accumulator
+ * @param <T> type of collection value
  * 
  * @since 5.2.0
  */
diff --git a/tapestry-hibernate-core/build.gradle b/tapestry-hibernate-core/build.gradle
index 26c7c5a..f4cde3f 100644
--- a/tapestry-hibernate-core/build.gradle
+++ b/tapestry-hibernate-core/build.gradle
@@ -4,7 +4,7 @@ description = "Basic Hibernate services for Tapestry, useable outside of a Tapes
 dependencies {
     implementation project(':tapestry-ioc')
 
-    implementation group: 'org.hibernate', name: 'hibernate-core', version: versions.hibernate
+    api group: 'org.hibernate', name: 'hibernate-core', version: versions.hibernate
     
     implementation 'org.glassfish.jaxb:jaxb-runtime:2.3.2'
 
diff --git a/tapestry-http/src/main/java/org/apache/tapestry5/http/AsyncRequestHandler.java b/tapestry-http/src/main/java/org/apache/tapestry5/http/AsyncRequestHandler.java
index 9271375..50151aa 100644
--- a/tapestry-http/src/main/java/org/apache/tapestry5/http/AsyncRequestHandler.java
+++ b/tapestry-http/src/main/java/org/apache/tapestry5/http/AsyncRequestHandler.java
@@ -28,7 +28,7 @@ import org.apache.tapestry5.http.internal.AsyncRequestService;
  * but not necessarily) should handle it, possibly different {@link HttpServletRequest}
  * and {@link HttpServletResponse} objects to be used when calling 
  * {@linkplain} HttpServletRequest#startAsync()} and an optional {@linkplain AsyncListener}.
- * <p>
+ * </p>
  * <p>
  * If one {@link AsyncRequestHandler} doesn't tells the request should be asynchronous,
  * the next one contributed to {@link AsyncRequestService} will be called
diff --git a/tapestry-ioc/build.gradle b/tapestry-ioc/build.gradle
index b571603..7960d7b 100644
--- a/tapestry-ioc/build.gradle
+++ b/tapestry-ioc/build.gradle
@@ -1,20 +1,20 @@
 description = "A code-centric, high-performance, simple Inversion of Control container"
 
 dependencies {
-    implementation project(':tapestry-func')
-    implementation project(':tapestry5-annotations')
-    implementation project(":plastic")
-    implementation project(":beanmodel")
+    api project(':tapestry-func')
+    api project(':tapestry5-annotations')
+    api project(":plastic")
+    api project(":beanmodel")
 
     provided project(':tapestry-test')
 
     // For now, keep these compile dependencies synchronized with the binaries dependencies
     // of the top-level build:
 
-    implementation "javax.inject:javax.inject:1"
-    implementation "javax.annotation:javax.annotation-api:1.3.2"
+    api "javax.inject:javax.inject:1"
+    api "javax.annotation:javax.annotation-api:1.3.2"
 
-    implementation "org.slf4j:slf4j-api:${versions.slf4j}"
+    api "org.slf4j:slf4j-api:${versions.slf4j}"
 
     testImplementation "commons-lang:commons-lang:2.6"
     testImplementation "org.apache.commons:commons-lang3:3.4"
diff --git a/tapestry-jpa/build.gradle b/tapestry-jpa/build.gradle
index cc6c106..b03367b 100644
--- a/tapestry-jpa/build.gradle
+++ b/tapestry-jpa/build.gradle
@@ -17,7 +17,7 @@ dependencies {
 repositories {
     maven {
         name "EclipseLink"
-        url "http://download.eclipse.org/rt/eclipselink/maven.repo/"
+        url "https://download.eclipse.org/rt/eclipselink/maven.repo/"
     }
 }
 
diff --git a/tapestry-latest-java-tests/build.gradle b/tapestry-latest-java-tests/build.gradle
index 7e81295..54c9223 100644
--- a/tapestry-latest-java-tests/build.gradle
+++ b/tapestry-latest-java-tests/build.gradle
@@ -1,5 +1,5 @@
 description = "Test suite for making sure Tapestry runs on latest Java"
 
 dependencies {
-    compile project(':tapestry-ioc')
+    api project(':tapestry-ioc')
 }
\ No newline at end of file
diff --git a/tapestry-runner/build.gradle b/tapestry-runner/build.gradle
index 3ec04ab..88acdb4 100644
--- a/tapestry-runner/build.gradle
+++ b/tapestry-runner/build.gradle
@@ -2,7 +2,7 @@ description = "Utilities for running a Tapestry application in Jetty or Tomcat a
 
 dependencies {
 
-    implementation project(":tapestry-test-constants")
+    api project(":tapestry-test-constants")
     implementation "org.eclipse.jetty:jetty-server:${versions.jetty}"
     implementation "org.eclipse.jetty:jetty-jndi:${versions.jetty}"
     implementation "org.eclipse.jetty:jetty-plus:${versions.jetty}"
diff --git a/tapestry-test/build.gradle b/tapestry-test/build.gradle
index 75432d9..2efff47 100644
--- a/tapestry-test/build.gradle
+++ b/tapestry-test/build.gradle
@@ -2,8 +2,8 @@ description = "[Deprecated] Utilities for integration testing of Tapestry applic
 
 dependencies {
 
-  implementation project(":tapestry-test-data")
-  implementation project(":tapestry-runner")
+  api project(":tapestry-test-data")
+  api project(":tapestry-runner")
 
   implementation ("io.github.bonigarcia:webdrivermanager:2.2.4")
 
@@ -14,6 +14,6 @@ dependencies {
   }
   implementation "org.seleniumhq.selenium:selenium-support:${versions.selenium}"
 
-  implementation "org.testng:testng:${versions.testng}"
-  implementation "org.easymock:easymock:${versions.easymock}"
+  api "org.testng:testng:${versions.testng}"
+  api "org.easymock:easymock:${versions.easymock}"
 }