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.
This commit is contained in:
Gábor Boskovits 2018-06-24 14:39:17 +02:00
parent 78754995e8
commit 2ab089b7ba
No known key found for this signature in database
GPG Key ID: 2506A96CCF630B21
1 changed files with 21 additions and 3 deletions

View File

@ -7000,8 +7000,6 @@ it manages project dependencies, gives diffs jars, and much more.")
(name "java-aqute-libg") (name "java-aqute-libg")
(arguments (arguments
`(#:jar-name "java-aqute-libg.jar" `(#: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 ;; The build fails when source/target more recent than 1.7. This
;; is a known issue. See: https://github.com/bndtools/bnd/issues/1327 ;; 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. ;; target. It work fine on 1.7, so we use 1.7.
#:make-flags (list "-Dant.build.javac.source=1.7" #:make-flags (list "-Dant.build.javac.source=1.7"
"-Dant.build.javac.target=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 (inputs
`(("slf4j" ,java-slf4j-api) `(("slf4j" ,java-slf4j-api)
("osgi-annot" ,java-osgi-annotation) ("osgi-annot" ,java-osgi-annotation)
("java-osgi-cmpn" ,java-osgi-cmpn) ("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 (define java-aqute-libg-bootstrap
(package (package