Next: , Previous: Keywords, Up: Top


10 Subprojects

You can use prcs to “bundle together” a set of projects (so that they may be released together, for example). Suppose that P is the name you want to give to the (new) combined project, with P1, P2, and P3 the names of the subprojects. To create the initial version of P, take the following steps.

  1. Go into a directory that is to serve as the working directory for P.
  2. Use prcs checkout to create a .prj file for P.
  3. For each subproject, Pi, create a subdirectory Pi, and in that subdirectory, execute the command
              % prcs checkout -r... Pi Pi.prj
         

    (replacing `...' with the appropriate version specifier). This checks out the .prj file for Pi into Pi.

  4. Modify the Files entry for P to list the .prj files for the Pi.
  5. Check in P.

To create a working copy of this version of P (including working copies of all its subprojects' files), use the following (Bourne shell) commands (I'll assume that 0.1 is the version name for P).

     $ prcs checkout -r0.1 P
     $ for i in P1 P2 P3; do
     >   (cd $i; prcs checkout $i)
     > done

Obvious modifications of this procedure will serve to create updated versions of P.

With a little care, we can automate this process a bit further. Suppose that we establish a convention that we tag each subproject descriptor file in the Files list of P:

     (Files
       ...
       (P1 (...) :tag=project)
       (P2 (...) :tag=project)
       (P3 (...) :tag=project)
       ...
     )

This allows a general-purpose version of the checkout procedure above, one that does not require that we remember the names of all the subprojects:

     % prcs execute -r0.1 --match :tag=project P -- prcs checkout {}