[Scons-users] Jar builds fail with SConscript variant directory
William Roberts
bill.c.roberts at gmail.com
Sat May 3 17:50:18 EDT 2014
Thanks dirk. I will do that then.
On May 3, 2014 2:39 PM, "Dirk Bächle" <tshortik at gmx.de> wrote:
> Hi Bill,
>
> On 01.05.2014 17:52, William Roberts wrote:
>
>> Ok trying again on the right list with the attachment...
>>
>> I typically set up my builds with a hierachical layout and a variant
>> directory and do some other things to make it all work together.
>> Normally I program in C, and this all works.
>>
>> Recently, I tried using java and broke. I have a very simple example
>> that doesnt work. If I change the SConscript calls to use a variant
>> dir, its broken, if I dont it works...
>>
>> Sconstruct:
>>
>> <snip>
>> SConscript(script)
>> #SConscript(script, variant_dir=outdir, duplicate=1)
>> <snip>
>>
>> to
>> <snip>
>> #SConscript(script)
>> SConscript(script, variant_dir=outdir, duplicate=1)
>> <snip>
>>
>> it breaks...
>>
>> Can someone explain what's going on here? Thanks.
>>
>
> I also tried my luck and had a short look at your build setup. In your
> SConscript you have:
>
> Java("classes", ".")
> Jar("myjar.jar", "classes")
>
> which works fine as long as you don't use variant dirs. The problem is the
> first line, which creates a dependency between "classes" and ".". These are
> both Dir nodes, so when the VariantDir stuff jumps in and starts to copy
> things, it won't pick up the "*.java" source files living *under* the "."
> directory. You can check this with calling "scons --tree=derived", which
> won't show any "*.java" files as leaves in the dependency tree, as one
> might expect.
>
> A possible way out is to compile the Java files one at a time. This
> requires to additionally set the "-classpath" option, and a proper
> SConscript for your situation would be:
>
> Java("classes", Glob("*.java"), JAVACLASSPATH=Dir("classes"))
> Jar("myjar.jar", "classes")
>
> This works for duplicate=1, as well as duplicate=0.
>
> Best regards,
>
> Dirk
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> http://four.pairlist.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140503/644e4fe8/attachment.htm
More information about the Scons-users
mailing list