I have a piece of source code in our build that is generated by running a java class.
I can’t for the life of me work out how to instruct scons on the dependency, and it keeps trying to build the source code before it builds the .class file.
When I do o = env.Java(target = ‘target_dir’, source = Dir(‘source_dir’)), o is set to an empty list.
You can use the Depends() function for that, something like this:
Here is a better option (since you dont have to worry about the gen’d file path when calling Depends()), assuming you are executing said java class with the SCons Command() function:
Regarding
obeing an empty list, is it always an empty list? If so, be careful how you specify the source, it should be the root of the package dir structure. For example, if your dir tree is something like this:You should specify the source dir as follows:
'#/src/com'