all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: julien lepiller <julien@lepiller.eu>
To: 28663@debbugs.gnu.org
Subject: [bug#28663] [PATCH 01/22] guix: ant-build-system: Add main-class support.
Date: Tue, 03 Oct 2017 11:50:18 +0200	[thread overview]
Message-ID: <e59110cd3a446d31132b18736079e0ab@lepiller.eu> (raw)
In-Reply-To: <87efqk4mz0.fsf@elephly.net>

Le 2017-10-03 11:09, Ricardo Wurmus a écrit :
> julien@lepiller.eu writes:
> 
>> From: Julien Lepiller <julien@lepiller.eu>
>> 
>> * guix/build-system/ant.scm: New #:main-class argument
>> * guix/build/ant-build-system.scm: Generate a manifest file with
>> additional properties.
>> ---
> […]
>> +                 (target (@ (name "manifest"))
>> +                         (mkdir (@ (dir "${manifest.dir}")))
>> +                         (echo (@ (file "${manifest.file}")
>> +                                  (message ,(string-append
>> +                                              (if main-class
>> +                                                (string-append
>> +                                                  "Main-Class: " 
>> main-class
>> +                                                  
>> "${line.separator}")
>> +                                                "")
>> +                                              "")))))
>> +
>>                   (target (@ (name "compile"))
>>                           (mkdir (@ (dir "${classes.dir}")))
>>                           (javac (@ (includeantruntime "false")
>> @@ -97,10 +112,11 @@
>>                                                      (include (@ (name 
>> "**/*Test.java" )))))))
>> 
>>                   (target (@ (name "jar")
>> -                            (depends "compile"))
>> +                            (depends "compile, manifest"))
>>                           (mkdir (@ (dir "${jar.dir}")))
>>                           (exec (@ (executable "jar"))
>> -                               (arg (@ (line ,(string-append "-cf 
>> ${jar.dir}/" jar-name
>> +                               (arg (@ (line ,(string-append "-cmf 
>> ${manifest.file} "
>> +                                                             
>> "${jar.dir}/" jar-name
>>                                                               " -C 
>> ${classes.dir} ."))))))
> 
> This is good, thank you.  Could you please also document this in the
> manual in section “Build Systems”?

Is something like this OK? I will divide that paragraph in the two 
commits of course.

+The @code{#:main-class} parameter can be used with the minimal ant 
build
+file to specify the main class of the resulting jar.  This makes the 
jar
+file executable. The @code{#:test-include} parameter can be used to 
specify the
+list of junit tests to run. It defaults to @code{(list 
"**/*Test.java")}.
+The @code{#:test-exclude} can be used to disable some tests. It 
defaults to
+@code{(list "**/Abstract*.java")}, because abstract classes cannot be 
run as
+tests.

> 
> One question remains, though: will this affect the timestamps inside 
> the
> jar file?  If so, can we reset the timestamp to ensure reproducibility?

I think it's taken care of by the strip-jar-timestamps phase, but I will 
check.



I also have a side-question:

Some of the maven packages use three or four different generators, and 
some dependencies (such as java-eclipse-sisu-plexus) have a lot of 
runtime dependencies that are not discovered by java. The issue here is 
that including java-eclipse-sisu-plexus in the inputs field of a package 
is enough to build it, but not to run it. We could use propagated-inputs 
for that, as in the python world, but it doesn't feel right. This issue 
is also present for test dependencies where I would get a lot of runtime 
error because java cannot find a dependency of a dependency.

I see that there is a Class-Path entry that can be added to the 
MANIFEST.MF file, and that could be a way java could find the 
dependencies of a package.

The jar file is actually a zip archive. Would the grafter be able to 
graft it?

Do you know whether Class-Path is transitive?

Is there a way to programmatically filter inputs from native- and 
propagated- inputs? Or should we ask the packager to give a list of 
dependencies in a build argument, effectively duplicating some code?

I had this issue with the antlr tools too, but I found a solution: I 
added a shell wrapper that uses the correct classpath, but it only works 
because antlr is not a library.

Thank for your review and sorry for the unexpected questions.

  reply	other threads:[~2017-10-03  9:51 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-01 17:44 [bug#28663] [PATCH] New java packages Julien Lepiller
2017-10-01 17:53 ` [bug#28663] [PATCH 01/22] guix: ant-build-system: Add main-class support julien
2017-10-01 17:53   ` [bug#28663] [PATCH 02/22] guix: ant-build-system: Add #:test-include and #:test-exclude arguments julien
2017-10-03  8:31     ` Roel Janssen
2017-10-03  9:14     ` Ricardo Wurmus
2017-10-01 17:53   ` [bug#28663] [PATCH 03/22] gnu: Add java-microemulator julien
2017-10-03  7:54     ` Roel Janssen
2017-10-03  8:27       ` julien lepiller
2017-10-01 17:53   ` [bug#28663] [PATCH 04/22] gnu: Add java-datanucleus-javax-persistence julien
2017-10-01 17:53   ` [bug#28663] [PATCH 05/22] gnu: Add java-osgi-cmpn julien
2017-10-01 17:53   ` [bug#28663] [PATCH 06/22] gnu: Add java-osgi-service-component-annotations julien
2017-10-01 17:53   ` [bug#28663] [PATCH 07/22] gnu: Add java-osgi-dto julien
2017-10-01 17:53   ` [bug#28663] [PATCH 08/22] gnu: Add java-osgi-resource julien
2017-10-01 17:53   ` [bug#28663] [PATCH 09/22] gnu: Add java-osgi-namespace-contract julien
2017-10-01 17:53   ` [bug#28663] [PATCH 10/22] gnu: Add java-osgi-namespace-extender julien
2017-10-01 17:53   ` [bug#28663] [PATCH 11/22] gnu: Add java-osgi-namespace-service julien
2017-10-01 17:53   ` [bug#28663] [PATCH 12/22] gnu: Add java-osgi-util-function julien
2017-10-01 17:53   ` [bug#28663] [PATCH 13/22] gnu: Add java-osgi-util-promise julien
2017-10-01 17:53   ` [bug#28663] [PATCH 14/22] gnu: Add java-osgi-service-metatype-annotations julien
2017-10-01 17:53   ` [bug#28663] [PATCH 15/22] gnu: Add java-osgi-service-repository julien
2017-10-01 17:53   ` [bug#28663] [PATCH 16/22] gnu: Add java-osgi-framework julien
2017-10-01 17:53   ` [bug#28663] [PATCH 17/22] gnu: Add java-osgi-service-log julien
2017-10-01 17:53   ` [bug#28663] [PATCH 18/22] gnu: Add java-osgi-service-jdbc julien
2017-10-03  7:52     ` julien lepiller
2017-10-01 17:53   ` [bug#28663] [PATCH 19/22] gnu: Add java-osgi-service-resolver julien
2017-10-01 17:53   ` [bug#28663] [PATCH 20/22] gnu: Add java-osgi-util-tracker julien
2017-10-01 17:53   ` [bug#28663] [PATCH 21/22] gnu: Add java-osgi-service-cm julien
2017-10-01 17:53   ` [bug#28663] [PATCH 22/22] gnu: Add java-osgi-service-packageadmin julien
2017-10-03  7:44   ` [bug#28663] [PATCH 01/22] guix: ant-build-system: Add main-class support Roel Janssen
2017-10-03  9:09   ` Ricardo Wurmus
2017-10-03  9:50     ` julien lepiller [this message]
2017-10-03  8:38 ` [bug#28663] [PATCH] New java packages Roel Janssen
2017-10-03 19:48   ` bug#28663: " Julien Lepiller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e59110cd3a446d31132b18736079e0ab@lepiller.eu \
    --to=julien@lepiller.eu \
    --cc=28663@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.