From 2ab089b7ba531b0a28e9fe65a44a8a4af4b1d2bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Boskovits?= Date: Sun, 24 Jun 2018 14:39:17 +0200 Subject: gnu: java-aqute-libg: Enable tests. * gnu/packages/java.scm (java-aqute-libg)[arguments]: Remove #:source-dir and #:tests?, add #:phases 'chdir and 'create-test-directory. [native-inputs]: Add java-hamcrest-core and java-junit. --- gnu/packages/java.scm | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index aba8119741..a13f6f18d1 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -7000,8 +7000,6 @@ it manages project dependencies, gives diffs jars, and much more.") (name "java-aqute-libg") (arguments `(#:jar-name "java-aqute-libg.jar" - #:source-dir "aQute.libg/src" - #:tests? #f)); FIXME: tests are in "aQute.libg/test", not in a java directory ;; The build fails when source/target more recent than 1.7. This ;; is a known issue. See: https://github.com/bndtools/bnd/issues/1327 ;; @@ -7010,11 +7008,31 @@ it manages project dependencies, gives diffs jars, and much more.") ;; target. It work fine on 1.7, so we use 1.7. #:make-flags (list "-Dant.build.javac.source=1.7" "-Dant.build.javac.target=1.7") + #:phases + (modify-phases %standard-phases + (add-before 'configure 'chdir + ;; Change to aQute.libg directory, so that the relative + ;; paths in the tests aren't broken. + (lambda _ + (chdir "aQute.libg") + #t)) + (add-before 'check 'create-test-directory + ;; Copy the test directory to test/java, since that's where + ;; ant-build-system's default project in build.xml expects to find + ;; the test classes. Leave a copy in the original place to not + ;; break paths in tests. + (lambda _ + (mkdir "src/test") + (copy-recursively "test" "src/test/java") + #t))))) (inputs `(("slf4j" ,java-slf4j-api) ("osgi-annot" ,java-osgi-annotation) ("java-osgi-cmpn" ,java-osgi-cmpn) - ("osgi" ,java-osgi-core))))) + ("osgi" ,java-osgi-core))) + (native-inputs + `(("hamcrest" ,java-hamcrest-core) + ("java-junit" ,java-junit))))) (define java-aqute-libg-bootstrap (package -- cgit v1.2.3