git: 2a5f4ad4879d - main - security/zaproxy: Fix build after of gradle update to 7.6

From: Jose Alonso Cardenas Marquez <acm_at_FreeBSD.org>
Date: Mon, 19 Dec 2022 20:10:53 UTC
The branch main has been updated by acm:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2a5f4ad4879dd0806c88e0519854ff54511d1005

commit 2a5f4ad4879dd0806c88e0519854ff54511d1005
Author:     Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
AuthorDate: 2022-12-19 20:08:44 +0000
Commit:     Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
CommitDate: 2022-12-19 20:08:44 +0000

    security/zaproxy: Fix build after of gradle update to 7.6
    
    - Fix  way to generate plugins distfile
    - Bump PORTREVISION
---
 security/zaproxy/Makefile                             |  5 ++++-
 security/zaproxy/distinfo                             | 10 +++++-----
 ...org-zaproxy-zap-tasks_GradleBuildWithGitRepos.java | 19 +++++++++++++++++++
 3 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/security/zaproxy/Makefile b/security/zaproxy/Makefile
index a972cbe90029..5a62cf4b1eec 100644
--- a/security/zaproxy/Makefile
+++ b/security/zaproxy/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	zaproxy
 DISTVERSIONPREFIX=	v
 DISTVERSION=	2.12.0
+PORTREVISION=	1
 CATEGORIES=	security java
 
 MAINTAINER=	acm@FreeBSD.org
@@ -35,11 +36,13 @@ DESKTOP_ENTRIES="ZAP" "OWASP ZAP" "${PREFIX}/share/pixmaps/zaproxy.png" "${PORTN
 DEV_UPDATE_MODE=	no
 
 DEPS_CACHE_DIR=	${WRKDIR}
+EXCLUDE_TASK=	--exclude-task :zap:downloadMainAddOns
 
 MAKE_ENV+=	JAVA_HOME=${JAVA_HOME}
 SUB_LIST=	JAVA_HOME=${JAVA_HOME}
 
 .if (${DEV_UPDATE_MODE} == "yes")
+EXCLUDE_TASK=	#
 post-build:
 	@cd ${DEPS_CACHE_DIR} && ${TAR} czf ${DISTDIR}/${DIST_SUBDIR}/${PORTNAME}-${DISTVERSION}-deps${EXTRACT_SUFX} gradle-${PORTNAME}
 	@cd ${WRKSRC}/zap/build && ${TAR} czf ${DISTDIR}/${DIST_SUBDIR}/${PORTNAME}-${DISTVERSION}-plugins${EXTRACT_SUFX} mainAddOns
@@ -63,7 +66,7 @@ post-patch:
 do-build:
 	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} gradle \
 		--gradle-user-home ${DEPS_CACHE_DIR}/gradle-${PORTNAME} --project-cache-dir ${DEPS_CACHE_DIR}/gradle-${PORTNAME} \
-		${GRADLE_ARGS} --build-cache :zap:distCore --exclude-task :zap:downloadMainAddOns
+		${GRADLE_ARGS} --build-cache :zap:distCore ${EXCLUDE_TASK}
 
 do-install:
 	${INSTALL_SCRIPT} ${WRKSRC}/zap/build/distFiles/zap.sh ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
diff --git a/security/zaproxy/distinfo b/security/zaproxy/distinfo
index eb03a80126a5..2fe760372a9b 100644
--- a/security/zaproxy/distinfo
+++ b/security/zaproxy/distinfo
@@ -1,7 +1,7 @@
-TIMESTAMP = 1667261004
-SHA256 (zaproxy-2.12.0-deps.tar.gz) = 7a7e4839a25f883f91bcabfe836b022819947af6f39be6c6dd9bd4e27fd17704
-SIZE (zaproxy-2.12.0-deps.tar.gz) = 374388136
-SHA256 (zaproxy-2.12.0-plugins.tar.gz) = 2d6dc11846aa82df4f2452da91280b45a1266ea2149a58442c4005a346c1d1e2
-SIZE (zaproxy-2.12.0-plugins.tar.gz) = 256334454
+TIMESTAMP = 1671479878
+SHA256 (zaproxy-2.12.0-deps.tar.gz) = cde40f1763645ce0380098dde0638f8e76ec27a4eff35d04b7e075a3e66fb6a8
+SIZE (zaproxy-2.12.0-deps.tar.gz) = 331125479
+SHA256 (zaproxy-2.12.0-plugins.tar.gz) = 5b22706fee46203944c3667e5c490ff0af27bba20360d2f4390fe2062a9e390c
+SIZE (zaproxy-2.12.0-plugins.tar.gz) = 256337831
 SHA256 (zaproxy-zaproxy-v2.12.0_GH0.tar.gz) = caae3ad419d9ea6f327cc4d3a4450748aba9dedc0377d052381c352ec7976fac
 SIZE (zaproxy-zaproxy-v2.12.0_GH0.tar.gz) = 7442143
diff --git a/security/zaproxy/files/patch-buildSrc-src-main-java-org-zaproxy-zap-tasks_GradleBuildWithGitRepos.java b/security/zaproxy/files/patch-buildSrc-src-main-java-org-zaproxy-zap-tasks_GradleBuildWithGitRepos.java
new file mode 100644
index 000000000000..6650874c4130
--- /dev/null
+++ b/security/zaproxy/files/patch-buildSrc-src-main-java-org-zaproxy-zap-tasks_GradleBuildWithGitRepos.java
@@ -0,0 +1,19 @@
+--- buildSrc/src/main/java/org/zaproxy/zap/tasks/GradleBuildWithGitRepos.java	2022-12-19 14:49:43.923955000 -0500
++++ buildSrc/src/main/java/org/zaproxy/zap/tasks/GradleBuildWithGitRepos.java	2022-12-19 14:49:59.270410000 -0500
+@@ -48,6 +48,7 @@
+ import org.gradle.api.provider.Property;
+ import org.gradle.api.tasks.Console;
+ import org.gradle.api.tasks.Input;
++import org.gradle.api.tasks.InputDirectory;
+ import org.gradle.api.tasks.InputFile;
+ import org.gradle.api.tasks.Nested;
+ import org.gradle.api.tasks.TaskAction;
+@@ -80,7 +81,7 @@
+         return repositoriesDataFile;
+     }
+ 
+-    @Input
++    @InputDirectory
+     public DirectoryProperty getRepositoriesDirectory() {
+         return repositoriesDirectory;
+     }