[Scons-users] SCons.Node.Python.Value on target_factory
Gary Oberbrunner
garyo at oberbrunner.com
Mon Apr 8 01:33:59 EDT 2013
On Sun, Apr 7, 2013 at 9:42 PM, Philipp Kraus <philipp.kraus at flashpixx.de>wrote:
>
> Am 08.04.2013 um 03:11 schrieb Bill Deegan:
>
> Any reason your not just doing Execute(your_actions)?
> Are you using the dependencies? It looks like not.
> Unless I'm misunderstanding, you just want an alias to run some commands
> for you.
>
>
> The discussion goes off-topic, please forgot the previous discussion and
> take a look to this example only:
>
> ------------
> import SCons.Action
>
> env = Environment()
>
> env["BUILDERS"]["WithPyValue"] = SCons.Builder.Builder( action =
> SCons.Action.Action("echo testbuild 1"), source_factory =
> SCons.Node.FS.File, target_factory = SCons.Node.Python.Value )
> env["BUILDERS"]["WithoutPyValue"] = SCons.Builder.Builder( action =
> SCons.Action.Action("echo testbuild 2"), source_factory =
> SCons.Node.FS.File )
>
>
> env.WithPyValue("target1", "source1")
> # env.WithoutPyValue("target2", "source2")
> ---------------
>
>
> In this case my system produce:
>
> scons: Building targets ...
> scons: `.' is up to date.
> scons: done building targets.
>
> IMHO it should produce an error "source1" not exists, but in this case it
> should be the default target.
>
>
Probably you're not using the generated python value (returned by
WithPyValue) anywhere. SCons by default builds all filesystem targets
under '.'. Your target (a Value) is not a file under . so SCons doesn't
think it needs to be built.
Try making it a dependency of something else:
foo=env.WithPyValue(...)
bar=env.Command(...)
Depends(bar, foo)
or something like that.
But if you're making a source code builder, it may be instructive to learn
(as Bill says) that SCons has had one for a long time, it never worked that
well, and most people found it easier to just check out the source outside
of SCons or just Execute() the source code commands.
--
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20130408/b15fe9fd/attachment.htm>
More information about the Scons-users
mailing list