Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Gradle, ZAP, and Java #480

Merged
merged 1 commit into from
Feb 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [11, 22]
java: [17, 22]

steps:
- uses: actions/checkout@v4
4 changes: 4 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -24,6 +24,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
2 changes: 1 addition & 1 deletion .github/workflows/crowdin-upload-files.yml
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
java-version: 17
- name: Upload Files
env:
CROWDIN_AUTH_TOKEN: ${{ secrets.ZAPBOT_CROWDIN_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/prepare-release-add-on.yml
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
java-version: 17
- name: Prepare Release and Create Pull Request
env:
ZAPBOT_TOKEN: ${{ secrets.ZAPBOT_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release-add-on.yml
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
java-version: 17
- name: Generate Release State
run: ./gradlew generateReleaseStateLastCommit
- name: Build and Release Add-On
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Extender script 'ScanMonitor.js'

### Changed
- Update minimum ZAP version to 2.16.0 and compile with Java 17.
- Add cautionary note to help and readme.
- Maintenance and documentation changes.

24 changes: 12 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -8,10 +8,10 @@ import org.zaproxy.gradle.addon.misc.ConvertMarkdownToHtml

plugins {
`java-library`
id("org.zaproxy.add-on") version "0.11.0"
id("org.zaproxy.crowdin") version "0.4.0"
id("org.zaproxy.add-on") version "0.13.1"
id("org.zaproxy.crowdin") version "0.6.0"
id("com.diffplug.spotless")
id("com.github.node-gradle.node") version "7.0.2"
id("com.github.node-gradle.node") version "7.1.0"
id("org.zaproxy.common")
}

@@ -22,7 +22,7 @@ val scriptsDir = layout.buildDirectory.dir("scripts")
zapAddOn {
addOnId.set("communityScripts")
addOnName.set("Community Scripts")
zapVersion.set("2.15.0")
zapVersion.set("2.16.0")
addOnStatus.set(AddOnStatus.ALPHA)

releaseLink.set("https://github.com/zaproxy/community-scripts/compare/v@PREVIOUS_VERSION@...v@CURRENT_VERSION@")
@@ -49,20 +49,20 @@ crowdin {
}

dependencies {
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
testImplementation("org.junit.jupiter:junit-jupiter:5.12.0")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")

testImplementation("commons-io:commons-io:2.16.1")
testImplementation("org.assertj:assertj-core:3.26.0")
testImplementation("org.apache.commons:commons-lang3:3.14.0")
testImplementation("commons-io:commons-io:2.18.0")
testImplementation("org.assertj:assertj-core:3.27.3")
testImplementation("org.apache.commons:commons-lang3:3.17.0")

// The following versions should match the ones of the add-ons.
testImplementation("org.codehaus.groovy:groovy-all:3.0.14")
val graalJsVersion = "22.3.3"
testImplementation("org.graalvm.js:js:$graalJsVersion")
testImplementation("org.graalvm.js:js-scriptengine:$graalJsVersion")
testImplementation("org.jruby:jruby-complete:1.7.4")
testImplementation("org.zaproxy:zest:0.21.0")
testImplementation("org.zaproxy:zest:0.24.0")
testImplementation("org.python:jython-standalone:2.7.2")
}

@@ -92,7 +92,7 @@ var scriptTypes =
"websocketpassive",
)

val syncScriptsDirTask by tasks.creating(Sync::class) {
val syncScriptsDirTask by tasks.registering(Sync::class) {
into(scriptsDir.get().dir(project.name))

scriptTypes.forEach {
@@ -107,15 +107,15 @@ tasks.named(AddOnPlugin.GENERATE_MANIFEST_TASK_NAME) {
}

java {
val javaVersion = JavaVersion.VERSION_11
val javaVersion = JavaVersion.VERSION_17
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}

sourceSets["main"].output.dir(mapOf("builtBy" to syncScriptsDirTask), scriptsDir)

node {
version = "20.12.1"
version = "22.14.0"
download = true
}

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=f8b4f4772d302c8ff580bc40d0f56e715de69b163546944f787c87abf209c961
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
distributionSha256Sum=fba8464465835e74f7270bbf43d6d8a8d7709ab0a43ce1aa3323f73e9aa0c612
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
6 changes: 4 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
@@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -203,7 +205,7 @@ fi
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,
# * DEFAULT_JVM_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.
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("org.zaproxy.common.settings") version "0.3.0"
id("org.zaproxy.common.settings") version "0.5.0"
id("com.diffplug.spotless") version "6.25.0" apply false
}

2 changes: 1 addition & 1 deletion src/test/java/org/zaproxy/VerifyScripts.java
Original file line number Diff line number Diff line change
@@ -104,7 +104,7 @@ private static Stream<Arguments> scriptsGroovy() {

private static Stream<Arguments> scriptsJavaScript() {
// Graal JS version being used does not yet support Java 22+
if (JRE.JAVA_22.compareTo(JRE.currentVersion()) <= 0) {
if (JRE.JAVA_22.compareTo(JRE.currentJre()) <= 0) {
return testData(".js", script -> {});
}
Engine engine =