bin/jsdoc

Summary

Maintainability
Test Coverage
#!/bin/bash
# jsdocx
#
#    Purpose:
#        
#    Description:
#        
#    History:
#        Wed Dec  9 15:11:56     2009, Created by jumperchen
#
#Copyright (C) 2009 Potix Corporation. All Rights Reserved.
#
stamp=$(date +%Y-%m-%d)
cd ..
maindir="$(pwd)"
target=$1
rootdir=$2
cd $rootdir

#setting=build.setting.local
#if [ ! -f $setting ] ; then
#    setting=build.setting
#    if [ ! -f $setting ] ; then
#        echo $setting must be specified
#        exit 1
#    fi
#fi
cd $maindir
if [ $# != 0 ] ; then
    for target in $* ; do
        target=${target%/}
        if [ "$target" != "$rootdir" ] ; then
            jsdocsrc="$jsdocsrc $target"
            if [ \( ! -d $target \) -a \( ! -d ${target}Test \) ] ; then
                echo "Error: $target doesn't exist"
                exit 1
            fi
        fi
    done
#else
#    deploy=
#    if [ -f deploy ] ; then
#        deploy=$(head -1 deploy)
#        jsdocsrc=$(grep '^jsdoc=' deploy)
#        jsdocsrc=${jsdocsrc#jsdoc=}
#        if [ "$jsdocsrc" = "" ] ; then
#            echo jsdoc must be specified in $deploy
#            exit 1
#        fi
#    else
#        echo $deploy must be specified
#        exit 1
#    fi
#    jsdocsrc="$(echo $jsdocsrc | tr ',' ' ')"
fi
cd $rootdir/jsdoc
for target in $jsdocsrc ; do
    echo "jsdoc $target"
    mkdir -p codegen/$target
    java -jar $rootdir/dist/lib/ext/zk_jsdoc.jar -t "$maindir/$target/src" -g "$rootdir/jsdoc/codegen/"
done