summary refs log tree commit diff
path: root/gnu/packages/groovy.scm
diff options
context:
space:
mode:
authorJulien Lepiller <julien@lepiller.eu>2018-03-16 14:31:22 +0100
committerJulien Lepiller <julien@lepiller.eu>2018-05-09 13:36:50 +0200
commit5b46d3f61d00e1dc7ee2326b96ab47c76305e98a (patch)
tree677cd49617ba09ba7271e6da523ba924aec141b8 /gnu/packages/groovy.scm
parentb869c5ceaa450184fd59722ef3e369922bced528 (diff)
downloadguix-5b46d3f61d00e1dc7ee2326b96ab47c76305e98a.tar.gz
gnu: Add groovy-bsf.
* gnu/packages/groovy.scm (groovy-bsf): New variable.
Diffstat (limited to 'gnu/packages/groovy.scm')
-rw-r--r--gnu/packages/groovy.scm57
1 files changed, 57 insertions, 0 deletions
diff --git a/gnu/packages/groovy.scm b/gnu/packages/groovy.scm
index f6bf80e654..342a6535e6 100644
--- a/gnu/packages/groovy.scm
+++ b/gnu/packages/groovy.scm
@@ -434,3 +434,60 @@ similar to javadoc.")))
        ,@(package-native-inputs java-groovy-bootstrap)))
     (synopsis "Groovy ant tasks")
     (description "This package contains groovy-related ant tasks definitions.")))
+
+(define groovy-bsf
+  (package
+    (inherit groovy-bootstrap)
+    (name "groovy-bsf")
+    (arguments
+     `(#:jar-name "groovy-bsf.jar"
+       #:jdk ,icedtea-8
+       #:test-dir "src/test"
+       #:test-exclude (list
+;; exception from Groovy: org.codehaus.groovy.runtime.InvokerInvocationException:
+;; groovy.lang.MissingMethodException: No signature of method:
+;; java.util.ArrayList.each() is applicable for argument types:
+;; (groovy.script.MapFromList$_doit_closure1) values:
+;; [groovy.script.MapFromList$_doit_closure1@17e554d5]
+                        "**/BSFTest.java")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'chdir
+           (lambda _
+             (chdir "subprojects/groovy-bsf")
+             #t))
+         (replace 'build
+           (lambda _
+             (mkdir-p "build/classes")
+             (mkdir-p "build/jar")
+             (apply invoke "java" "-cp" (getenv "CLASSPATH")
+                    "org.codehaus.groovy.tools.FileSystemCompiler"
+                    "-d" "build/classes" "-j"; joint compilation
+                    (find-files "src/main" ".*\\.(groovy|java)$"))
+             (invoke "jar" "-cf" "build/jar/groovy-bsf.jar"
+                     "-C" "build/classes" ".")
+             #t))
+         (replace 'check
+           (lambda _
+             (mkdir-p "build/test-classes")
+             (substitute* "build.xml"
+               (("depends=\"compile-tests\"") "depends=\"\""))
+             (apply invoke "java" "-cp"
+                    (string-append (getenv "CLASSPATH") ":build/classes")
+                    "org.codehaus.groovy.tools.FileSystemCompiler"
+                    "-d" "build/test-classes" "-j"
+                    (find-files "src/test" ".*\\.(groovy|java)$"))
+             (invoke "ant" "check")
+             #t)))))
+    (inputs
+     `(("java-commons-bsf" ,java-commons-bsf)
+       ,@(package-inputs groovy-bootstrap)))
+    (native-inputs
+     `(("groovy-bootstrap" ,groovy-bootstrap)
+       ("groovy-test" ,groovy-test)
+       ("groovy-tests-bootstrap" ,groovy-tests-bootstrap)
+       ("java-commons-logging-minimal" ,java-commons-logging-minimal)
+       ,@(package-native-inputs java-groovy-bootstrap)))
+    (synopsis "Groovy BSF engine")
+    (description "This package defines the BSF engine for using Groovy inside
+any @dfn{Bean Scripting Framework} (BSF) application.")))