Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request GradleUp#876 from Goooler/main
Browse files Browse the repository at this point in the history
Support Gradle 8.9 & Java 21
  • Loading branch information
Goooler authored Aug 1, 2024
2 parents 065f6ba + 450f902 commit a933e8e
Show file tree
Hide file tree
Showing 42 changed files with 1,351 additions and 1,282 deletions.
84 changes: 0 additions & 84 deletions .circleci/config.yml

This file was deleted.

2 changes: 1 addition & 1 deletion renovate.json → .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
"config:base",
]
}
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:

jobs:
build:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
# Always test on the latest version and all LTS.
java: [ 11, 17, 21, 22 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
validate-wrappers: true
- run: ./gradlew build
20 changes: 0 additions & 20 deletions .github/workflows/gradle-wrapper-validation.yml

This file was deleted.

30 changes: 12 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ plugins {
id 'idea'
id 'java-gradle-plugin'
id 'signing'
id 'com.gradle.plugin-publish' version '1.1.0'
id 'org.ajoberstar.git-publish' version '4.1.1'
id 'com.github.node-gradle.node' version '3.5.1'
id 'com.gradle.plugin-publish' version '1.2.1'
id 'org.ajoberstar.git-publish' version '4.2.2'
id 'com.github.node-gradle.node' version '7.0.2'
}

apply plugin: ShadowPlugin
Expand All @@ -20,39 +20,33 @@ apply from: file('gradle/vuepress.gradle')
apply from: file('gradle/ghPages.gradle')
apply from: file('gradle/dependencies.gradle')

repositories {
gradlePluginPortal()
mavenCentral()
}

tasks.withType(Test).configureEach {
useJUnitPlatform()

// https://docs.gradle.org/8.8/userguide/performance.html#execute_tests_in_parallel
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1

if (System.env.CI == 'true') {
testLogging.showStandardStreams = true
minHeapSize "1g"
maxHeapSize "1g"
}

systemProperty 'java.io.tmpdir', buildDir.absolutePath
systemProperty 'java.io.tmpdir', project.layout.buildDirectory.asFile.get().absolutePath

// Required to test configuration cache in tests when using withDebug()
// https://github.com/gradle/gradle/issues/22765#issuecomment-1339427241
jvmArgs(
"--add-opens",
"java.base/java.util=ALL-UNNAMED",
"--add-opens",
"java.base/java.util.concurrent.atomic=ALL-UNNAMED",
"--add-opens",
"java.base/java.lang.invoke=ALL-UNNAMED",
"--add-opens",
"java.base/java.net=ALL-UNNAMED",
"--add-opens", "java.base/java.util=ALL-UNNAMED",
"--add-opens", "java.base/java.util.concurrent.atomic=ALL-UNNAMED",
"--add-opens", "java.base/java.lang.invoke=ALL-UNNAMED",
"--add-opens", "java.base/java.net=ALL-UNNAMED",
)
}

// Remove the gradleApi so it isn't merged into the jar file.
// This is required because 'java-gradle-plugin' adds gradleApi() to the 'api' configuration.
// See https://github.com/gradle/gradle/blob/master/subprojects/plugin-development/src/main/java/org/gradle/plugin/devel/plugins/JavaGradlePluginPlugin.java#L162
// See https://github.com/gradle/gradle/blob/972c3e5c6ef990dd2190769c1ce31998a9402a79/subprojects/plugin-development/src/main/java/org/gradle/plugin/devel/plugins/JavaGradlePluginPlugin.java#L161
configurations.named(JavaPlugin.API_CONFIGURATION_NAME) {
dependencies.remove(project.dependencies.gradleApi())
}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ScriptHolder {

//Grab the dependencies closure and resolve it against
//the buildSrc project dependencies
//This effectively applies the same dependenices from build.gradle into buildSrc/build.gradle
//This effectively applies the same dependencies from build.gradle into buildSrc/build.gradle
//This is required so that when buildSrc is compiled it has the dependencies to compile the source code
def closure = holder.dependencies.clone()
closure.delegate = project.dependencies
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=2g
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx4g -XX:MaxMetaspaceSize=2g
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.unsafe.configuration-cache=true
org.gradle.configuration-cache=true
24 changes: 13 additions & 11 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ dependencies {
shadow 'org.codehaus.groovy:groovy-backports-compat23:3.0.8'

implementation 'org.jdom:jdom2:2.0.6.1'
implementation 'org.ow2.asm:asm:9.5'
implementation 'org.ow2.asm:asm-commons:9.5'
implementation 'commons-io:commons-io:2.11.0'
implementation 'org.apache.ant:ant:1.10.13'
implementation 'org.codehaus.plexus:plexus-utils:3.5.1'
implementation "org.apache.logging.log4j:log4j-core:2.20.0"
implementation('org.vafer:jdependency:2.8.0') {
implementation 'org.ow2.asm:asm:9.7'
implementation 'org.ow2.asm:asm-commons:9.7'
implementation 'commons-io:commons-io:2.16.1'
implementation 'org.apache.ant:ant:1.10.14'
implementation 'org.codehaus.plexus:plexus-utils:4.0.1'
implementation 'org.codehaus.plexus:plexus-xml:4.0.4'
implementation "org.apache.logging.log4j:log4j-core:2.23.1"
implementation('org.vafer:jdependency:2.10') {
exclude group: 'org.ow2.asm'
}

Expand All @@ -19,8 +20,9 @@ dependencies {
}
testImplementation 'org.spockframework:spock-junit4:2.3-groovy-3.0'
testImplementation 'xmlunit:xmlunit:1.6'
testImplementation 'org.apache.commons:commons-lang3:3.12.0'
testImplementation 'com.google.guava:guava:31.1-jre'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.9.2'
testImplementation 'org.apache.commons:commons-lang3:3.15.0'
testImplementation 'com.google.guava:guava:33.2.1-jre'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.10.3'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
4 changes: 0 additions & 4 deletions gradle/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ signing {
sign(publishing.publications)
}

tasks.withType(Sign).configureEach {
notCompatibleWithConfigurationCache("https://github.com/gradle/gradle/issues/13470")
}

tasks.register('release') {
dependsOn tasks.named('assemble'), tasks.named('publishPlugins'), tasks.named('gitPublishPush')
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
34 changes: 21 additions & 13 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -83,10 +85,9 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,26 +134,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,11 +201,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
Loading

0 comments on commit a933e8e

Please sign in to comment.