Project CVS Guidelines

1. Project Directory Structure

I will use the Ant notation ${team} for the team name (i.e. athens, berlin, ...)

For the team work, your CVSROOT will be /home/cvsroot/sandbox/${team}.

You already have a few junk projects in that CVSROOT from prior labs; just ignore them.

Each team gives their project the CVS module name codegrader. That is, on the server, the project will be stored as /home/cvsroot/sandbox/${team}/codegrader.

The documentation (SRS, design docs, schedule, etc.), of your project will be stored in a directory doc inside your project.

That is, your project will have the following structure:

codegrader/
   doc
      index.html
      srs.html
      design.html
      schedule.gan
   build2.xml
   build2.properties
   src
   codegrader-ejb
      src
      .cvsignore      
   codegrader-war
      src
      web
      .cvsignore
   .cvsignore

Your team leader starts the project with a dummy doc/index.html file and then checks it into CVS.

You don't have to make a NetBeans project right away, so just file the following tidbit of information away.

You don't want to import all the NetBeans crud onto the server. This is achieved by making a file .cvsignore (note the leading period) with the following contents:

build
dist

That file is put into three places: the root, the ejb subdirectory, and the war subdirectory of your NetBeans project.

Documentation Checkout Script

Each of you (including the team leader--you knew that) checks out the project into your home directory. That is, after checkout, there will be a file ~/codegrader/doc/index.html and the usual CVS directories.

Then each of you checks in your contributions into CVS, and each of you checks out everyone else's contributions.

I will use the following Ant script codegrader.xml to check out your documentation onto the server. You should test that this works for you. Test it locally, then run it on the server. (I.e. scp the script files, then ssh into oslo and launch /opt/glassfish/bin/asant -f codegrader.xml) Let me know if you run into any file permission issues.

Point your browser to http://localhost:8080/${team}-doc or http://oslo.cs.sjsu.edu:8080/${team}-doc.

<project name="ProjectDoc" default="deploy-doc" basedir=".">
   <property file="codegrader.properties" />
   <property name="build.dir" value="${basedir}" />
   <property name="cvs.module" value="codegrader"/>   
   <property name="doc.dir" value="${build.dir}/${cvs.module}/doc" />
   <property name="dist.dir" value="${build.dir}/dist" />
   <property name="war.name" value="${team}-doc" />
   <property name="doc.war" value="${build.dir}/dist/${war.name}.war" />   
  
   <target name="prepare">
      <mkdir dir="${doc.dir}/WEB-INF"/>
      <mkdir dir="${dist.dir}"/>    
   </target>

   <target name="checkout" depends="prepare">
      <cvs
         cvsroot=":ext:${username}@oslo.cs.sjsu.edu:/home/cvsroot/sandbox/${team}"
         cvsrsh="/usr/bin/ssh" dest="${build.dir}" package="${cvs.module}"/>
   </target>   
   
   <target name="package" depends="checkout">
      <!-- Make trivial web.xml -->
      <echo message="&lt;?xml version='1.0' encoding='UTF-8'?&gt;&lt;web-app version='2.5' xmlns='http://java.sun.com/xml/ns/javaee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd'&gt;&lt;/web-app&gt;"
         file="${doc.dir}/WEB-INF/web.xml"/>
      <jar jarfile="${doc.war}">
         <fileset dir="${doc.dir}">
            <exclude name="**/CVS/**" />
         </fileset>
      </jar>
   </target>

   <target name="deploy-doc" depends="package">
      <copy file="${doc.war}" todir="${deploy.dir}"/>
   </target>
      
   <target name="clean">
      <delete dir="${dist.dir}" />
   </target>

</project>

Here is codegrader.properties:

team=copenhagen
username=copenhagen1
glassfish.dir=/opt/glassfish
deploy.dir=${glassfish.dir}/domains/domain1/autodeploy

Code Deployment Script

Stay tuned for an announcement on running your deployment script.