cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Remark 2: Desired feature: Conscript-uptodate targets


From: Steven Knight
Subject: RE: Remark 2: Desired feature: Conscript-uptodate targets
Date: Thu, 30 Nov 2000 16:55:01 -0600 (CST)

On Thu, 30 Nov 2000, Eric Brown wrote:
> I've also been looking at how to do 'post-build' things in Cons (e.g.,
> building setup programs, sending email based on the status of the build)
> that have to be done after the programs are built.  
> 
> I would also like to figure out a better way to do this within Cons.

You can still do this with dependencies (which is really what it is,
emailing your status depends on everything else being built).

I've used something like the following to collect dependencies from the
whole tree on a top-level file that marks when the build has finished:

        Construct:

                $email_status = '#email_status_file';
                Export qw( email_status );
                Command $env $email_status, qq(
                        echo "Build $failed_or_not" | tee %> | mail 
address@hidden
                );

        subdir1/Conscript:

                Import qw( email_status );

                Program 'foo.exe', @sources;

                Depends $email_status, 'foo.exe';

        subdir2/Conscript:

                Import qw( email_status );

                Program 'bar.exe', @bar_sources;
                Program 'baz.exe', @baz_sources;

                Depends $email_status, qw( bar.exe baz.exe );

You need the '#' in front of the file name so it's always at the top-level
regardless of how deep each Conscript file appears in the hierarchy.

The hassle is that, yes, you have to remember to list a new dependency
whenever you add a new target.  But this is analogous to Cons requiring
an explicit list of the source files that go into a product.  The payoff
is that if you get explicit about listing these dependencies, your build
process is far more powerful.

        --SK




reply via email to

[Prev in Thread] Current Thread [Next in Thread]