Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
#!/bin/tcsh
##############################################################################################
# Create default doc/xxx.doc file for a CMSSW package, assuming that none currently exists.  #
# You should run it in the package's doc/ directory.                                         #
#                                                                                            #
# You are recommended to add further documentation by hand to this default outline.          #
#                                                                                            #
# Author: Ian Tomalin                                                                        #
# Date  : 3rd April 2006                                                                     #
# Update: Mantas Stankevicius                                                                #
# Date  : 2013 June 7                                                                        #
##############################################################################################

# Check that we are in the doc/ directory
set checkDir = `echo $PWD | awk -F/ '{print $NF}'`
if ( `basename $PWD` != "doc" ) then
  echo "You should be in the doc/ directory of the package before running this script."
  exit 1
endif

# Get the package and project names.
set dirRoot     = `dirname $PWD`
set packageName = `basename $dirRoot`
set dirRoot2    = `dirname $dirRoot`
set projectName = `basename $dirRoot2`

# Hence define name of .doc file.
set fileName = ${packageName}.doc

# Check if .doc file already exists.

if ( -e $fileName ) then

  echo "$fileName already exists, so will do nothing." 
  echo "Delete it by hand if you wish to replace it."

else

  echo "Creating $fileName"

#  set Date = `date +%D`

# Produce .doc file.
cat > $fileName <<@EOF

/*!

\page ${projectName}_${packageName} Package ${projectName}/${packageName}


\section desc Description
<!-- Short description of what this package is supposed to provide -->

(THE PACKAGE ADMINISTATOR SHOULD REPLACE THIS SENTENCE WITH HAND-WRITTEN DOCUMENTATION SAYING WHAT THE PACKAGE DOES.)

\subsection interface Public interface
<!-- List the classes that are provided for use in other packages (if any) -->

@EOF

# Include list of interface classes here, stripping of directory name and .h 
ls -1 ../interface/*.h | awk -F/interface/ '{print $2}' | awk -F. '{print "- " $1}' >> $fileName

# Remainder of .doc file.

cat >> $fileName <<@EOF


\subsection pluginai Plugins
<!-- List the plugins that are provided for use in other packages (if any) -->

@EOF

# Include list of plugins classes here, stripping of directory name and .h 
ls -1 ../plugins/*.h | awk -F/plugins/ '{print $2}' | awk -F. '{print "- " $1}' >> $fileName

# Remainder of .doc file.

cat >> $fileName <<@EOF



\subsection modules Modules
<!-- Describe modules implemented in this package and their parameter set -->

@EOF

#Include list of modules here, stripping DEFINE_FWK_MODULE keyword.
grep -h '^DEFINE_FWK_MODULE' ../src/*.cc | awk -F'(' '{print $2}' | awk -F ')' '{print "- " $1}' >> $fileName
grep -h '^DEFINE_FWK_EVENTSETUP_MODULE' ../src/*.cc | awk -F'(' '{print $2}' | awk -F ')' '{print "- " $1}' >> $fileName

# Remainder of .doc file.

cat >> $fileName <<@EOF

\subsection tests Unit tests and examples
<!-- Describe cppunit tests and example configuration files -->
Unknown

\section status Status and planned development
<!-- e.g. completed, stable, missing features -->
Unknown

<hr>
Last updated:
@DATE@  Author: computer-generated.
*/

@EOF