[PATCH 0/3] Enhancemante for the ant-build-system

  • Done
  • quality assurance status badge
Details
2 participants
  • Hartmut Goebel
  • Julien Lepiller
Owner
unassigned
Submitted by
Hartmut Goebel
Severity
normal
H
H
Hartmut Goebel wrote on 16 Jul 2019 22:08
(address . guix-patches@gnu.org)
20190716200839.3035-1-h.goebel@crazy-compilers.com
Here are some old patches I found when cleaning up my repository. I created
them as part of my efforts for building maven. I'm not sure whether these are
still useful.

Hartmut Goebel (3):
guix: ant-build-system: Use ant-task "jar" instead of executing "jar".
guix: ant-build-system: Put dummy project-name into default build.xml.
guix: ant-build-system: Use absolute path as base-dir.

guix/build/ant-build-system.scm | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

--
2.21.0
H
H
Hartmut Goebel wrote on 16 Jul 2019 22:10
[PATCH 1/3] guix: ant-build-system: Use ant-task "jar" instead of executing "jar".
(address . 36695@debbugs.gnu.org)
20190716201020.3303-1-h.goebel@crazy-compilers.com
* guix/build/ant-build-system.scm (default-build.xml): Change XML for
target "jar" to use ant-task "jar" instead of "exec".
---
guix/build/ant-build-system.scm | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

Toggle diff (20 lines)
diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm
index d79a2d55ed..a0dd6f0fb4 100644
--- a/guix/build/ant-build-system.scm
+++ b/guix/build/ant-build-system.scm
@@ -118,10 +118,9 @@
(target (@ (name "jar")
(depends "compile, manifest"))
(mkdir (@ (dir "${jar.dir}")))
- (exec (@ (executable "jar"))
- (arg (@ (line ,(string-append "-cmf ${manifest.file} "
- "${jar.dir}/" jar-name
- " -C ${classes.dir} ."))))))
+ (jar (@ (destfile ,(string-append "${jar.dir}/" jar-name))
+ (manifest "${manifest.file}")
+ (basedir "${classes.dir}"))))
(target (@ (name "install"))
(copy (@ (todir "${dist.dir}"))
--
2.21.0
H
H
Hartmut Goebel wrote on 16 Jul 2019 22:10
[PATCH 2/3] guix: ant-build-system: Put dummy project-name into default build.xml.
(address . 36695@debbugs.gnu.org)
20190716201020.3303-2-h.goebel@crazy-compilers.com
Without this, ant reported error messages like
Target "tests" does not exist in the project "null".
Simple using the jar-name is a good compromise.

* guix/build/ant-build-system.scm (default-build.xml): Add attribute
to sxml expression.
---
guix/build/ant-build-system.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (16 lines)
diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm
index a0dd6f0fb4..49549c1b4b 100644
--- a/guix/build/ant-build-system.scm
+++ b/guix/build/ant-build-system.scm
@@ -43,7 +43,8 @@
(call-with-output-file "build.xml"
(lambda (port)
(sxml->xml
- `(project (@ (basedir "."))
+ `(project (@ (basedir ".")
+ (name ,jar-name))
(property (@ (name "classes.dir")
(value "${basedir}/build/classes")))
(property (@ (name "manifest.dir")
--
2.21.0
H
H
Hartmut Goebel wrote on 16 Jul 2019 22:10
[PATCH 3/3] guix: ant-build-system: Use absolute path as base-dir.
(address . 36695@debbugs.gnu.org)
20190716201020.3303-3-h.goebel@crazy-compilers.com
This allows to chdir into some sub-project prior to building.

* guix/build/ant-build-system.scm (default-build.xml): Add parameter.
(configure): Pass current directory as base-dir to default-build.xml.
---
guix/build/ant-build-system.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (31 lines)
diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm
index 49549c1b4b..3fe7808db5 100644
--- a/guix/build/ant-build-system.scm
+++ b/guix/build/ant-build-system.scm
@@ -36,6 +36,7 @@
;; Code:
(define* (default-build.xml jar-name prefix #:optional
+ (base-dir ".")
(source-dir ".") (test-dir "./test") (main-class #f)
(test-include '("**/*Test.java"))
(test-exclude '("**/Abstract*Test.java")))
@@ -43,7 +44,7 @@
(call-with-output-file "build.xml"
(lambda (port)
(sxml->xml
- `(project (@ (basedir ".")
+ `(project (@ (basedir ,base-dir)
(name ,jar-name))
(property (@ (name "classes.dir")
(value "${basedir}/build/classes")))
@@ -162,6 +163,7 @@ to the default GNU unpack strategy."
(default-build.xml jar-name
(string-append (assoc-ref outputs "out")
"/share/java")
+ (getcwd)
source-dir test-dir main-class test-include test-exclude))
(setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
(setenv "CLASSPATH" (generate-classpath inputs))
--
2.21.0
J
J
Julien Lepiller wrote on 17 Jul 2019 10:17
01413BEF-14AB-466F-8329-D81C0BB592FA@lepiller.eu
Le 16 juillet 2019 22:10:20 GMT+02:00, Hartmut Goebel <h.goebel@crazy-compilers.com> a écrit :
Toggle quote (39 lines)
>This allows to chdir into some sub-project prior to building.
>
>* guix/build/ant-build-system.scm (default-build.xml): Add parameter.
> (configure): Pass current directory as base-dir to default-build.xml.
>---
> guix/build/ant-build-system.scm | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/guix/build/ant-build-system.scm
>b/guix/build/ant-build-system.scm
>index 49549c1b4b..3fe7808db5 100644
>--- a/guix/build/ant-build-system.scm
>+++ b/guix/build/ant-build-system.scm
>@@ -36,6 +36,7 @@
> ;; Code:
>
> (define* (default-build.xml jar-name prefix #:optional
>+ (base-dir ".")
> (source-dir ".") (test-dir "./test") (main-class #f)
> (test-include '("**/*Test.java"))
> (test-exclude '("**/Abstract*Test.java")))
>@@ -43,7 +44,7 @@
> (call-with-output-file "build.xml"
> (lambda (port)
> (sxml->xml
>- `(project (@ (basedir ".")
>+ `(project (@ (basedir ,base-dir)
> (name ,jar-name))
> (property (@ (name "classes.dir")
> (value "${basedir}/build/classes")))
>@@ -162,6 +163,7 @@ to the default GNU unpack strategy."
> (default-build.xml jar-name
> (string-append (assoc-ref outputs "out")
> "/share/java")
>+ (getcwd)
> source-dir test-dir main-class test-include test-exclude))
> (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
> (setenv "CLASSPATH" (generate-classpath inputs))

I don't understand the point of that patch. I can already add a chdir phase just after unpack to do just that. What does this patch give us?

The other two patches lgtm, but I think they need to go to staging instead of master, because they will cause a rebuild of every java package.
H
H
Hartmut Goebel wrote on 19 Jul 2019 12:43
560f89f5-c186-9a93-ac3a-b5ca92f5842e@crazy-compilers.com
Am 17.07.19 um 10:17 schrieb Julien Lepiller:
Toggle quote (2 lines)
> I don't understand the point of that patch. I can already add a chdir phase just after unpack to do just that. What does this patch give us?

This patch only ensures the build-directory is an absolute path instead
of a relative one. It does not enable to specify the build-dir as an
option to the ant-build-system. Thus it is different from using a chdir
phase.

As this patch is some years old now, I can't remember the exact case.
AFAIR the relative path did not work for some packages for some reason.

Please let me know if I should include this one, too. (No reasoning
necessary.)

(I'm just waiting for your answer to avoid rebuilding all java-packages
twice - even on staging)

--
Regards
Hartmut Goebel

| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
J
J
Julien Lepiller wrote on 19 Jul 2019 12:57
09595D0B-D7E7-44DF-855F-E2EE322B8C87@lepiller.eu
Le 19 juillet 2019 12:43:50 GMT+02:00, Hartmut Goebel <h.goebel@crazy-compilers.com> a écrit :
Toggle quote (18 lines)
>Am 17.07.19 um 10:17 schrieb Julien Lepiller:
>> I don't understand the point of that patch. I can already add a chdir
>phase just after unpack to do just that. What does this patch give us?
>
>This patch only ensures the build-directory is an absolute path instead
>of a relative one. It does not enable to specify the build-dir as an
>option to the ant-build-system. Thus it is different from using a chdir
>phase.
>
>As this patch is some years old now, I can't remember the exact case.
>AFAIR the relative path did not work for some packages for some reason.
>
>Please let me know if I should include this one, too. (No reasoning
>necessary.)
>
>(I'm just waiting for your answer to avoid rebuilding all java-packages
>twice - even on staging)

I'm fine with this patch, but I still don't see the point.
J
J
Julien Lepiller wrote on 19 Jul 2019 12:56
23ECF5DC-4E69-4F34-87EA-E7A8F5E7258E@lepiller.eu
Le 19 juillet 2019 12:43:50 GMT+02:00, Hartmut Goebel <h.goebel@crazy-compilers.com> a écrit :
Toggle quote (18 lines)
>Am 17.07.19 um 10:17 schrieb Julien Lepiller:
>> I don't understand the point of that patch. I can already add a chdir
>phase just after unpack to do just that. What does this patch give us?
>
>This patch only ensures the build-directory is an absolute path instead
>of a relative one. It does not enable to specify the build-dir as an
>option to the ant-build-system. Thus it is different from using a chdir
>phase.
>
>As this patch is some years old now, I can't remember the exact case.
>AFAIR the relative path did not work for some packages for some reason.
>
>Please let me know if I should include this one, too. (No reasoning
>necessary.)
>
>(I'm just waiting for your answer to avoid rebuilding all java-packages
>twice - even on staging)

I'm fine with this patch, but I still don't see the point.
H
H
Hartmut Goebel wrote on 19 Jul 2019 13:04
1f281be0-2ded-91f4-f12d-745680cc29d4@crazy-compilers.com
Am 19.07.19 um 12:56 schrieb Julien Lepiller:
Toggle quote (2 lines)
> I'm fine with this patch, but I still don't see the point.

So I'll leave it out - it can still be fixed if it actually occurs in a
current package.

--
Regards
Hartmut Goebel

| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
H
H
Hartmut Goebel wrote on 25 Jul 2019 10:26
Re: [PATCH 0/3] Enhancemants for the ant-build-system
(address . 36695-close@debbugs.gnu.org)
81f4e3e4-087b-4804-dcfa-0bf8460a002e@crazy-compilers.com
Pushed first two patched to staging as
cbad3570db3e692af55eac5b69cb6db062a39d77.

Last one left off.

--
Regards
Hartmut Goebel

| Hartmut Goebel | h.goebel@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |
?