|
Boost-Build : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-05-18 02:33:39
On Thursday 18 May 2006 01:05, Klaus Nowikow wrote:
> I am trying to create a generator for creating jar files.
> It should be used like this:
>
> <code>
> jar tgt : a.foo sub1/b.bar sub2/c.baz ;
> </code>
>
> This should create the file tgt.jar
>
> I tried several things, but the most promising way (for me)
> was this:
>
> <code>
> actions jar
> {
> 7z a -y -tzip $(>) $(<)
> }
> </code>
This is not quite right way, because if you call this rule you'll only specify
updating action for your target, but it won't set up right dependencies,
right target paths, and so on.
> But this does not do anything.
>
> [7z is just the program I currently use for creating zip/jar files
> from the command line on Windows; in the long run one should create
> toolsets to be able to use different programs there]
>
> I also tried something like this:
>
> <code>
> import type ;
> type.register JAR : jar ;
>
> import generators ;
> generators.register-composing jar.jar : ??? : JAR ;
> actions jar
> {
> 7z a -y -tzip $(>) $(<)
> }
> </code>
>
> but then I did not know what to give as the source type where
> I put the '???', because the jar archive could contain any file type.
I should put nothing instead of ???, that is:
generators.register-composing jar.jar : : JAR ;
For this to work, you'd need to apply the attached patch, which I've also
comitted to CVS right now. Please also check the attached project that I've
used for testing. It seem to produces the command line you want.
- Volodya
-- Vladimir Prus http://vladimir_prus.blogspot.com Boost.Build V2: http://boost.org/boost-build2
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk