[Scons-users] How to treat a directory of stuff as a single node

Michel Lestrade michel.lestrade at crosslight.com
Tue Jan 22 15:52:23 EST 2013


You probably want to use Depends():
http://scons.org/doc/HTML/scons-user/x1220.html

I've had occasion to use this in cases where a header file was created
by a custom builder so that the dependency was not being explicitly
found by the scanners. It is worth trying to see if the function applies
to Dir() nodes and not just targets.

Recent scons user too; I found the list to be extremely helpful....

On 22/01/2013 12:17 PM, M Busche wrote:

> I'm trying to use SCONS for the first time to handle builds, test, doc generation and packaging for a little personal C++ project. I've made significant progress, but am having some difficulty with packaging. I've written some stuff to first copy my source into a generated distribution directory (and replacing __VERSION__ strings found in each file with the software version). This works just fine. My problem is that I don't want this software packaging process to start until all tests have been completed. But because I'm only packaging up source code, there's nothing to stop SCONS from deciding to start the packing process prior to running tests (or doing anything else at all for that matter). So how do I easily get SCONS to see the successful completion of my test cases as a dependency of every file copy operation and directory creation operation that I use to build up the distribution directory?

>

> Now all of my tests are run in a separate directory aptly named "test", and successful completion of a suite of test cases does create an SCONS target file in that directory structure. So, I presume if I explicitly declared the root directory node "test" as a dependency of all the copy / Mkdir operations I use to build up my distribution directory, that that would guarantee all the test suites finish prior to any packaging. (I have not tried this, but it seems like it should work.) But this seems cumbersome and awkward. Am I missing something? And what if I then wanted to declare some other build activity as another prerequisite to software packaging? I'd then have to promulgate the corresponding build targets as additional dependencies of all those copies and Mkdirs that are at the root of the packaging process???

>

> Seems like what I want is some abstract node X (that doesn't correspond to any actual file or directory) declared as a dependency of each copy / Mkdir operation. Then I can declare other things (like test cases) to be dependencies of X. Is there such a thing in SCONS?

>

> Anyway, I'm a noob working in isolation, and I'm quite likely missing something to make everything much simpler. (I feel like I'm doing more work than I should have to to get my dependencies just right.)

>

> Thanks,

> Matt

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

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

>





More information about the Scons-users mailing list