Release Management

This page describes how we release software.

The following pages might be of use:

  • Development Tree
  • Testing
  • Building a release

    Splitting the tree

    1. Add any new models to $PTII/ptolemy/configs/doc/completeDemos.htm
    2. If necessary create applets for new demos
      Run
      cd $PTII/ptolemy/configs/doc
      make check_applets
      
      Note that not all the applets listed are missing. Some of them use the serial port, JAI, JMF etc.

      To add an applet:

      cd $PTII/ptolemy/domains/wireless/demo/SmartParking
      $PTII/bin/copernicus -codeGenerator applet -targetPath ptolemy/domains/wireless/demo/SmartParking SmartParking.xml
      
      Then add the .htm files to the makefile.
      Note that sometimes we use just the Vergil applet, in which case we do
      mv FooVergilApplet.htm FooApplet.htm
      
    3. Ptolemy handled about:copyright URLS specially. One facility on the copyrigth page is the ability to expand all the model, .html files and .pdf files on the various demonstration pages. This allows us to verify that all the resources are present in the tree.
      Following the links on about:copyright is an essential part of testing each release.
      For details, see actor.gui.GenerateCopyrights and actor.gui.HTMLViewer
    4. Ptolemy II is organized in to jar files, where each directory contains a jar file of the .class files and another resources that are necessary for that package. These resources include files like images and pdfs. Parent directories contain the jar files in children directories.
      When building a release, it is usually best to build the Web Start release first because it is easier to change one jar file and retry something in Web Start than it is to rebuild an entire Windows installer.
      Use about:copyright to test the Web Start release.
    5. Check out a clean tree and build:
      # Check out a clean tree
      cvs -d :ext:source.eecs.berkeley.edu:/home/cvs co ptII
      cd ptII
      # Make sure empty directories are removed
      cvs update -P -d
      setenv PTII `pwd`
      ./configure
      make
      
    6. Clean the tree by running make checkjunk and adding files as appropriate to the makefiles:
      cd $PTII
      make clean_shipping
      make checkjunk
      
      Look for *** lines and add files to makefiles or add them to the clean_shipping rule in $PTII/makefile and the most recent src.ex file in $PTII/adm/gen-x.y/src.ex.
    7. Run $PTII/util/testsuite/chkjava on the java files and fix problems
      Shortcut: Run it only the most recent files added
      Create a list of java files by either running
      
      cd $PTII
      make cleanDerivedJavaFiles
      
      Or removing the files by hand:
      cd $PTII/ptolemy/data/expr
      rm `make echo_OPTIONAL_JSRCS`
      cd $PTII/ptolemy/data/unit
      rm `make echo_OPTIONAL_JSRCS`
      cd $PTII/ptolemy/copernicus/kernel/fragment
      rm `make echo_OPTIONAL_JSRCS`
      
      # Create a file that contains the names of the java files to include
      cd $PTII
      rm -rf vendors apps
      rm -rf ptolemy/domains/ct/demo/Corba/util/*.java
      
      
    8. Generate a list of files
      adm/bin/ptIItxtfiles > /tmp/f
      egrep '*.java$' /tmp/f | grep -v /vendors/ >& /tmp/j
      
    9. Add trailing newlines to files with $PTII/adm/bin/addtrailingnl
      cd $PTII
      # Run addtrailingnl without actually doing anything:
      cat /tmp/j | xargs $PTII/adm/bin/addtrailingnl -n
      # Run addtrailingnl with adding the new lines:
      cat /tmp/j | xargs $PTII/adm/bin/addtrailingnl
      # Run with -n and then without:
      cat /tmp/f | egrep '*.[ch]$' | xargs $PTII/adm/bin/addtrailingnl -n
      cat /tmp/f | egrep README | xargs $PTII/adm/bin/addtrailingnl -n
      cat /tmp/f | egrep '*.htm' | xargs $PTII/adm/bin/addtrailingnl -n
      cat /tmp/f | egrep '*.tcl' | xargs $PTII/adm/bin/addtrailingnl -n
      cat /tmp/f | egrep '*.xml' | xargs $PTII/adm/bin/addtrailingnl -n
      
    10. Fix common problems in java files:
      cat /tmp/j | xargs $PTII/adm/bin/fix-files -n
      
    11. On a Unix box, check for files with control-Ms:
      cat /tmp/f | xargs $PTII/util/testsuite/controlm
      
      Use dos2unix to fix the files.
      Note many of the files in ptolemy/copernicus/c/test/ should have a control-M in them, so don't remove them.
      Also, check that text files that have control-ms are not checked in to cvs with -kb:
      cat /tmp/f | xargs cvs status >& /tmp/cv.out
      
      Then search /tmp/cv.out for -k, and fix all files that have -kv and -kb (except the .plt files, which can be -kb). To fix these files do:
      cvs admin -kkv filename
      cvs update -A filename
      
    12. Run $PTII/adm/copyright/fixcopyrights (not shipped with the release) and update the copyrights on the .java, .tcl and makefiles
    13. Check out all the files again so we can build a release:
      cd $PTII
      cvs update -P -d -A
      
    14. Run the nightly build, build a release:
      For each release, we copy the most recent $PTII/adm/gen-X.Y, update the version number and run make. See the top of the file for the appropriate make command.
    15. Run $PTII/adm/copyright/chkcopyright on all the nightly buildfiles.
      First, edit $PTII/adm/copyright/chkcopyright and update the year.
      Then, do:
      
      cat /tmp/f | grep -v .class | grep -v codeDoc | grep -v xml | grep -v \
      alljtests.tcl | grep -v .htm | grep -v qcf | grep -v .dtd | grep -v \
      gif | grep -v .cvsignore | xargs sh $PTII/adm/copyright/chkcopyright >&  /tmp/copycheck 
      grep "does not contain a Copyright" /tmp/copycheck | grep -v README
      
    16. Run $PTII/adm/bin/fixsince (not shipped with the release) and update the @since tags
    17. Concatenate all the javadoc files in to one file and run $PTII/util/testsuite/ptspell.
    18. Run findbugs and look at the results:
      cd $PTII/doc
      make findbugs.htm
      
    19. Consider using PMD or
    20. Use Eclipse to fix the imports of the entire tree.
    21. Consider fixing other Eclipse warnings.
    22. Consider using GCJ: The GNU Compiler for Java to report unused variables and other problems. Note that GCJ3.4 will fail to compile awt and swing classes, but it is still worth getting the other error messages.
      cd $PTII make clean make -k JAVAC=gcj JFLAGS="-O2 -Wunused -Wextraneous-semicolon -Wno-deprecated -C" all >& gcj.out & grep error: gcj.out | awk -F: '{for(i=3;i<=NF;i++) {printf("%s ",$i)} printf("\n");}' | sort | uniq | grep -v "not found in the decl"
    23. Consider building with the IBM JDK
    24. Currently, we use Zerog's InstallAnywhere to build Windows installers. Building the Windows installer is fairly complex, below are some things to be aware of
    25. The Windows installer includes source files. These sources come from $PTII/adm/gen-N.M/ptIIN.M.src.jar. Obviously, this jar file should be created on a Windows machine so the end of line characters are Windows end of line characters.
    26. Log on to the cvs server and fix the permissions:
      cd /home/cvs/ptII
      chmod -R a+rX .
      find . -name "*.java,v" -exec chmod a-x {} \;
      find . -name "*.htm,v" -exec chmod a-x {} \;
      find . -name "*.html,v" -exec chmod a-x {} \;
      find . -name "*makefile,v" -exec chmod a-x {} \;
      find . -name "*.tcl,v" -exec chmod a-x {} \;
      find . -name "*.xml,v" -exec chmod a-x {} \;
      
    27. Tag the tree as the release tree and create a branch For more information about CVS, see the Gigascale CVS Pages

      To make a branch for 6.0.beta, use the following command:

      cd $PTII
      cvs tag -b rel-6-0-beta
      
      Then check out the release branch with
      cd ~/src
      cvs co -r rel-6-0-beta ptII
      mv ptII ptII6.0.beta
      
      
      Note that you should avoid dots in the tag name
    28. Update the version numbers, see $PTII/makefile and $PTII/ptolemy/plot/makefile.
    29. Remove files that are not to be shipped from the release:
      cd ptII6.0.beta
      export PTII `pwd`
      ./configure
      make cvs_delete_clean_shipping
      
    30. The nightly build uses a makefile in ~ptII/adm (not shipped) to build the release. Copy the most recent makefile and set up a new tree for the release tree.
    31. We build a separate src.tar.gz file under Unix so that the line endings are correct.
      cvs -D :ext:source:/home/cvs co -r rel-6-0-beta ptII
      mv ptII ptII6.0.beta
      cd ptII6.0.beta
      setenv PTII `pwd`
      cvs update -P -d
      ./configure
      cd bin; make
      cd $PTII/adm/gen-6.0
      make USER=cxh PTIIHOME=/tmp/cxh/ptII6.0.beta PTIIADM=/tmp/cxh/ptII6.0.beta/adm TAR=/bin/tar JAR=/tmp/cxh/jdk1.5.0_09/bin/jar clean all src.jar fortytwo_test
      
      
      The resulting file with the .class files gets copied to the website and untar'd. Note that this does not require Java 3D on the build machine. Java 3D is needed for the applets, we copy the jars over later.
      make USER=cxh PTIIHOME=/tmp/cxh/ptII6.0.beta PTIIADM=/tmp/cxh/ptII6.0.beta/adm TAR=/bin/tar JAR=/tmp/cxh/jdk1.5.0_09/bin/jar update_ftp
      
      or
      make USER=cxh PTIIHOME=/tmp/cxh/ptII6.0.beta PTIIADM=/tmp/ptII6.0.abeta/adm TAR=/usr/sfw/bin/gtar JAR=/bin/jar update_ftp
      
      1. Fix the links to ptplot downloads:
        cd /export/home/pt0/ptweb/ptolemyII/ptII6.0/ptII6.0.beta/ptolemy/plot
        ln -s ../../../../../java/ptplot5.6/ptolemy/plot/ptplot5.6* .
        cd doc
        rm -rf download
        ln -s ../../../../../../java/ptplot5.6.beta/ptolemy/plot/doc/download .
        
      2. Copy gr.jar from a Windows box to ptolemy/domains/gr
      3. Copy codeDoc.jar from a Windows box and unjar it
    32. We build the webstart jar files under Windows
      cvs -d :ext:source:/home/cvs co -r rel-6-0-beta ptII
      cvs update -P -d
      mv ptII ptII6.0.beta
      cd ptII6.0.beta
      export PTII=c:/tmp/cxh/ptII6.0.beta
      
      Set up missing packages such as joystick, JAI, JMF, javacomm, quicktime
      
    33. For alpha and beta releases, copy the user guide pdfs
      cp ../ptII6.0.beta/doc/design/ptIIdesign*.pdf doc/design
      
    34. Clean up the tree:
      make cvs_delete_clean_shipping
      
      Use an older javac so that the .class files are compatible. For example, use java 1.4.x so that java 1.4.x and 1.5.x can use the .class files.
      export PATH=/cygdrive/c/j2sdk1.4.2_13/bin:${PATH}
      java -version
      ./configure
      make clean fast install >& make.out
      
      Copy ~ptII/adm/certs/ptkeystore to $PTII.  Note you will
      need access to the ptII account on bennett 
      
      make jnlp_dist STOREPASSWORD="-storepass xxx" KEYPASSWORD="-keypass xxx"
      
      xxx is the ptkeystore password.
    35. Create the webstart and installer files.
      cd $PTII
      make jar_dist
      
      Look for missing jar files in the output.
    36. Create the src.jar file:
      cd $PTII/adm/gen-6.0
      make USER=cxh PTIIHOME=/cygdrive/c/cxh/ptII6.0.beta COMPRESS=gzip TAR=tar clean all src.jar 
      
    37. Under Windows, build the installer.
      cd $PTII
      make exes
      cd $PTII/adm/gen-x.y
      make TAR=tar make_izpack
      make setup
      
      
    38. Test the installer

    Last Updated: $Date: 2007/02/04 05:02:39 $