Skip to content

Commit

Permalink
Merge pull request #75 from thc202/gradle/update-8.8
Browse files Browse the repository at this point in the history
Update Gradle, add Java 22 to CI
  • Loading branch information
psiinon authored Jun 17, 2024
2 parents 2e8fd11 + 1a14915 commit f7cd91c
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [11, 21]
java: [11, 21, 22]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/gradle-build-action@v2
- uses: gradle/actions/wrapper-validation@v3
- uses: gradle/actions/setup-gradle@v3
- run: ./gradlew assemble
- run: ./gradlew check
2 changes: 1 addition & 1 deletion .github/workflows/release-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
with:
distribution: 'temurin'
java-version: 11
- uses: gradle/gradle-build-action@v2
- uses: gradle/actions/setup-gradle@v3
- run: ./gradlew publishPlugin
env:
GRADLE_PUBLISH_KEY: ${{ secrets.ZAPBOT_GRADLE_PUBLISH_KEY }}
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.8.
- Update ZAP API client to version 1.14.0.

### Fixed
- Normalize the number of newlines when updating the changelog.

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 8.5.
The plugin requires at least Java 11 and Gradle 8.8.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
`kotlin-dsl`
id("com.gradle.plugin-publish") version "1.2.0"
id("com.gradle.plugin-publish") version "1.2.1"

id("com.diffplug.spotless")
id("org.zaproxy.common")
Expand All @@ -21,7 +21,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.13.0")
implementation("org.zaproxy:zap-clientapi:1.14.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 Down
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=c16d517b50dd28b3f5838f0e844b7520b8f1eb610f2f29de7e4e04a1b7c9c79b
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
distributionSha256Sum=f8b4f4772d302c8ff580bc40d0f56e715de69b163546944f787c87abf209c961
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,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
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
9 changes: 6 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id("org.zaproxy.common.settings") version "0.2.0"
id("org.zaproxy.common.settings") version "0.3.0"

id("com.diffplug.spotless") version "6.20.0" apply false
id("com.diffplug.spotless") version "6.25.0" apply false
}

rootProject.name = "gradle-plugin-add-on"
Expand All @@ -10,7 +10,10 @@ include("apigen")

rootProject.children.forEach { project -> setUpProject(settingsDir, project) }

fun setUpProject(parentDir: File, project: ProjectDescriptor) {
fun setUpProject(
parentDir: File,
project: ProjectDescriptor,
) {
project.projectDir = File(parentDir, project.name)
project.buildFileName = "${project.name}.gradle.kts"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ data class GitHubRepo(val owner: String, val name: String, val dir: File? = null
override fun toString() = "$owner/$name"
}

fun split(value: String?, pos: Int): String {
fun split(
value: String?,
pos: Int,
): String {
val values = value?.split('/')
return if (values?.size == 2) values[pos] else ""
}

0 comments on commit f7cd91c

Please sign in to comment.