GNU bug report logs - #32963
[PATCH] guix: ant-build-system: Install resources.

Previous Next

Package: guix-patches;

Reported by: Danny Milosavljevic <dannym <at> scratchpost.org>

Date: Sun, 7 Oct 2018 09:49:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 32963 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#32963; Package guix-patches. (Sun, 07 Oct 2018 09:49:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Danny Milosavljevic <dannym <at> scratchpost.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 07 Oct 2018 09:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: guix-patches <at> gnu.org
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>
Subject: [PATCH] guix: ant-build-system: Install resources.
Date: Sun,  7 Oct 2018 11:45:49 +0200
* guix/build/ant-build-system.scm (default-build.xml): Install resources.
---
 guix/build/ant-build-system.scm | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm
index d79a2d55e..cb3164211 100644
--- a/guix/build/ant-build-system.scm
+++ b/guix/build/ant-build-system.scm
@@ -38,7 +38,8 @@
 (define* (default-build.xml jar-name prefix #:optional
                             (source-dir ".") (test-dir "./test") (main-class #f)
                             (test-include '("**/*Test.java"))
-                            (test-exclude '("**/Abstract*Test.java")))
+                            (test-exclude '("**/Abstract*Test.java"))
+                            (source-resource-dir #f))
   "Create a simple build.xml with standard targets for Ant."
   (call-with-output-file "build.xml"
     (lambda (port)
@@ -81,6 +82,14 @@
                                    (destdir "${classes.dir}")
                                    (classpath (@ (refid "classpath"))))))
 
+                 (target (@ (name "add-resources")
+                            (depends "compile"))
+                  ,(if source-resource-dir
+                      `(copy (@ (todir "${classes.dir}"))
+                             (fileset (@ (dir ,source-resource-dir))
+                                      (include (@ (name "**/*")))))
+                       ""))
+
                  (target (@ (name "compile-tests"))
                          (mkdir (@ (dir "${test.classes.dir}")))
                          (javac (@ (includeantruntime "false")
@@ -116,7 +125,7 @@
                                                        test-exclude)))))
 
                  (target (@ (name "jar")
-                            (depends "compile, manifest"))
+                            (depends "compile, add-resources, manifest"))
                          (mkdir (@ (dir "${jar.dir}")))
                          (exec (@ (executable "jar"))
                                (arg (@ (line ,(string-append "-cmf ${manifest.file} "
@@ -162,7 +171,10 @@ to the default GNU unpack strategy."
     (default-build.xml jar-name
                        (string-append (assoc-ref outputs "out")
                                       "/share/java")
-                       source-dir test-dir main-class test-include test-exclude))
+                       source-dir test-dir main-class test-include test-exclude
+                       (if (file-exists? "src/main/resources")
+                           "src/main/resources"
+                           #f)))
   (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
   (setenv "CLASSPATH" (generate-classpath inputs))
   #t)




This bug report was last modified 6 years and 253 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.