[Scons-users] creating custom builder

William Deegan bill at baddogconsulting.com
Thu Nov 8 13:52:10 EST 2012


Wiktor,

Also take a look at this:
http://www.scons.org/wiki/ToolsForFools

Regarding composite nodes. SCons doesn't current support such. Each Node represents a file, directory, or non-file object.
Having composite nodes would be great and likely resolve some of SCons's shortcomings.

-Bill
On Nov 8, 2012, at 5:22 AM, Ringo De Smet <ringo.desmet at gmail.com> wrote:


> Hello Wiktor,

>

> First of all, I suggest you study some of the contributed custom builders found on the wiki (source included):

> http://scons.org/wiki/CustomBuilders

>

> This should definitely help you further.

>

> On 8 November 2012 12:43, wiktor tomczak <wiktor.tomczak at gmail.com> wrote:

> 1. I'd like the builder to always produce a fixed set of files, eg. given a source file foo, it should always produce target files foo_bar and foo_baz. Ideally, these targets would be implicit, they wouldn't need to be listed explicitly in targets (same way Program('hello.c') implicitly produces hello). How can I do that?

>

> You use an emitter for that. Read in the man page under "Builder Objects" the section about emitter:

> http://scons.org/doc/production/HTML/scons-man.html#lbAP

>

> 2. I'd like the builder to take custom keyword arguments other than source and target. Can I define the builder as a Python class that implements some interface? Is there a Builder interface?

>

> Have a look at the AutoConfigBuilder or MakeBuilder in the list of contributed Custom Builders. These builders accept additional keyword arguments.

>

> 3. Per 1., I'd like the builder to produce a set heterogeneous files which together form a single logical target. The builder could return a list of Node objects, but that would lack structure. Can I encapsulate the list in a custom class that represents the logical target and use that as builder's return value?

>

> Make an Alias for the list of targets. See Alias() under "Methods and Functions to do things"

> http://scons.org/doc/production/HTML/scons-man.html#lbAI

>

> Hope this helps,

>

> Ringo

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20121108/43d7757e/attachment.html>


More information about the Scons-users mailing list