Skip to content

Commit

Permalink
Merge pull request #8523 from thc202/gradle/update-8.8
Browse files Browse the repository at this point in the history
  • Loading branch information
kingthorin committed Jun 20, 2024
2 parents aabd228 + 8bdafa7 commit 361ce4f
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 54 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
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
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import net.ltgt.gradle.errorprone.errorprone
plugins {
id("com.diffplug.spotless")
id("org.sonarqube") version "5.0.0.4638"
id("com.github.ben-manes.versions") version "0.50.0"
id("net.ltgt.errorprone") version "3.1.0"
id("com.github.ben-manes.versions") version "0.51.0"
id("net.ltgt.errorprone") version "4.0.0"
}

apply(from = "$rootDir/gradle/ci.gradle.kts")
Expand All @@ -22,7 +22,7 @@ subprojects {

project.plugins.withType(JavaPlugin::class) {
dependencies {
"errorprone"("com.google.errorprone:error_prone_core:2.26.1")
"errorprone"("com.google.errorprone:error_prone_core:2.28.0")
}
}

Expand Down
12 changes: 6 additions & 6 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ dependencies {
exclude(group = "org.jenkins-ci")
}
// Gradle Plugins
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.20.0")
implementation("de.undercouch:gradle-download-task:5.4.0")
implementation("edu.sc.seis.launch4j:launch4j:3.0.3")
implementation("gradle.plugin.install4j.install4j.buildtools:gradle_publish:10.0.6")
implementation("me.champeau.gradle:japicmp-gradle-plugin:0.4.1")
implementation("org.cyclonedx:cyclonedx-gradle-plugin:1.7.4")
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0")
implementation("de.undercouch:gradle-download-task:5.6.0")
implementation("edu.sc.seis.launch4j:launch4j:3.0.5")
implementation("gradle.plugin.install4j.install4j.buildtools:gradle_publish:10.0.8")
implementation("me.champeau.gradle:japicmp-gradle-plugin:0.4.3")
implementation("org.cyclonedx:cyclonedx-gradle-plugin:1.8.2")
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var install4jHomeDirValidated = false
val install4jHomeDir: String? by project
val install4jLicense: String? by project

val install4jVersion = "10.0.6"
val install4jVersion = "10.0.8"

install4j {
installDir = file("$install4jHomeDir")
Expand Down Expand Up @@ -143,7 +143,7 @@ if (install4jHomeDir == null && Os.isFamily(Os.FAMILY_UNIX)) {
dependsOn(downloadInstall4jBin)
src(install4jBinFile)
algorithm("SHA-256")
checksum("db8144cfcb442f98dfb12fa4ce05330964104a6c65159a7d8358f9f5c5da8e55")
checksum("3d64c4a28d2b11ea26ae3cb8f1b0288de76811c1e0f37e06a2a4d8498b8130e7")
}

val unpackInstall4jBin by tasks.registering(Copy::class) {
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
4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("org.zaproxy.common.settings") version "0.2.0"
id("com.diffplug.spotless") version "6.20.0" apply false
id("org.zaproxy.common.settings") version "0.3.0"
id("com.diffplug.spotless") version "6.25.0" apply false
}

rootProject.name = "zaproxy"
Expand Down
70 changes: 44 additions & 26 deletions zap/zap.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ dependencies {
testCompileOnly("biz.aQute.bnd:biz.aQute.bnd.annotation:6.4.1")
testCompileOnly("com.google.code.findbugs:findbugs-annotations:3.0.1")

testImplementation("net.bytebuddy:byte-buddy:1.14.14")
testImplementation("net.bytebuddy:byte-buddy:1.14.17")
testImplementation("org.hamcrest:hamcrest-core:2.2")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.1")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("org.mockito:mockito-junit-jupiter:5.7.0")
testImplementation("org.mockito:mockito-junit-jupiter:5.12.0")
testImplementation("org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion")

testRuntimeOnly(files(distDir))
Expand All @@ -147,15 +147,26 @@ listOf("jar", "jarDaily", "jarWithBom").forEach {
tasks.named<Jar>(it) {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
dirMode = "0755".toIntOrNull(8)
fileMode = "0644".toIntOrNull(8)

val attrs = mapOf(
"Main-Class" to "org.zaproxy.zap.ZAP",
"Implementation-Version" to ToString({ archiveVersion.get() }),
"Create-Date" to creationDate,
"Class-Path" to ToString({ configurations.runtimeClasspath.get().files.stream().map { file -> "lib/${file.name}" }.sorted().collect(Collectors.joining(" ")) }),
)
dirPermissions {
unix("0755")
}
filePermissions {
unix("0644")
}

val attrs =
mapOf(
"Main-Class" to "org.zaproxy.zap.ZAP",
"Implementation-Version" to ToString({ archiveVersion.get() }),
"Create-Date" to creationDate,
"Class-Path" to
ToString({
configurations.runtimeClasspath.get().files.stream().map {
file ->
"lib/${file.name}"
}.sorted().collect(Collectors.joining(" "))
}),
)

manifest {
attributes(attrs)
Expand Down Expand Up @@ -204,10 +215,11 @@ tasks.named(LifecycleBasePlugin.CHECK_TASK_NAME) {

tasks.named<Javadoc>("javadoc") {
title = "Zed Attack Proxy"
source = sourceSets["main"].allJava.matching {
include("org/parosproxy/**")
include("org/zaproxy/**")
}
source =
sourceSets["main"].allJava.matching {
include("org/parosproxy/**")
include("org/zaproxy/**")
}
(options as StandardJavadocDocletOptions).run {
links("https://docs.oracle.com/javase/8/docs/api/")
encoding = "UTF-8"
Expand All @@ -219,7 +231,9 @@ val langPack by tasks.registering(Zip::class) {
group = LifecycleBasePlugin.BUILD_GROUP
description = "Assembles the language pack for the Core Language Files add-on."

archiveFileName.set(layout.buildDirectory.file("langpack/ZAP_${project.version}_language_pack.$versionLangFile.zaplang").get().asFile.absolutePath)
archiveFileName.set(
layout.buildDirectory.file("langpack/ZAP_${project.version}_language_pack.$versionLangFile.zaplang").get().asFile.absolutePath,
)
isPreserveFileTimestamps = false
isReproducibleFileOrder = true

Expand All @@ -233,7 +247,10 @@ val langPack by tasks.registering(Zip::class) {

tasks.register<Copy>("copyLangPack") {
group = "ZAP Misc"
description = "Copies the language pack into the Core Language Files add-on (assumes zap-extensions repo is in same directory as zaproxy)."
description = (
"Copies the language pack into the Core Language Files add-on " +
"(assumes zap-extensions repo is in same directory as zaproxy)."
)

from(langPack)
into("$rootDir/../zap-extensions/addOns/coreLang/src/main/zapHomeFiles/lang/")
Expand Down Expand Up @@ -272,14 +289,15 @@ listOf(
"org.zaproxy.zap.extension.api.WikiAPIGenerator",
).forEach {
val langName = it.removePrefix("org.zaproxy.zap.extension.api.").removeSuffix("APIGenerator")
val task = tasks.register<JavaExec>("generate${langName}ApiEndpoints") {
group = "ZAP Misc"
description = "Generates (and copies) the ZAP API endpoints for $langName."

mainClass.set(it)
classpath = sourceSets["main"].runtimeClasspath
workingDir = file("$rootDir")
}
val task =
tasks.register<JavaExec>("generate${langName}ApiEndpoints") {
group = "ZAP Misc"
description = "Generates (and copies) the ZAP API endpoints for $langName."

mainClass.set(it)
classpath = sourceSets["main"].runtimeClasspath
workingDir = file("$rootDir")
}

generateAllApiEndpoints {
dependsOn(task)
Expand Down

0 comments on commit 361ce4f

Please sign in to comment.