[Scons-users] Java builder is rebuilds when not needed
Pierre-Luc Boily
pierreluc.boily at gmail.com
Wed Jan 29 13:17:01 EST 2020
I think I know what the problem is. At the first scons pass, java files
that are generated from idl into the variant dir don't exist yet. So,
scons can`t scan the java file for "package" statement. That is why the
target is
classes/fileName.class
instead of
classes/adacel/speech/fileName.class
For this understandable reason, I don't have the choice to create my own
builder around the Java builder. This builder will take care of creating
java from idl and create the correct targets in the emitter.
Le mer. 29 janv. 2020, à 11 h 32, Pierre-Luc Boily <
pierreluc.boily at gmail.com> a écrit :
> Hello,
>
> I have a case where
> 1- I am creating java files from idl then
> 2- Compile those java files
>
> All my java files starts with "package adacel.speech;"
>
> --------------------------------
> generated_java_target += env.Command(
> target='ActivateGrammar.java',
>
> source='#sr/speech/common_dds/ActivateGrammar.idl',
> action=[idl_command])
>
> classes_tgt = env.Java(target='classes',
> source=generated_java_target)
> ---------------------------------
>
> The code above generates all my class files under "classes/adacel/speech",
> which is correct.
>
> But when I start another build with following code :
> for i in classes_tgt:
> print(str(i))
>
> I can see that all my class targets looks like this :
> classes\ActivateGrammar.class
>
> Which is incorrect. scons tell me :
> scons: building
>
> `build\sr\speech\ContextualPostProcessor\RulesEngine\DroolsGenericModel\classes\TimeValueHolder.class'
> because it doesn't exist
>
> Scons should look under classes\adacel\speech
>
> Am I doing something incorrect? Is this a bug in Java builder? As a
> workaround, I though doing my own builder that takes idl that generates
> java
> file and build it. And within the emitter, generate all class targets that
> points to correct path. It could be faster, because in that case, I could
> generate all java files and compile them at once.
>
>
>
> --
> Sent from: http://scons.1086193.n5.nabble.com/Users-f16930.html
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20200129/f713625a/attachment.html>
More information about the Scons-users
mailing list