From f403d7abdf28d2d6e4446a2989e0d37d023b6b53 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Tue, 5 Sep 2017 22:14:11 +0200 Subject: guix: ant-build-system: Add #:test-include and #:test-exclude arguments. * guix/build-system/ant.scm: Add #:test-include and #:test-exclude arguments. * guix/build/ant-build-system.scm: Generate test list from arguments. * doc/guix.texi (Build Systems): Document it. --- guix/build/ant-build-system.scm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'guix/build/ant-build-system.scm') diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm index 727d3a3b25..a440daf054 100644 --- a/guix/build/ant-build-system.scm +++ b/guix/build/ant-build-system.scm @@ -36,7 +36,9 @@ (define-module (guix build ant-build-system) ;; Code: (define* (default-build.xml jar-name prefix #:optional - (source-dir ".") (test-dir "./test") (main-class #f)) + (source-dir ".") (test-dir "./test") (main-class #f) + (test-include '("**/*Test.java")) + (test-exclude '("**/Abstract*Test.java"))) "Create a simple build.xml with standard targets for Ant." (call-with-output-file "build.xml" (lambda (port) @@ -109,7 +111,12 @@ (define* (default-build.xml jar-name prefix #:optional (batchtest (@ (fork "yes") (todir "${test.home}/test-reports")) (fileset (@ (dir "${test.home}/java")) - (include (@ (name "**/*Test.java" ))))))) + ,@(map (lambda (file) + `(include (@ (name ,file)))) + test-include) + ,@(map (lambda (file) + `(exclude (@ (name ,file)))) + test-exclude))))) (target (@ (name "jar") (depends "compile, manifest")) @@ -150,12 +157,14 @@ (define* (unpack #:key source #:allow-other-keys) (define* (configure #:key inputs outputs (jar-name #f) (source-dir "src") (test-dir "src/test") - (main-class #f) #:allow-other-keys) + (main-class #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)) + source-dir test-dir main-class test-include test-exclude)) (setenv "JAVA_HOME" (assoc-ref inputs "jdk")) (setenv "CLASSPATH" (generate-classpath inputs))) -- cgit v1.2.3