You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Giovanni Mesturini <jo...@yahoo.it> on 2006/02/02 16:12:47 UTC

Merge manifest files

Hi all,

I'm going to set up a temporary-maven-compilant
project, taking source code from many different src
dirs into one. I can't find the way to merge up all
manifest files from many projects into a single one.

Any suggestion?

I've also considered the possibility to use a
(unknown) task to merge up simple plain text files,
appending contents from one to the other. In this
case, will a manifest work without optimization? (with
two class-path property then).

Thank you very much,
sorry for my bad english
Jo


	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it

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


Re: Merge manifest files

Posted by Giovanni Mesturini <jo...@yahoo.it>.
Thank you very much Conor. We just have passed over
the problem making Maven to build up the manifest
following instructions defined in POMs. So we
completely ignore old manifest files from single
projects in order to follow artifact dependencies
defined in POMs.

Thank you once again
Jo



--- Conor MacNeill <co...@apache.org> ha scritto: 

> Giovanni,
> 
> > 
> > Just tried, but it doesn't work completely. The
> > resulting manifest is compilant but some
> dependencies
> > in class-path are missing.
> > 
> 
> It should work. The process Stefan outlines
> ultimately uses the merge()
> method you identified below, so if you were to use
> that directly you
> would expect similar results, I think. It may be
> worth digging into
> exactly how the class-path entries are being merged.
> 
> > 
> > 
> > Thanks. The last question: I saw on
> >
>
http://www.dpml.net/api/ant/1.6.4/org/apache/tools/ant/taskdefs/Manifest.html
> > that the Ant class Manifest has a merge method
> that
> > should be perfect for my problem (starting with an
> > empty manifest and sequentially merge the others).
> But
> > this class seems not to be exposed in XML Ant's
> tasks.
> > Where can I find a tutorial on how to create new
> XML
> > tasks exposing existing Ant classes?
> > 
> 
> You can look at two things. One is the code for the
> manifest task
> itself, ManifestTask which uses the Manifest class
> to do most of its work.
> 
> For general info on Ant task writing, please refer
> to the links here:
> 
> http://ant.apache.org/manual/developlist.html
> 
> and particularly
> 
>
http://ant.apache.org/manual/develop.html#writingowntask
> 
> Cheers
> Conor
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it

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


Re: Merge manifest files

Posted by Conor MacNeill <co...@apache.org>.
Giovanni,

> 
> Just tried, but it doesn't work completely. The
> resulting manifest is compilant but some dependencies
> in class-path are missing.
> 

It should work. The process Stefan outlines ultimately uses the merge()
method you identified below, so if you were to use that directly you
would expect similar results, I think. It may be worth digging into
exactly how the class-path entries are being merged.

> 
> 
> Thanks. The last question: I saw on
> http://www.dpml.net/api/ant/1.6.4/org/apache/tools/ant/taskdefs/Manifest.html
> that the Ant class Manifest has a merge method that
> should be perfect for my problem (starting with an
> empty manifest and sequentially merge the others). But
> this class seems not to be exposed in XML Ant's tasks.
> Where can I find a tutorial on how to create new XML
> tasks exposing existing Ant classes?
> 

You can look at two things. One is the code for the manifest task
itself, ManifestTask which uses the Manifest class to do most of its work.

For general info on Ant task writing, please refer to the links here:

http://ant.apache.org/manual/developlist.html

and particularly

http://ant.apache.org/manual/develop.html#writingowntask

Cheers
Conor



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


Re: Merge manifest files

Posted by Giovanni Mesturini <jo...@yahoo.it>.
--- Stefan Bodewig <bo...@apache.org> ha scritto: 

> On Thu, 2 Feb 2006, Giovanni Mesturini
> <jo...@yahoo.it> wrote:
> 
> > I'm going to set up a temporary-maven-compilant
> > project, taking source code from many different
> src
> > dirs into one. I can't find the way to merge up
> all
> > manifest files from many projects into a single
> one.
> 
> There is no built-in one.
> 
> What probably would work is to create jar files for
> each of your
> manifests (putting the manifests in as
> META-INF/MANIFEST.MF) and then
> merge those jars with <jar> and <zipgroupfileset>
> setting the
> filesetmanifest attribute to "merge".  This final
> jar would then
> contain a merged manifest that you could extract
> with <unjar>.
> 

Just tried, but it doesn't work completely. The
resulting manifest is compilant but some dependencies
in class-path are missing.

> > I've also considered the possibility to use a
> > (unknown) task to merge up simple plain text
> files,
> 
> <concat>
> 

I think this will be the final solution...

> > appending contents from one to the other. In this
> > case, will a manifest work without optimization?
> (with
> > two class-path property then).
> 
> No, it will not be a valid Manifest anymore.
> 

Thanks. The last question: I saw on
http://www.dpml.net/api/ant/1.6.4/org/apache/tools/ant/taskdefs/Manifest.html
that the Ant class Manifest has a merge method that
should be perfect for my problem (starting with an
empty manifest and sequentially merge the others). But
this class seems not to be exposed in XML Ant's tasks.
Where can I find a tutorial on how to create new XML
tasks exposing existing Ant classes?

Thank you once again
Jo


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



	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it

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


Re: Merge manifest files

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 2 Feb 2006, Giovanni Mesturini <jo...@yahoo.it> wrote:

> I'm going to set up a temporary-maven-compilant
> project, taking source code from many different src
> dirs into one. I can't find the way to merge up all
> manifest files from many projects into a single one.

There is no built-in one.

What probably would work is to create jar files for each of your
manifests (putting the manifests in as META-INF/MANIFEST.MF) and then
merge those jars with <jar> and <zipgroupfileset> setting the
filesetmanifest attribute to "merge".  This final jar would then
contain a merged manifest that you could extract with <unjar>.

> I've also considered the possibility to use a
> (unknown) task to merge up simple plain text files,

<concat>

> appending contents from one to the other. In this
> case, will a manifest work without optimization? (with
> two class-path property then).

No, it will not be a valid Manifest anymore.

Stefan

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