git: c0eef0ceec76 - main - java/jxgrabkey: overwrite source- and target-versions on command-line.

From: Mikhail Teterin <mi_at_FreeBSD.org>
Date: Thu, 19 May 2022 05:30:07 UTC
The branch main has been updated by mi:

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

commit c0eef0ceec76f8e99a152aca04e938dcb12f7261
Author:     Mikhail Teterin <mi@FreeBSD.org>
AuthorDate: 2022-05-19 05:27:51 +0000
Commit:     Mikhail Teterin <mi@FreeBSD.org>
CommitDate: 2022-05-19 05:27:51 +0000

    java/jxgrabkey: overwrite source- and target-versions on command-line.
    
    The author's properties file (from 2010) sets source- and target-versions
    to 1.5, which is too old for JDK-1.7, for example. Instead of
    patching the properties-file, overwrite the two settings on
    command-line. Use the conservative value of 1.7...
---
 java/jxgrabkey/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/java/jxgrabkey/Makefile b/java/jxgrabkey/Makefile
index 9b882e200b0f..f7e195b72c1f 100644
--- a/java/jxgrabkey/Makefile
+++ b/java/jxgrabkey/Makefile
@@ -20,11 +20,12 @@ TEST_BUILD_DEPENDS=	${JAVALIBDIR}/junit.jar:java/junit	\
 MAKE_ENV+=	JAVA_HOME=${JAVA_HOME} OPSYS=${OPSYS}
 PLIST_FILES=	%%JAVAJARDIR%%/JXGrabKey.jar lib/libJXGrabKey.so
 USE_LDCONFIG=	yes
+ANT_ARGS=	-Djavac.source=1.7 -Djavac.target=1.7
 
 do-build:
 	${SETENV} ${MAKE_ENV} ${MAKE} -C ${WRKSRC}/JXGrabKey/C++	\
 		-f ${FILESDIR}/Makefile.JXGrabKey libJXGrabKey.so
-	cd ${WRKSRC}/JXGrabKey/Java && ${ANT} -verbose jar
+	cd ${WRKSRC}/JXGrabKey/Java && ${ANT} -verbose jar ${ANT_ARGS}
 
 do-install:
 	${INSTALL_LIB} ${WRKSRC}/JXGrabKey/C++/libJXGrabKey.so ${STAGEDIR}${PREFIX}/lib/
@@ -36,6 +37,7 @@ do-test-TEST-on: build
 		${SETENV} CLASSPATH=${JAVALIBDIR}/junit.jar:${JAVALIBDIR}/hamcrest.jar	\
 		    LD_LIBRARY_PATH=${WRKSRC}/JXGrabKey/C++	\
 			${ANT} -Djavac.classpath=${JAVALIBDIR}/junit.jar \
+			    ${ANT_ARGS} \
 			    test
 
 .include <bsd.port.mk>