gnu: Add maven-surefire-common.
* gnu/packages/maven.scm (maven-surefire-common): New variable. * gnu/packages/java.scm (java-hawtjni, java-jansi-native, java-jansi): Install from pom file.
This commit is contained in:
parent
e1ee5a75f3
commit
b777e19437
2 changed files with 122 additions and 5 deletions
|
@ -11079,7 +11079,11 @@ including pre-existing objects that you do not have source-code of.")
|
||||||
(with-directory-excursion "hawtjni-generator/src/main/resources/"
|
(with-directory-excursion "hawtjni-generator/src/main/resources/"
|
||||||
(install-file "libhawtjni.so" lib)
|
(install-file "libhawtjni.so" lib)
|
||||||
(install-file "hawtjni.h" inc)))
|
(install-file "hawtjni.h" inc)))
|
||||||
#t)))))
|
#t))
|
||||||
|
(add-before 'install 'install-parent
|
||||||
|
(install-pom-file "pom.xml"))
|
||||||
|
(replace 'install
|
||||||
|
(install-from-pom "hawtjni-runtime/pom.xml")))))
|
||||||
(inputs
|
(inputs
|
||||||
`(("java-commons-cli" ,java-commons-cli)
|
`(("java-commons-cli" ,java-commons-cli)
|
||||||
("java-asm" ,java-asm)
|
("java-asm" ,java-asm)
|
||||||
|
@ -11138,8 +11142,16 @@ that is part of the SWT Tools project.")
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
(install-file "src/main/native-package/src/jansi.h"
|
(install-file "src/main/native-package/src/jansi.h"
|
||||||
(string-append (assoc-ref outputs "out") "/include"))
|
(string-append (assoc-ref outputs "out") "/include"))
|
||||||
#t)))))
|
#t))
|
||||||
(inputs
|
(add-before 'install 'fix-pom
|
||||||
|
(lambda _
|
||||||
|
;; pom contains variables to complete name, but we don't support that
|
||||||
|
(substitute* "pom.xml"
|
||||||
|
(("\\$\\{platform\\}") "native"))
|
||||||
|
#t))
|
||||||
|
(replace 'install
|
||||||
|
(install-from-pom "pom.xml")))))
|
||||||
|
(propagated-inputs
|
||||||
`(("java-hawtjni" ,java-hawtjni)))
|
`(("java-hawtjni" ,java-hawtjni)))
|
||||||
(home-page "https://fusesource.github.io/jansi/")
|
(home-page "https://fusesource.github.io/jansi/")
|
||||||
(synopsis "Native library for jansi")
|
(synopsis "Native library for jansi")
|
||||||
|
@ -11168,8 +11180,25 @@ console output.")
|
||||||
(modify-phases %standard-phases
|
(modify-phases %standard-phases
|
||||||
(add-after 'check 'clear-term
|
(add-after 'check 'clear-term
|
||||||
(lambda _
|
(lambda _
|
||||||
(invoke "echo" "-e" "\\e[0m"))))))
|
(invoke "echo" "-e" "\\e[0m")))
|
||||||
(inputs
|
(add-before 'install 'install-parent
|
||||||
|
(install-pom-file "pom.xml"))
|
||||||
|
(add-before 'install 'fix-pom
|
||||||
|
(lambda _
|
||||||
|
;; pom adds jansi native versions for different platforms, but we
|
||||||
|
;; only need one, so use native instead
|
||||||
|
(substitute* "jansi/pom.xml"
|
||||||
|
(("windows32") "native")
|
||||||
|
(("windows64") "native")
|
||||||
|
(("osx") "native")
|
||||||
|
(("linux32") "native")
|
||||||
|
(("linux64") "native")
|
||||||
|
(("freebsd32") "native")
|
||||||
|
(("freebsd64") "native"))
|
||||||
|
#t))
|
||||||
|
(replace 'install
|
||||||
|
(install-from-pom "jansi/pom.xml")))))
|
||||||
|
(propagated-inputs
|
||||||
`(("java-jansi-native" ,java-jansi-native)))
|
`(("java-jansi-native" ,java-jansi-native)))
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("java-junit" ,java-junit)
|
`(("java-junit" ,java-junit)
|
||||||
|
|
|
@ -3495,3 +3495,91 @@ starting from JUnit 4.")))
|
||||||
(synopsis "SureFire JUnit 4.0+ runner")
|
(synopsis "SureFire JUnit 4.0+ runner")
|
||||||
(description "This package contains the runner for tests run on a forked
|
(description "This package contains the runner for tests run on a forked
|
||||||
JVM, using JUnit 4.0 or later.")))
|
JVM, using JUnit 4.0 or later.")))
|
||||||
|
|
||||||
|
(define-public maven-surefire-common
|
||||||
|
(package
|
||||||
|
(inherit java-surefire-logger-api)
|
||||||
|
(name "maven-surefire-common")
|
||||||
|
(arguments
|
||||||
|
`(#:tests? #f; require mockito 2
|
||||||
|
#:jar-name "maven-surefire-common.jar"
|
||||||
|
#:source-dir "maven-surefire-common/src/main/java"
|
||||||
|
#:phases
|
||||||
|
(modify-phases %standard-phases
|
||||||
|
(add-before 'build 'prepare-shade
|
||||||
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
|
(mkdir-p "build/classes")
|
||||||
|
(with-directory-excursion "build/classes"
|
||||||
|
(for-each
|
||||||
|
(lambda (input)
|
||||||
|
(for-each
|
||||||
|
(lambda (jar-file)
|
||||||
|
(invoke "jar" "xf" jar-file)
|
||||||
|
(delete-file-recursively "META-INF"))
|
||||||
|
(find-files (assoc-ref inputs input) ".*.jar$")))
|
||||||
|
'("maven-shared-utils" "java-commons-io" "java-commons-lang3"
|
||||||
|
"java-commons-compress" "maven-common-artifact-filters")))
|
||||||
|
#t))
|
||||||
|
(add-after 'build 'shade
|
||||||
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
|
(let ((jarjar
|
||||||
|
(car (find-files (assoc-ref inputs "java-jarjar") ".*.jar$")))
|
||||||
|
(injar "maven-surefire-common.jar")
|
||||||
|
(outjar "maven-surefire-common-shaded.jar"))
|
||||||
|
(with-directory-excursion "build/jar"
|
||||||
|
(with-output-to-file "rules"
|
||||||
|
(lambda _
|
||||||
|
(format #t (string-append
|
||||||
|
"rule "
|
||||||
|
"org.apache.maven.shared.utils.** "
|
||||||
|
"org.apache.maven.surefire.shade.common."
|
||||||
|
"org.apache.maven.shared.utils.@1~%"))
|
||||||
|
(format #t (string-append
|
||||||
|
"rule "
|
||||||
|
"org.apache.commons.io.** "
|
||||||
|
"org.apache.maven.surefire.shade.common."
|
||||||
|
"org.apache.commons.io.@1~%"))
|
||||||
|
(format #t (string-append
|
||||||
|
"rule "
|
||||||
|
"org.apache.commons.lang3.** "
|
||||||
|
"org.apache.maven.surefire.shade.common."
|
||||||
|
"org.apache.commons.lang3.@1~%"))
|
||||||
|
(format #t (string-append
|
||||||
|
"rule "
|
||||||
|
"org.apache.commons.compress.** "
|
||||||
|
"org.apache.maven.surefire.shade.common."
|
||||||
|
"org.apache.commons.compress.@1~%"))))
|
||||||
|
(invoke "java" "-jar" jarjar "process" "rules" injar outjar)
|
||||||
|
(delete-file injar)
|
||||||
|
(rename-file outjar injar)))
|
||||||
|
#t))
|
||||||
|
(add-before 'install 'fix-pom
|
||||||
|
(lambda _
|
||||||
|
(substitute* "maven-surefire-common/pom.xml"
|
||||||
|
(("maven-toolchain") "maven-core"))
|
||||||
|
#t))
|
||||||
|
(replace 'install
|
||||||
|
(install-from-pom "maven-surefire-common/pom.xml")))))
|
||||||
|
(propagated-inputs
|
||||||
|
`(("java-surefire-api" ,java-surefire-api)
|
||||||
|
("java-surefire-extensions-api" ,java-surefire-extensions-api)
|
||||||
|
("java-surefire-booter" ,java-surefire-booter)
|
||||||
|
("maven-core" ,maven-core)
|
||||||
|
("maven-plugin-annotations" ,maven-plugin-annotations)
|
||||||
|
("maven-common-artifact-filters" ,maven-common-artifact-filters)
|
||||||
|
("maven-artifact-transfer" ,maven-artifact-transfer)
|
||||||
|
("java-plexus-java" ,java-plexus-java)
|
||||||
|
("java-jansi" ,java-jansi)
|
||||||
|
("java-commons-io" ,java-commons-io)
|
||||||
|
("java-commons-lang3" ,java-commons-lang3)
|
||||||
|
("java-commons-compress" ,java-commons-compress)
|
||||||
|
("maven-shared-utils" ,maven-shared-utils-3.1)
|
||||||
|
("java-surefire-parent-pom" ,java-surefire-parent-pom)))
|
||||||
|
(inputs
|
||||||
|
`(("java-jsr305" ,java-jsr305)))
|
||||||
|
(native-inputs
|
||||||
|
`(("unzip" ,unzip)
|
||||||
|
("java-jarjar" ,java-jarjar)))
|
||||||
|
(synopsis "API used in Surefire and Failsafe MOJO")
|
||||||
|
(description "This package contains an API used in SureFire and Failsafe
|
||||||
|
MOJO.")))
|
||||||
|
|
Reference in a new issue