aboutsummaryrefslogtreecommitdiff
path: root/guix/build/ant-build-system.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/build/ant-build-system.scm')
-rw-r--r--guix/build/ant-build-system.scm31
1 files changed, 23 insertions, 8 deletions
diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm
index d29912bf59..ced34177f4 100644
--- a/guix/build/ant-build-system.scm
+++ b/guix/build/ant-build-system.scm
@@ -37,6 +37,7 @@
(define* (default-build.xml jar-name prefix #:optional
(source-dir ".") (test-dir "./test") (main-class #f)
+ (use-java-modules? #f)
(test-include '("**/*Test.java"))
(test-exclude '("**/Abstract*Test.java")))
"Create a simple build.xml with standard targets for Ant."
@@ -65,7 +66,7 @@
(value "first")))
(property (@ (environment "env")))
(path (@ (id "classpath"))
- (pathelement (@ (location "${env.CLASSPATH}"))))
+ (pathelement (@ (path "${env.CLASSPATH}"))))
(target (@ (name "manifest"))
(mkdir (@ (dir "${manifest.dir}")))
@@ -79,18 +80,30 @@
(mkdir (@ (dir "${classes.dir}")))
(javac (@ (includeantruntime "false")
(srcdir ,source-dir)
- (destdir "${classes.dir}")
- (classpath (@ (refid "classpath"))))))
+ (destdir "${classes.dir}"))
+ ,(if use-java-modules?
+ `((modulepath (@ (refid "classpath"))))
+ '())
+ (classpath (@ (refid "classpath")))))
(target (@ (name "compile-tests"))
(mkdir (@ (dir "${test.classes.dir}")))
(javac (@ (includeantruntime "false")
(srcdir ,test-dir)
(destdir "${test.classes.dir}"))
- (classpath
- (pathelement (@ (path "${env.CLASSPATH}")))
- (pathelement (@ (location "${classes.dir}")))
- (pathelement (@ (location "${test.classes.dir}"))))))
+ ,(if use-java-modules?
+ `((classpath
+ (pathelement
+ (@ (path "${env.CLASSPATH}")))
+ (pathelement
+ (@ (location "${classes.dir}")))
+ (pathelement
+ (@ (location "${test.classes.dir}")))))
+ '())
+ (classpath
+ (pathelement (@ (path "${env.CLASSPATH}")))
+ (pathelement (@ (location "${classes.dir}")))
+ (pathelement (@ (location "${test.classes.dir}"))))))
(target (@ (name "check")
(depends "compile-tests"))
@@ -156,13 +169,15 @@ to the default GNU unpack strategy."
(source-dir "src")
(test-dir "src/test")
(main-class #f)
+ (use-java-modules? #f)
(test-include '("**/*Test.java"))
(test-exclude '("**/Abstract*.java")) #:allow-other-keys)
(when jar-name
(default-build.xml jar-name
(string-append (assoc-ref outputs "out")
"/share/java")
- source-dir test-dir main-class test-include test-exclude))
+ source-dir test-dir main-class use-java-modules?
+ test-include test-exclude))
(setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
(setenv "CLASSPATH" (generate-classpath inputs))
#t)