summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorJulien Lepiller <julien@lepiller.eu>2020-06-27 23:58:07 +0200
committerJulien Lepiller <julien@lepiller.eu>2020-07-17 04:21:13 +0200
commitb777e194376ec5ace990789e92251f89983da3e6 (patch)
tree3516de8dbe960f9e36da7c7a4e7f0e0906ea45cc /gnu
parente1ee5a75f3017315bb82f38b068bd4c003464b64 (diff)
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.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/java.scm39
-rw-r--r--gnu/packages/maven.scm88
2 files changed, 122 insertions, 5 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index bc650968e05..f7d8c8c6966 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -11079,7 +11079,11 @@ including pre-existing objects that you do not have source-code of.")
11079 (with-directory-excursion "hawtjni-generator/src/main/resources/" 11079 (with-directory-excursion "hawtjni-generator/src/main/resources/"
11080 (install-file "libhawtjni.so" lib) 11080 (install-file "libhawtjni.so" lib)
11081 (install-file "hawtjni.h" inc))) 11081 (install-file "hawtjni.h" inc)))
11082 #t))))) 11082 #t))
11083 (add-before 'install 'install-parent
11084 (install-pom-file "pom.xml"))
11085 (replace 'install
11086 (install-from-pom "hawtjni-runtime/pom.xml")))))
11083 (inputs 11087 (inputs
11084 `(("java-commons-cli" ,java-commons-cli) 11088 `(("java-commons-cli" ,java-commons-cli)
11085 ("java-asm" ,java-asm) 11089 ("java-asm" ,java-asm)
@@ -11138,8 +11142,16 @@ that is part of the SWT Tools project.")
11138 (lambda* (#:key outputs #:allow-other-keys) 11142 (lambda* (#:key outputs #:allow-other-keys)
11139 (install-file "src/main/native-package/src/jansi.h" 11143 (install-file "src/main/native-package/src/jansi.h"
11140 (string-append (assoc-ref outputs "out") "/include")) 11144 (string-append (assoc-ref outputs "out") "/include"))
11141 #t))))) 11145 #t))
11142 (inputs 11146 (add-before 'install 'fix-pom
11147 (lambda _
11148 ;; pom contains variables to complete name, but we don't support that
11149 (substitute* "pom.xml"
11150 (("\\$\\{platform\\}") "native"))
11151 #t))
11152 (replace 'install
11153 (install-from-pom "pom.xml")))))
11154 (propagated-inputs
11143 `(("java-hawtjni" ,java-hawtjni))) 11155 `(("java-hawtjni" ,java-hawtjni)))
11144 (home-page "https://fusesource.github.io/jansi/") 11156 (home-page "https://fusesource.github.io/jansi/")
11145 (synopsis "Native library for jansi") 11157 (synopsis "Native library for jansi")
@@ -11168,8 +11180,25 @@ console output.")
11168 (modify-phases %standard-phases 11180 (modify-phases %standard-phases
11169 (add-after 'check 'clear-term 11181 (add-after 'check 'clear-term
11170 (lambda _ 11182 (lambda _
11171 (invoke "echo" "-e" "\\e[0m")))))) 11183 (invoke "echo" "-e" "\\e[0m")))
11172 (inputs 11184 (add-before 'install 'install-parent
11185 (install-pom-file "pom.xml"))
11186 (add-before 'install 'fix-pom
11187 (lambda _
11188 ;; pom adds jansi native versions for different platforms, but we
11189 ;; only need one, so use native instead
11190 (substitute* "jansi/pom.xml"
11191 (("windows32") "native")
11192 (("windows64") "native")
11193 (("osx") "native")
11194 (("linux32") "native")
11195 (("linux64") "native")
11196 (("freebsd32") "native")
11197 (("freebsd64") "native"))
11198 #t))
11199 (replace 'install
11200 (install-from-pom "jansi/pom.xml")))))
11201 (propagated-inputs
11173 `(("java-jansi-native" ,java-jansi-native))) 11202 `(("java-jansi-native" ,java-jansi-native)))
11174 (native-inputs 11203 (native-inputs
11175 `(("java-junit" ,java-junit) 11204 `(("java-junit" ,java-junit)
diff --git a/gnu/packages/maven.scm b/gnu/packages/maven.scm
index cbeda43b72f..bfb5a51807b 100644
--- a/gnu/packages/maven.scm
+++ b/gnu/packages/maven.scm
@@ -3495,3 +3495,91 @@ starting from JUnit 4.")))
3495 (synopsis "SureFire JUnit 4.0+ runner") 3495 (synopsis "SureFire JUnit 4.0+ runner")
3496 (description "This package contains the runner for tests run on a forked 3496 (description "This package contains the runner for tests run on a forked
3497JVM, using JUnit 4.0 or later."))) 3497JVM, using JUnit 4.0 or later.")))
3498
3499(define-public maven-surefire-common
3500 (package
3501 (inherit java-surefire-logger-api)
3502 (name "maven-surefire-common")
3503 (arguments
3504 `(#:tests? #f; require mockito 2
3505 #:jar-name "maven-surefire-common.jar"
3506 #:source-dir "maven-surefire-common/src/main/java"
3507 #:phases
3508 (modify-phases %standard-phases
3509 (add-before 'build 'prepare-shade
3510 (lambda* (#:key inputs #:allow-other-keys)
3511 (mkdir-p "build/classes")
3512 (with-directory-excursion "build/classes"
3513 (for-each
3514 (lambda (input)
3515 (for-each
3516 (lambda (jar-file)
3517 (invoke "jar" "xf" jar-file)
3518 (delete-file-recursively "META-INF"))
3519 (find-files (assoc-ref inputs input) ".*.jar$")))
3520 '("maven-shared-utils" "java-commons-io" "java-commons-lang3"
3521 "java-commons-compress" "maven-common-artifact-filters")))
3522 #t))
3523 (add-after 'build 'shade
3524 (lambda* (#:key inputs #:allow-other-keys)
3525 (let ((jarjar
3526 (car (find-files (assoc-ref inputs "java-jarjar") ".*.jar$")))
3527 (injar "maven-surefire-common.jar")
3528 (outjar "maven-surefire-common-shaded.jar"))
3529 (with-directory-excursion "build/jar"
3530 (with-output-to-file "rules"
3531 (lambda _
3532 (format #t (string-append
3533 "rule "
3534 "org.apache.maven.shared.utils.** "
3535 "org.apache.maven.surefire.shade.common."
3536 "org.apache.maven.shared.utils.@1~%"))
3537 (format #t (string-append
3538 "rule "
3539 "org.apache.commons.io.** "
3540 "org.apache.maven.surefire.shade.common."
3541 "org.apache.commons.io.@1~%"))
3542 (format #t (string-append
3543 "rule "
3544 "org.apache.commons.lang3.** "
3545 "org.apache.maven.surefire.shade.common."
3546 "org.apache.commons.lang3.@1~%"))
3547 (format #t (string-append
3548 "rule "
3549 "org.apache.commons.compress.** "
3550 "org.apache.maven.surefire.shade.common."
3551 "org.apache.commons.compress.@1~%"))))
3552 (invoke "java" "-jar" jarjar "process" "rules" injar outjar)
3553 (delete-file injar)
3554 (rename-file outjar injar)))
3555 #t))
3556 (add-before 'install 'fix-pom
3557 (lambda _
3558 (substitute* "maven-surefire-common/pom.xml"
3559 (("maven-toolchain") "maven-core"))
3560 #t))
3561 (replace 'install
3562 (install-from-pom "maven-surefire-common/pom.xml")))))
3563 (propagated-inputs
3564 `(("java-surefire-api" ,java-surefire-api)
3565 ("java-surefire-extensions-api" ,java-surefire-extensions-api)
3566 ("java-surefire-booter" ,java-surefire-booter)
3567 ("maven-core" ,maven-core)
3568 ("maven-plugin-annotations" ,maven-plugin-annotations)
3569 ("maven-common-artifact-filters" ,maven-common-artifact-filters)
3570 ("maven-artifact-transfer" ,maven-artifact-transfer)
3571 ("java-plexus-java" ,java-plexus-java)
3572 ("java-jansi" ,java-jansi)
3573 ("java-commons-io" ,java-commons-io)
3574 ("java-commons-lang3" ,java-commons-lang3)
3575 ("java-commons-compress" ,java-commons-compress)
3576 ("maven-shared-utils" ,maven-shared-utils-3.1)
3577 ("java-surefire-parent-pom" ,java-surefire-parent-pom)))
3578 (inputs
3579 `(("java-jsr305" ,java-jsr305)))
3580 (native-inputs
3581 `(("unzip" ,unzip)
3582 ("java-jarjar" ,java-jarjar)))
3583 (synopsis "API used in Surefire and Failsafe MOJO")
3584 (description "This package contains an API used in SureFire and Failsafe
3585MOJO.")))