[Scons-users] Deal with package-info.class empty file

Pierre-Luc Boily pierreluc.boily at gmail.com
Sun Dec 1 09:47:50 EST 2019


Finally, it is quite easy, javac compiler has an argument to force
package-info.class generation.

Just need to pass -Xpkginfo:always to scons JAVACFLAGS. Unfortunately, my
version of javac (1.7.0_25) is crashing when I am passing this argument.
javac 1.8 is working fine with this arguments.

Le jeu. 28 nov. 2019, à 23 h 19, Pierre-Luc Boily <pierreluc.boily at gmail.com>
a écrit :

> Hello!
>
> I have a problem where my java build is nover up to date, because within
> scons java builder, package-info.class is not generated.
>
> This question has already been asked there :
> http://scons.1086193.n5.nabble.com/java-empty-files-td28544.html
>
> Its been almost 10 years ago and I am wondering if someone found something
> better?
>
> And it looks like the solution actually doesn't work anymore.  The
> following
> code :
>
> tgts = env.Java(target = 'classes', source = 'src')
> for f in tgts:
>   if f.path.endswith('package-info.class'):
>     tgts.remove(f)
>
> jar = env.Jar(target = 'dds-interface.jar', source = tgts)
> Default(jar)
>
> returns error :
> AttributeError: <class 'SCons.Node.FS.File'> object has no attribute
> 'upper':
>
> From what I read into the doc, Jar only accept java file or 'classes' as
> source.
>
> I could simply remove package-info.java file, I think they are not useful
> in
> our case, we do not have documentation.  But just in case, would be great
> if
> I can keep it.
>
>
>
> --
> 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/20191201/f1c45344/attachment.html>


More information about the Scons-users mailing list