[Scons-users] Problem with custom builder

Michael Pock mhp77 at gmx.at
Fri Jul 26 16:52:05 EDT 2013


Hi,

I'd like to implement a builder that takes source directories dir.a,
dir.b and dir.c, and pipes their contents to target files dir.a.list,
dir.b.list and dir.c.list. I've already tried the following:

env = Environment()

env["BUILDERS"]["List"] = Builder(action="ls ${SOURCE} >${TARGET}",
suffix="list" ,
source_factory=Dir ,
single_source=True )

env.List(["dir.a", "dir.b", "dir.c"])

Unfortunately, this doesn't work since the directory suffix is
stripped when computing the target filename. Hence, the target
filename is dir.list for all source directories dir.a, dir.b and dir.c.

I hoped that passing source_suffix=None or source_suffix="" to the
Builder function would solve my problem. But these options seem to
make no difference.

Does anybody know how to implement such a builder?

Best regards
Michael Pock


More information about the Scons-users mailing list