3 messages in com.perforce.jamming[jamming] Re: last rule for jam?
FromSent OnAttachments
Laur...@perforce.com16 Aug 1999 12:27 
Hoff16 Aug 1999 13:55 
Dian...@whistle.com16 Aug 1999 19:49 
Subject:[jamming] Re: last rule for jam?
From:Laur...@perforce.com (Laur@perforce.com)
Date:08/16/1999 12:27:40 PM
List:com.perforce.jamming

Hoff, Todd <todd@lightera.com> writes:

We have the situation where we want to run a series of actions after the build is complete. So far this is to execute batch files to create install programs and similar other items.

I was told you posted how to do this, but i could not find it in the archives ... Would you happend to remember the solution?

Well, I searched the jamming archive, and I've searched my personal mail files, but didn't find anything, although I could have sworn I've seen postings about this...

Jam doesn't have any concept of "after the build is complete". If you have a bunch of things that need to be done to stuff after it is built, just define a rule that makes its outputs dependent on its inputs, and invoke that rule using your built things as inputs. E.g., if your last step is to bundle up everything you build in a tar file, invoke your tar rule on everything you build. It won't get run until the build is complete.

In fact, Jambase's Install* rules work this way. Because the Install rule's outputs (files in the install path) are dependent on its inputs (files in the build path), everything always gets "installed" last. Take a look at those rules in Jambase and see if you can use them as an example.

The problem arises when your last step needs to be run regardless of whether the build was completely successful. For example, if the last step is to generate a report that lists what got built, you can't make that report dependent on built targets -- any failed target will cause the report not to be generated. But you can't make it independent of your built targets either, because then Jam may try to run it before the build is done. In that situation, I think your best bet is to run a separate post-build script after jam completes.

--Laura

------------------------------------------------------------------------ Laura Wingerd lau@perforce.com Voice: 1-510-864-7400 Perforce Software, Inc. www.perforce.com Fax: 1-510-864-5340

------------------------------------------------------------------------