#!/bin/sh # Version: $Id: mkreview 41477 2006-03-29 00:03:58Z cxh $ # Author: Christopher Hylands # # @Copyright (c) 1997-2006 The Regents of the University of California. # All rights reserved. # # Permission is hereby granted, without written agreement and without # license or royalty fees, to use, copy, modify, and distribute this # software and its documentation for any purpose, provided that the # above copyright notice and the following two paragraphs appear in all # copies of this software. # # IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY # FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES # ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF # THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE # PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF # CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, # ENHANCEMENTS, OR MODIFICATIONS. # # PT_COPYRIGHT_VERSION_2 # COPYRIGHTENDKEY # Generate the materials for a review # It is unlikely that this script will work anywhere but at UCB # This script expects as its arguments: if [ $# -lt 1 ]; then echo "$0: Usage: $0 reviewtopdir packagename reviewname file1 [file2...]" echo "reviewtopdir should be of the form: /users/ptII/public_html/reviews" echo "packagename should be of the form: ptolemy/actor" echo "reviewname should be of the form: YYYYMMDD-design or YYYYMMDD-code" echo "file should be of the form: foo.java or util/bar.java" echo "For example:" echo "mkreview ~/ptIIweb/reviews ptolemy/kernel 20000724-code {Port,ComponentPort,CompositeEntity}.java util/CrossRefList.java" echo "Source files will be loaded from $PTII/packagename/file and a review created in reviewtopdir/packagename/reviewname" exit 2 fi # It generates PostScript and PDF versions of the source file # The name of the directory that the review materials will reside in reviewtopdir=$1 packagename=$2 reviewname=$3 reviewdate=`basename $reviewname` shift shift shift files=$@ # This directory will contain the docs reviewdir=$reviewtopdir/$packagename/$reviewname if [ -d $reviewdir ]; then echo "$0: $reviewdir exists, will not overwrite it, exiting." exit 3 fi # Name of the HTML page that refers to the review materials # Note that this page is in the directory above the review materials reviewfile=$reviewtopdir/$packagename/$reviewname.htm echo "Will generate review materials in $reviewdir" echo "The file '$reviewfile'" echo " contains links to the review materials." echo "Please edit this file and check in to CVS" mkdir $reviewdir # # Generate PostScript of the code cd $PTII/$packagename # Remove the directories from the filenames. # We only handle classes in one directory at a time so that each review # is for only the classes in that package. If you are combining # classes from two packages into one review, then create two review pages # and add hyperlinks between the two shortfiles="" for file in $files do shortfiles=" $shortfiles `basename $file`" done echo " Printing using enscript . . ." #enscript -Gp - $shortfiles > $reviewdir/javafiles.ps # Line numbers enscript --media=Letter -C -Gp - $shortfiles > $reviewdir/javafiles.ps # Pretty print + line numbers #enscript -E -C -Gp - $shortfiles > $reviewdir/javafiles.ps echo " Converting to 2up using psnup . . ." cd $reviewdir psnup -n 2 < javafiles.ps > javafiles2up.ps echo " Generating PDF using distill . . ." distill javafiles2up.ps date=`date +"%h %e, %Y "` title="$date: Review of `echo $files | sed 's/.java//g'`" #################################### echo " Generating an html file with the appropriate links . . ." cat >$reviewfile < $title

$title

Preliminary notes

If necessary, a few paragraphs about the review
  • Source code: EoF # Note that we are not including the .java files in the review tree (cxh 9/00) for file in $files do echo "
  • $file" >>$reviewfile done # We don't include the 1 up pdf files cat >>$reviewfile < 2 up PDF
  • UML Diagram
  • Review started: time
    Review ended: time

    Identified defects