You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by RAPPAZ Francois <fr...@unifr.ch> on 2017/11/16 07:05:02 UTC

GenJar

Someone on this list pointed me to the BCEL parser, and I have corrected the bug in GenJar which now use that parser to get the classes a class file depends on.

My GenJar is working again in Ant.

I tried to communicate with the person who was managing the GenJar project on Sourceforge, and I suppose including this correction to make version 1.0.3 (1.0.2 exists since 2003). But if I can't communicate with him, can someone suggest me a way to distribute this corrected version ?

One more thing: I could make myself a sourceforge project with this, but I'm an old guy, and will be retired in a few years, so the question will surface again...

Thanks

François

Re: GenJar

Posted by Martin Gainty <mg...@hotmail.com>.
MG2>below

________________________________
From: RAPPAZ Francois <fr...@unifr.ch>
Sent: Thursday, November 23, 2017 2:00 AM
To: Ant Users List
Subject: RE: GenJar


MG>which specific task do you want ant to implement?

Make a jar using the regular ant jar task:
With using a file selector that
- start with the class file having the main function called to start the application
- takes all the class it depends on, extract the corresponding class file from the jar archive (using the path to find the archive), add this extracted class file in the jar under construction
- repeat this for the class that has been extracted

This is what genjar is doing (or PAR::Packer in perl) but it's a task in himself not a selector in the regular jar task, and it's very convenient to have these  autonomous archive when you want to distribute an application.

François

MG2>so you want a utility which will package your 'main' class plus all dependencies
MG2>easily accomplished with maven bundle-plugin provided <configuration> contains:
MG2><createDependencyReducedPom>false</createDependencyReducedPom> (to include dependencies)
MG2><createDependencyReducedPom>true</createDependencyReducedPom> (to exclude dependencies)

http://felix.apache.org/components/bundle-plugin/manifest-mojo.html
Maven Bundle Plugin – bundle:manifest - Apache Felix<http://felix.apache.org/components/bundle-plugin/manifest-mojo.html>
felix.apache.org
Name Type Since Description; archive: MavenArchiveConfiguration-The archive configuration to use. buildDirectory: String-The directory for the generated JAR.



MG2>does this help?

RE: GenJar

Posted by RAPPAZ Francois <fr...@unifr.ch>.
MG>which specific task do you want ant to implement?

Make a jar using the regular ant jar task:
With using a file selector that 
- start with the class file having the main function called to start the application
- takes all the class it depends on, extract the corresponding class file from the jar archive (using the path to find the archive), add this extracted class file in the jar under construction
- repeat this for the class that has been extracted

This is what genjar is doing (or PAR::Packer in perl) but it's a task in himself not a selector in the regular jar task, and it's very convenient to have these  autonomous archive when you want to distribute an application.

François

MG>implement bcel regular expression code patterns?
MG>using Repository to lookup a clazz?
MG>using ClassGen to create files?
MG>something else?
https://commons.apache.org/proper/commons-bcel/manual/bcel-api.html
Apache Commons BCELT - The BCEL API<https://commons.apache.org/proper/commons-bcel/manual/bcel-api.html>
commons.apache.org
The BCEL API. The BCEL API abstracts from the concrete circumstances of the Java Virtual Machine and how to read and write binary Java class files.




Is there examples of codes of these custom selectors ?

Correcting the original genjar code proved to be < 50 lines changes Writing this selector from scratch is quiet harder for me

François

-----Original Message-----
From: Dominique Devienne [mailto:ddevienne@gmail.com]
Sent: 21 November 2017 15:18
To: Ant Users List <us...@ant.apache.org>
Subject: Re: GenJar

On Tue, Nov 21, 2017 at 11:19 AM, RAPPAZ Francois <fr...@unifr.ch>
wrote:

> Things turned out well at the end...
>
> since I could contact the original maintainer of genjar on sourceforge 
> and I was able to update my changes there.
>
> Note that this tool had some descendants. I have found on github:
> mx:genjar, genjar2.
>

All these IMHO are misguided in that they replace <jar> instead of just providing a smarter BCEL-powered (or other) selector within <jar>.
Maybe I underestimate how easy that is perhaps though... --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: GenJar

Posted by Martin Gainty <mg...@hotmail.com>.



________________________________
From: RAPPAZ Francois <fr...@unifr.ch>
Sent: Wednesday, November 22, 2017 10:14 AM
To: Ant Users List
Cc: ddevienne@gmail.com
Subject: RE: GenJar

What really surprised me is that such a bcel selector has not already been written.

MG>which specific task do you want ant to implement?
MG>implement bcel regular expression code patterns?
MG>using Repository to lookup a clazz?
MG>using ClassGen to create files?
MG>something else?
https://commons.apache.org/proper/commons-bcel/manual/bcel-api.html
Apache Commons BCEL™ – The BCEL API<https://commons.apache.org/proper/commons-bcel/manual/bcel-api.html>
commons.apache.org
The BCEL API. The BCEL API abstracts from the concrete circumstances of the Java Virtual Machine and how to read and write binary Java class files.




Is there examples of codes of these custom selectors ?

Correcting the original genjar code proved to be < 50 lines changes
Writing this selector from scratch is quiet harder for me

François

-----Original Message-----
From: Dominique Devienne [mailto:ddevienne@gmail.com]
Sent: 21 November 2017 15:18
To: Ant Users List <us...@ant.apache.org>
Subject: Re: GenJar

On Tue, Nov 21, 2017 at 11:19 AM, RAPPAZ Francois <fr...@unifr.ch>
wrote:

> Things turned out well at the end...
>
> since I could contact the original maintainer of genjar on sourceforge
> and I was able to update my changes there.
>
> Note that this tool had some descendants. I have found on github:
> mx:genjar, genjar2.
>

All these IMHO are misguided in that they replace <jar> instead of just providing a smarter BCEL-powered (or other) selector within <jar>.
Maybe I underestimate how easy that is perhaps though... --DD

RE: GenJar

Posted by RAPPAZ Francois <fr...@unifr.ch>.
What really surprised me is that such a bcel selector has not already been written.

Is there examples of codes of these custom selectors ? 

Correcting the original genjar codes proved to be < 50 lines changes
Writing this selector from scratch is quiet harder for me

François

-----Original Message-----
From: Dominique Devienne [mailto:ddevienne@gmail.com] 
Sent: 21 November 2017 15:18
To: Ant Users List <us...@ant.apache.org>
Subject: Re: GenJar

On Tue, Nov 21, 2017 at 11:19 AM, RAPPAZ Francois <fr...@unifr.ch>
wrote:

> Things turned out well at the end...
>
> since I could contact the original maintainer of genjar on sourceforge 
> and I was able to update my changes there.
>
> Note that this tool had some descendants. I have found on github:
> mx:genjar, genjar2.
>

All these IMHO are misguided in that they replace <jar> instead of just providing a smarter BCEL-powered (or other) selector within <jar>.
Maybe I underestimate how easy that is perhaps though... --DD

Re: GenJar

Posted by Dominique Devienne <dd...@gmail.com>.
On Tue, Nov 21, 2017 at 11:19 AM, RAPPAZ Francois <fr...@unifr.ch>
wrote:

> Things turned out well at the end...
>
> since I could contact the original maintainer of genjar on sourceforge and
> I was able to update my changes there.
>
> Note that this tool had some descendants. I have found on github:
> mx:genjar, genjar2.
>

All these IMHO are misguided in that they replace <jar> instead of
just providing a smarter BCEL-powered (or other) selector within <jar>.
Maybe I underestimate how easy that is perhaps though... --DD

RE: GenJar

Posted by RAPPAZ Francois <fr...@unifr.ch>.
Things turned out well at the end...

since I could contact the original maintainer of genjar on sourceforge and I was able to update my changes there.

Note that this tool had some descendants. I have found on github: mx:genjar, genjar2.

François

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org] 
Sent: 16 November 2017 08:54
To: user@ant.apache.org
Subject: Re: GenJar

On 2017-11-16, RAPPAZ Francois wrote:

> Someone on this list pointed me to the BCEL parser, and I have 
> corrected the bug in GenJar which now use that parser to get the 
> classes a class file depends on.

> My GenJar is working again in Ant.

great.

> I tried to communicate with the person who was managing the GenJar 
> project on Sourceforge, and I suppose including this correction to 
> make version 1.0.3 (1.0.2 exists since 2003). But if I can't 
> communicate with him, can someone suggest me a way to distribute this 
> corrected version ?

> One more thing: I could make myself a sourceforge project with this, 
> but I'm an old guy, and will be retired in a few years, so the 
> question will surface again...

If you cannot make the original maintainer create a new release then this likely is the best way going forward. Where Sourceforge is only one option and there would be alternative hosting sites for open source projects. It takes people of a certain age to know how to deal with Sourceforge (I am old enough ;-).

Fortunately starting an open source project doesn't force you to support it for the rest of your life. Just like the original author may say "I haven't touched the code in more than ten years" so can you do. If in a few years somebody feels like using your version and neeeding a fix they'll be able to fork your version and create an adapted one if you are no longer able or willing to do it yourself.

That's all my personal opinion, of course, so take it with a grain of salt.

If the only alternatives are

* you keep the improvement for yourself and nobody else benefits from it

* you fork the project and published the improved version at the risk of
  having somebody else do the same to your project again in a few years

I'd prefer the second one.

Hope this helps in any way

     Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: GenJar

Posted by Stefan Bodewig <bo...@apache.org>.
On 2017-11-16, RAPPAZ Francois wrote:

> Someone on this list pointed me to the BCEL parser, and I have
> corrected the bug in GenJar which now use that parser to get the
> classes a class file depends on.

> My GenJar is working again in Ant.

great.

> I tried to communicate with the person who was managing the GenJar
> project on Sourceforge, and I suppose including this correction to
> make version 1.0.3 (1.0.2 exists since 2003). But if I can't
> communicate with him, can someone suggest me a way to distribute this
> corrected version ?

> One more thing: I could make myself a sourceforge project with this,
> but I'm an old guy, and will be retired in a few years, so the
> question will surface again...

If you cannot make the original maintainer create a new release then
this likely is the best way going forward. Where Sourceforge is only one
option and there would be alternative hosting sites for open source
projects. It takes people of a certain age to know how to deal with
Sourceforge (I am old enough ;-).

Fortunately starting an open source project doesn't force you to support
it for the rest of your life. Just like the original author may say "I
haven't touched the code in more than ten years" so can you do. If in a
few years somebody feels like using your version and neeeding a fix
they'll be able to fork your version and create an adapted one if you
are no longer able or willing to do it yourself.

That's all my personal opinion, of course, so take it with a grain of
salt.

If the only alternatives are

* you keep the improvement for yourself and nobody else benefits from it

* you fork the project and published the improved version at the risk of
  having somebody else do the same to your project again in a few years

I'd prefer the second one.

Hope this helps in any way

     Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org