Skip to content

Commit

Permalink
Merge pull request #66 from thc202/gradle/update-8.x
Browse files Browse the repository at this point in the history
Add Java 20 to CI and update Gradle
  • Loading branch information
thc202 committed Jul 20, 2023
2 parents 4be6912 + 5efd1ab commit 86e2b76
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [11, 19]
java: [11, 20]

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Recommended minimum Gradle version is now 8.2.
- Update ZAP API client to version 1.12.0.

### Fixed
- Correct the tasks `PrepareNextDevIter` and `PrepareRelease` to use their properties, for the `version` and `release`.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

A Gradle plugin to (help) build ZAP add-ons.

The plugin requires at least Java 11 and Gradle 7.6.
The plugin requires at least Java 11 and Gradle 8.2.
16 changes: 10 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
`kotlin-dsl`
id("com.gradle.plugin-publish") version "1.1.0"
id("com.gradle.plugin-publish") version "1.2.0"

id("com.diffplug.spotless") version "6.14.1"
id("com.diffplug.spotless") version "6.20.0"
}

repositories {
Expand All @@ -24,7 +24,7 @@ dependencies {
val jgitVersion = "5.6.0.201912101111-r"
implementation("org.eclipse.jgit:org.eclipse.jgit:$jgitVersion")
implementation("org.eclipse.jgit:org.eclipse.jgit.archive:$jgitVersion")
implementation("org.zaproxy:zap-clientapi:1.11.0")
implementation("org.zaproxy:zap-clientapi:1.12.0")
implementation("org.kohsuke:github-api:1.95")
// Include annotations used by the above library to avoid compiler warnings.
compileOnly("com.google.code.findbugs:findbugs-annotations:3.0.1")
Expand All @@ -44,8 +44,12 @@ tasks.jar {
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

kotlin {
jvmToolchain(11)
}

tasks.withType<JavaCompile>().configureEach {
Expand All @@ -70,7 +74,7 @@ gradlePlugin {
spotless {
java {
licenseHeaderFile("gradle/spotless/license.java")
googleJavaFormat("1.7").aosp()
googleJavaFormat("1.17.0").aosp()
}

kotlin {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=312eb12875e1747e05c2f81a4789902d7e4ec5defbd1eefeaccc08acf096505d
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
distributionSha256Sum=7c3ad722e9b0ce8205b91560fd6ce8296ac3eadf065672242fd73c06b8eeb6ee
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
16 changes: 10 additions & 6 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
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"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -133,26 +130,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=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=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# 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, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/org/zaproxy/gradle/addon/AddOnPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,10 @@ public void execute(Task task) {
.getLibs()
: project
.files();
return runtimeClasspath.get()
.getFiles().stream()
return runtimeClasspath
.get()
.getFiles()
.stream()
.filter(
e ->
!bundledLibs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,8 @@ private org.zaproxy.gradle.addon.internal.model.Manifest createManifest() throws

private void addClassesAssignableTo(
List<String> list, ClassInfoList addOnClasses, ClassInfo baseClass) {
addOnClasses.getAssignableTo(baseClass)
addOnClasses
.getAssignableTo(baseClass)
.filter(
ci ->
ci.isPublic()
Expand Down

0 comments on commit 86e2b76

Please sign in to comment.