Creating a Base ClearCase Build Tools Structure


If you are using Base ClearCase, you could use the following procedure to create the build tools directory structure.

Create a Build Tools VOB

First, I recommend creating a new VOB (called JavaTools) to contain only the build tools; this can be achieved using the commands shown in Listing 3.1.

Listing 3.1. Creating a Base ClearCase JavaTools VOB

>cleartool mkvob -tag \JavaTools -public -c "JavaTools VOB" -stgloc ccstg_d_vobs Registry password: >cleartool mount \JavaTools

You are prompted for your ClearCase Registry password after the first command because a "public" VOB accessible by everyone is being created. The mount command is required only if you will use dynamic views to access the VOB.

Create a Build Tools View

Next, to be able to import data into the VOB, you should create and configure a ClearCase view (in this case a snapshot view); this can be achieved using the commands shown in Listing 3.2.

Listing 3.2. Creating a Base ClearCase JavaTools View

>cleartool mkview -snapshot -tag javatools_int -stgloc ccstg_d_views C:\Views\javatools_int >cd C:\Views\javatools_int >cleartool update -add_loadrules JavaTools

This creates a view called javatools_int. Because it is a snapshot view, the view root (or access point) is on the local file system at C:\Views\javatools_int. The view is also configured to load the contents of the JavaTools VOB.

Create the Build Tools Directories

Next, you should create the basic directory in the JavaTools VOB. This can be achieved using the commands shown in Listing 3.3.

Listing 3.3. Creating the JavaTools Directory Structure

>cd C:\Views\javatools_int\JavaTools >cleartool co -nc . >cleartool mkdir -nc -nco ant cruisecontrol groovy j2sdk libs >cleartool ci -c "Created initial JavaTools directory structure" .

This creates the following component directories:

  • ant This component directory holds your installed version of Apache Ant.

  • cruisecontrol This component directory holds your installed version of CruiseControl.

  • groovy This component directory holds a recommended version of the groovy Java scripting language. (Groovy is discussed in Chapter 5, "Apache Ant Best Practices.")

  • j2sdk This component directory holds the recommended version of the Java Development Kit (JDK) for building against.

  • libs This generic component directory holds internally developed and third-party libraries.

This list of directories is not prescriptive; you might want to create more or fewer directories depending on your exact tools and requirements.

Import the Build Tools

The build tools view can now be used to import the build tools and add them to version control. Chapters 4 and 6 discuss how to compile and install Ant and CruiseControl; however, the process is the same irrespective of the tool being imported. Because you will probably have a significant amount of data to import, I recommend that you use the ClearCase clearfsimport. For example, if you wanted to import a version of the JDK into the JavaTools VOB, if the JDK was currently located on the file system at C:\j2sdk_1.4.12, you could use the following commands to import it into the VOB:

>cd C:\Views\javatools_int\JavaTools\j2sdk >clearfsimport -recurse C:\j2sdk_1.4.12\* .


This imports and version-controls every file under C:\j2sdk_1.4.12 into the JavaTools j2sdk directory.

Label the Build Tools

Finally, after the import, you should place a label on all the elements that are in the VOB and lock the label so that it can't be moved. This can be achieved using the commands shown in Listing 3.4.

Listing 3.4. Creating a Base ClearCase JavaTools Label

>cd C:\Views\javatools_int\JavaTools >cleartool mklbtype -nc JAVATOOLS_01 >cleartool mklabel -recurse JAVATOOLS_01 . >cleartool lock lbtype:JAVATOOLS_01

In this example a label is placed across the complete JavaTools directory structure. However, if you wanted to manage the build tools at a lower level, you could create the labels on the relevant component directory. For example, to label just the JDK directory, you could carry out the following commands:

>cd C:\Views\javatools_int\JavaTools >cleartool mklbtype -nc J2SDK_02 >cleartool mklabel -recurse J2SDK_02 j2sdk >cleartool mklabel J2SDK .


Notice that to be able to access this label from the top-level JavaTools directory, the label must be placed on the root directory as well.

Alternatively, you can use the ClearCase Apply Label wizard, shown in Figure 3.2, which is available in the ClearCase programs folder. You can enter the details about the label to be created.

Figure 3.2. Applying a label using the ClearCase Apply Label wizard


Make the Build Tools Directory Available to Your Users

After the JavaTools structure has been created and labeled, it can be made available to other projects. This can be achieved by adding the following additional line to each of the user's config specs:

element JavaTools/... JAVATOOLS_01 -nocheckout


The -nocheckout option ensures that the users cannot check out and edit any of the build tools. Additionally, if you have labeled at the component directory level, such as the j2sdk directory, you could amend the config spec as follows:

element JavaTools/j2sdk/... J2SDK_02 -nocheckout element JavaTools/... JAVATOOLS_01 -nocheckout


In this example, since the entry for the j2sdk directory is first, the label J2SDK_02 is matched and the later version picked up. Subsequently, the evaluation of the config spec matches any of the rest of the directory structure using the older JAVATOOLS_01 label.




IBM Rational ClearCase, Ant, and CruiseControl. The Java Developer's Guide to Accelerating and Automating the Build Process
IBM Rational ClearCase, Ant, and CruiseControl: The Java Developers Guide to Accelerating and Automating the Build Process
ISBN: 0321356993
EAN: 2147483647
Year: 2004
Pages: 115
Authors: Kevin A. Lee

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net