dsss / scons

Jay Norwood jayn at io.com
Sun Jan 6 17:57:49 PST 2008


Jérôme M. Berger Wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Bill Baxter wrote:
> > Jérôme M. Berger wrote:
> >> Bill Baxter wrote:
> >>> Anyone given any thought to building a dsss-like system on top of SCONS?
> >>>  Maybe even one compatible with the real dsss?  Maybe even mr. Gregor
> >>> Richards has considered this?
> >>>
> >>> Just a thought that popped in my head after watching my app's resources
> >>> get needlessly compiled for the umpteenth time because of the lack of
> >>> dependency tracking for anything but D code in DSSS.
> >>>
> >>     I have "thought about it" recently, but I haven't actually done
> >> much for it. What I have however is a system built on top of SCons
> >> which you can point at a folder and say (among other things): "pick
> >> every D source file in here and build a program / a lib with them".
> >> I can make it available if you'd like.
> > 
> > How is that different from the built-in D builder in SCons?  Honest
> > question.  I've never tried to build D code with SCons before, so I
> > really don't know what the current state of the art is.  If your code is
> > better, maybe it should go upstream to be included with SCons itself.
> > 
> 	With SCons, you need to list all source files by hand. I've added
> three things:
>  - A 10-lines python function that scans a folder and returns the
> list of files matching a given regexp. This list can then be given
> to the standard SCons builder to generate a lib or a program;


 scons has something similar now with glob().  Was that your contribution?

http://www.scons.org/doc/0.97.0d20071212/HTML/scons-api/index.html


glob(self, pathname, ondisk=True, source=False, strings=False) 
Returns a list of Nodes (or strings) matching a specified pathname pattern.

Pathname patterns follow UNIX shell semantics: * matches any-length strings of any characters, ? matches any character, and [] can enclose lists or ranges of characters. Matches do not span directory separators.

The matches take into account Repositories, returning local Nodes if a corresponding entry exists in a Repository (either an in-memory Node or something on disk).

By defafult, the glob() function matches entries that exist on-disk, in addition to in-memory Nodes. Setting the "ondisk" argument to False (or some other non-true value) causes the glob() function to only match in-memory Nodes. The default behavior is to return both the on-disk and in-memory Nodes.

The "source" argument, when true, specifies that corresponding source Nodes must be returned if you're globbing in a build directory (initialized with BuildDir()). The default behavior is to return Nodes local to the BuildDir().

The "strings" argument, when true, returns the matches as strings, not Nodes. The strings are path names relative to this directory.

The underlying algorithm is adapted from the glob.glob() function in the Python library (but heavily modified), and uses fnmatch() under the covers.




More information about the Digitalmars-d mailing list