unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#36695] [PATCH 0/3] Enhancemante for the ant-build-system
@ 2019-07-16 20:08 Hartmut Goebel
  2019-07-16 20:10 ` [bug#36695] [PATCH 1/3] guix: ant-build-system: Use ant-task "jar" instead of executing "jar" Hartmut Goebel
       [not found] ` <handler.36695.B.156330772723013.ack@debbugs.gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Hartmut Goebel @ 2019-07-16 20:08 UTC (permalink / raw)
  To: 36695

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#36695] [PATCH 1/3] guix: ant-build-system: Use ant-task "jar" instead of executing "jar".
  2019-07-16 20:08 [bug#36695] [PATCH 0/3] Enhancemante for the ant-build-system Hartmut Goebel
@ 2019-07-16 20:10 ` Hartmut Goebel
  2019-07-16 20:10   ` [bug#36695] [PATCH 2/3] guix: ant-build-system: Put dummy project-name into default build.xml Hartmut Goebel
  2019-07-16 20:10   ` [bug#36695] [PATCH 3/3] guix: ant-build-system: Use absolute path as base-dir Hartmut Goebel
       [not found] ` <handler.36695.B.156330772723013.ack@debbugs.gnu.org>
  1 sibling, 2 replies; 10+ messages in thread
From: Hartmut Goebel @ 2019-07-16 20:10 UTC (permalink / raw)
  To: 36695

* 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(-)

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#36695] [PATCH 2/3] guix: ant-build-system: Put dummy project-name into default build.xml.
  2019-07-16 20:10 ` [bug#36695] [PATCH 1/3] guix: ant-build-system: Use ant-task "jar" instead of executing "jar" Hartmut Goebel
@ 2019-07-16 20:10   ` Hartmut Goebel
  2019-07-16 20:10   ` [bug#36695] [PATCH 3/3] guix: ant-build-system: Use absolute path as base-dir Hartmut Goebel
  1 sibling, 0 replies; 10+ messages in thread
From: Hartmut Goebel @ 2019-07-16 20:10 UTC (permalink / raw)
  To: 36695

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(-)

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#36695] [PATCH 3/3] guix: ant-build-system: Use absolute path as base-dir.
  2019-07-16 20:10 ` [bug#36695] [PATCH 1/3] guix: ant-build-system: Use ant-task "jar" instead of executing "jar" Hartmut Goebel
  2019-07-16 20:10   ` [bug#36695] [PATCH 2/3] guix: ant-build-system: Put dummy project-name into default build.xml Hartmut Goebel
@ 2019-07-16 20:10   ` Hartmut Goebel
  2019-07-17  8:17     ` Julien Lepiller
  1 sibling, 1 reply; 10+ messages in thread
From: Hartmut Goebel @ 2019-07-16 20:10 UTC (permalink / raw)
  To: 36695

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))
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#36695] [PATCH 3/3] guix: ant-build-system: Use absolute path as base-dir.
  2019-07-16 20:10   ` [bug#36695] [PATCH 3/3] guix: ant-build-system: Use absolute path as base-dir Hartmut Goebel
@ 2019-07-17  8:17     ` Julien Lepiller
  2019-07-19 10:43       ` Hartmut Goebel
  0 siblings, 1 reply; 10+ messages in thread
From: Julien Lepiller @ 2019-07-17  8:17 UTC (permalink / raw)
  To: Hartmut Goebel, 36695

Le 16 juillet 2019 22:10:20 GMT+02:00, Hartmut Goebel <h.goebel@crazy-compilers.com> a écrit :
>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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#36695] [PATCH 3/3] guix: ant-build-system: Use absolute path as base-dir.
  2019-07-17  8:17     ` Julien Lepiller
@ 2019-07-19 10:43       ` Hartmut Goebel
  2019-07-19 10:56         ` Julien Lepiller
  2019-07-19 10:57         ` Julien Lepiller
  0 siblings, 2 replies; 10+ messages in thread
From: Hartmut Goebel @ 2019-07-19 10:43 UTC (permalink / raw)
  To: Julien Lepiller, 36695

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)

-- 
Regards
Hartmut Goebel

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#36695] [PATCH 3/3] guix: ant-build-system: Use absolute path as base-dir.
  2019-07-19 10:43       ` Hartmut Goebel
@ 2019-07-19 10:56         ` Julien Lepiller
  2019-07-19 11:04           ` Hartmut Goebel
  2019-07-19 10:57         ` Julien Lepiller
  1 sibling, 1 reply; 10+ messages in thread
From: Julien Lepiller @ 2019-07-19 10:56 UTC (permalink / raw)
  To: Hartmut Goebel, 36695

Le 19 juillet 2019 12:43:50 GMT+02:00, Hartmut Goebel <h.goebel@crazy-compilers.com> a écrit :
>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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#36695] [PATCH 3/3] guix: ant-build-system: Use absolute path as base-dir.
  2019-07-19 10:43       ` Hartmut Goebel
  2019-07-19 10:56         ` Julien Lepiller
@ 2019-07-19 10:57         ` Julien Lepiller
  1 sibling, 0 replies; 10+ messages in thread
From: Julien Lepiller @ 2019-07-19 10:57 UTC (permalink / raw)
  To: Hartmut Goebel, 36695

Le 19 juillet 2019 12:43:50 GMT+02:00, Hartmut Goebel <h.goebel@crazy-compilers.com> a écrit :
>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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#36695] [PATCH 3/3] guix: ant-build-system: Use absolute path as base-dir.
  2019-07-19 10:56         ` Julien Lepiller
@ 2019-07-19 11:04           ` Hartmut Goebel
  0 siblings, 0 replies; 10+ messages in thread
From: Hartmut Goebel @ 2019-07-19 11:04 UTC (permalink / raw)
  To: Julien Lepiller, 36695

Am 19.07.19 um 12:56 schrieb Julien Lepiller:
> 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 |

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#36695: [PATCH 0/3] Enhancemants for the ant-build-system
       [not found] ` <handler.36695.B.156330772723013.ack@debbugs.gnu.org>
@ 2019-07-25  8:26   ` Hartmut Goebel
  0 siblings, 0 replies; 10+ messages in thread
From: Hartmut Goebel @ 2019-07-25  8:26 UTC (permalink / raw)
  To: 36695-close

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 |

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-07-25  8:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-16 20:08 [bug#36695] [PATCH 0/3] Enhancemante for the ant-build-system Hartmut Goebel
2019-07-16 20:10 ` [bug#36695] [PATCH 1/3] guix: ant-build-system: Use ant-task "jar" instead of executing "jar" Hartmut Goebel
2019-07-16 20:10   ` [bug#36695] [PATCH 2/3] guix: ant-build-system: Put dummy project-name into default build.xml Hartmut Goebel
2019-07-16 20:10   ` [bug#36695] [PATCH 3/3] guix: ant-build-system: Use absolute path as base-dir Hartmut Goebel
2019-07-17  8:17     ` Julien Lepiller
2019-07-19 10:43       ` Hartmut Goebel
2019-07-19 10:56         ` Julien Lepiller
2019-07-19 11:04           ` Hartmut Goebel
2019-07-19 10:57         ` Julien Lepiller
     [not found] ` <handler.36695.B.156330772723013.ack@debbugs.gnu.org>
2019-07-25  8:26   ` bug#36695: [PATCH 0/3] Enhancemants for the ant-build-system Hartmut Goebel

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).