[Scons-users] Trouble with clean and java target location

William Blevins wblevins001 at gmail.com
Wed Feb 22 11:20:47 EST 2017


More likely due to SCons targets changing after initial build. Since java
source:target ratio is 1:N, if you have generated Java files, SCons cannot
scan them for implicit dependencies until after they have already been
built.

This can cause your dependency tree to differ when repo is clean vs after
repo is built. SCons also misses output class targets for anonymous classes
that are never assigned to an instance variable.

V/R,
William

On Feb 22, 2017 10:15 AM, "Dan McNaul" <danmcnaul at gmail.com> wrote:

Hi,   (I’m running scons v2.3.0)

I have this problem with the clean (-c) function.

I have these 2 java source files in different packages.  The source files
are generated by a scons Command() to ant.  Ant is using ‘wsdl2java’ to
generate them, if that is pertinent

niswsbasic8crti/src/com/att/its/nisweb/att/nis/basic8/
webservices/ObjectFactory.java

niswsbasic8crti/src/com/att/cio/commonheader/v3/ObjectFactory.java


My scons builder line says:

java_wsdl_its = envJAVA.Java(‘./niswsbasic8crti/stage/WEB-INF/classes’,
‘./niswsbasic8crti/src/com/att/its/nisweb/att/nis/basic8/
webservices/ObjectFactory.java’)

java_wsdl_cio = envJAVA.Java(‘./niswsbasic8crti/stage/WEB-INF/classes’,
‘./niswsbasic8crti/src/com/att/cio/commonheader/v3/ObjectFactory.java)


When I run the build, it works as expected.  The java source is compiled
and the java class is placed in the target at the proper package position.

meaning –>  ./niswsbasic8crti/stage/WEB-INF/classes/
                   com/att/its/........
and              com/at/cio/.......
Side Note –>  The Scons Java() call is critical to my needs here, because
Scons searches my “Repository()” for the correct versions of things.

==========================

But when I run the build with “-c” (clean), I get this error during the
“scons: Reading SConscript files ...”

scons: *** Multiple ways to build the same target were specified for:
niswsbasic8crti/stage/WEB-INF/classes/ObjectFactory.class
(from [‘niswsbasic8crti/src/com/att/cio/commonheader/v3/ObjectFactory.java’]

and from [‘niswsbasic8crti/src/com/att/its/nisweb/att/nis/basic8/
webservices/ObjectFactory.java’])


It appears that the “clean” function doesn’t calculate the correct ‘target’
by taking into consideration the “package” location.  It is dumping
everything in the “root” of the target.   Is there a work around?

Thanks

Dan

_______________________________________________
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/20170222/a83e841f/attachment-0001.html>


More information about the Scons-users mailing list