[Scons-users] SCons builder to call scripts with other files as arguments
Bill Deegan
bill at baddogconsulting.com
Sun Jan 24 16:24:37 EST 2016
Add a builder for mk_foo.py, in the emitter add the dependency on the
script.
(see: https://bitbucket.org/scons/scons/wiki/ToolsForFools)
and/or add a psuedo builder.
(see: http://scons.org/doc/production/HTML/scons-user/ch20.html)
On Sun, Jan 24, 2016 at 2:15 PM, Carnë Draug <carandraug+dev at gmail.com>
wrote:
> I have many cases where I use scripts and data files in SCons. At the
> moment I'm writing something like this:
>
> foo_script = 'scripts/mk_foo.py'
> foo = env.Command(source = 'data/foo.json',
> target = 'results/foo.tex',
> action = 'python %s $SOURCE > $TARGET')
> env.Depends(foo, foo_script)
>
> This is already not ideal because I have to keep repeating 'foo_script'.
> However, my problem is another which I think also solves it.
>
> I have changed the structure of my project and started to make use of
> SConscript in subdirectory. When using a SConscript, SCons builders
> are smart enough to fix the path for the declared nodes ("source" and
> "target") but obviously not for the actual path of the script.
>
> Short of exporting one more variable from SConstruct and join the paths
> myself, how can I do this with SCons?
>
> Carnë
> _______________________________________________
> 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/20160124/e8214da6/attachment.html>
More information about the Scons-users
mailing list