* [bug#32963] [PATCH] guix: ant-build-system: Install resources.
@ 2018-10-07 9:45 Danny Milosavljevic
0 siblings, 0 replies; only message in thread
From: Danny Milosavljevic @ 2018-10-07 9:45 UTC (permalink / raw)
To: 32963
* 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)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-10-07 9:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-07 9:45 [bug#32963] [PATCH] guix: ant-build-system: Install resources Danny Milosavljevic
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).