summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornickb2006-04-13 14:58:37 (EDT)
committer nickb2006-04-13 14:58:37 (EDT)
commitca27f4d552d1e08fab1b563cfd0b7ec9cc075101 (patch)
tree5fab42f1f7343b0ed2562b366ee0bb2052fd80df
parent02b987734a7f62018bf391a1b19a0e2470fb871e (diff)
downloadorg.eclipse.jet-ca27f4d552d1e08fab1b563cfd0b7ec9cc075101.zip
org.eclipse.jet-ca27f4d552d1e08fab1b563cfd0b7ec9cc075101.tar.gz
org.eclipse.jet-ca27f4d552d1e08fab1b563cfd0b7ec9cc075101.tar.bz2
migrate to new template/script, keeping JDK1.5 & losing -J-Xmx1024M
-rw-r--r--doc/org.eclipse.jet.doc/build/antJavadoc.sh160
-rw-r--r--doc/org.eclipse.jet.doc/build/javadoc.xml.template16
2 files changed, 100 insertions, 76 deletions
diff --git a/doc/org.eclipse.jet.doc/build/antJavadoc.sh b/doc/org.eclipse.jet.doc/build/antJavadoc.sh
index 787c6d7..7d1d68d 100644
--- a/doc/org.eclipse.jet.doc/build/antJavadoc.sh
+++ b/doc/org.eclipse.jet.doc/build/antJavadoc.sh
@@ -1,104 +1,122 @@
#!/bin/sh
-if [ "x"$ANT_HOME = "x" ]; then export ANT_HOME=/opt/apache-ant-1.6; fi
-#if [ "x"$JAVA_HOME = "x" ]; then export JAVA_HOME=/opt/sun-java2-5.0; fi
-# Always use 1.5 JVM for Javadoc, 1.4 one has memory problems
+# BEGIN CUSTOMIZATIONS
+
+# The plugin name
+pluginName="org.eclipse.jet";
+
+# string labels for javadoc content
+windowTitle="EMF JET Javadoc";
+groupTitle="JET";
+
+# files to exclude from javadoc process - use Ant syntax
+javadocExclusions="<exclude name=\"**/internal/**\"/> <exclude name=\"**/examples/**\"/> <exclude name=\"**/tests/**\"/>";
+javadocExclusions=$javadocExclusions" <exclude name=\"**/antsrc/org/eclipse/jet/**\"/> <exclude name=\"dataAccess/**\"/>";
+
+# special for JET only: always use 1.5 JVM for Javadoc, 1.4 one has memory problems
export JAVA_HOME=/opt/sun-java2-5.0
+
+# END CUSTOMIZATIONS
+
+##########################################################################
+
+debug=0; if [ $debug -gt 0 ]; then echo "[antJd] debug: "$debug; fi
+
+if [ "x"$ANT_HOME = "x" ]; then export ANT_HOME=/opt/apache-ant-1.6; fi
+if [ "x"$JAVA_HOME = "x" ]; then export JAVA_HOME=/opt/ibm-java2-1.4; fi
export PATH=${PATH}:${ANT_HOME}/bin
-# The current direcotry
-currentPath=`echo "$PWD/$0" | sed -e 's/\(.*\)\/.*/\1\//' | sed -e 's/^[^\/]*$//g'`
-echo "currentPath =" $currentPath
+# current directory - all but the name of this script, no trailing slash
+currentPath=$PWD"/"$0; currentPath=${currentPath%/*}; if [ $debug -gt 0 ]; then echo "[antJd] currentPath: "$currentPath; fi
+
+# path to $buildID/eclipse/plugins, no trailing slash
+pluginPath=${currentPath%/$pluginName*}; if [ $debug -gt 0 ]; then echo "[antJd] pluginName: "$pluginName; echo "[antJd] pluginPath: "$pluginPath; fi
+
+# ant script to create and then execute
+antScript=$currentPath"/javadoc.xml"; if [ $debug -gt 0 ]; then echo "[antJd] antScript: "$antScript; fi
# The eclipse directory
-eclipseDir=$1
+eclipseDir=`cd $1; echo $PWD`; if [ $debug -gt 0 ]; then echo "[antJd] eclipseDir: "$eclipseDir; fi
# The destination directory
-destDir=$currentPath/../references/javadoc
+destDir=$currentPath/../references/javadoc; mkdir -p $destDir; destDir=`cd $destDir; echo $PWD`; # resolve relative path
+if [ $debug -gt 0 ]; then echo "[antJd] destDir: "$destDir; fi
-mkdir -p $destDir
-
-# The plugin name
-pluginName="org.eclipse.jet"
-
-# Don't execute if the destination directory has files
-#if [ -d "$destDir" ]; then
-# exit
-#fi
-
-function groupPackage
-{
- plugin=$1
- hasToken=`grep "@plugin@" $currentPath/javadoc.xml.template`
- if [ "x$hasToken" != "x" ]; then
- srcDir=$currentPath/../../$plugin/src
- if [ -d "$srcDir" ]; then
- packages=`find $srcDir -type f -name '*.java' -exec grep -e '^package .*;' {} \; | sed -e 's/^package *\(.*\);/\1/' | sed -e 's/[ \n\t\r]*//g' | sort | uniq | xargs | sed -e 's/ /:/g'`
- packages=`echo $packages | sed -e 's/\//\\\\\\//g' | sed -e 's/\./\\\\\./g'`
-
- sed -e "s/\@plugin\@/${packages}/g" $currentPath/javadoc.xml.template > $currentPath/javadoc.xml.template.tmp
- fi
+hasToken=`grep "@plugin@" $antScript.template`;
+if [ "x$hasToken" != "x" ]; then
+ srcDir=$pluginPath/$pluginName/src; if [ $debug -gt 0 ]; then echo "[antJd] srcDir: "$srcDir; fi
+ if [ -d "$srcDir" ]; then
+ if [ $debug -gt 0 ]; then echo "[antJd] *.java in \$srcDir: "; echo "-----------------"; echo `find $srcDir -type f -name '*.java'`; echo "-----------------"; fi
+ packages=`find $srcDir -type f -name '*.java' -exec grep -e '^package .*;' {} \; | sed -e 's/^package *\(.*\);/\1/' | sed -e 's/[ ]*//g' | sort | uniq | xargs | sed -e 's/ /:/g'`;
+ if [ $debug -gt 1 ]; then echo "[antJd] packages1: "$packages; fi
+ packages=`echo $packages | sed -e 's/\//\\\\\\//g' | sed -e 's/\./\\\\\./g'`; # slash escape
+ if [ $debug -gt 1 ]; then echo "[antJd] packages2: "$packages; fi
+ sed -e "s/\@plugin\@/${packages}/g" $antScript.template > $antScript.template.tmp;
fi
-}
-
-groupPackage $pluginName
+else
+ echo "[antJd] ERROR! "$currentPath"/javadoc.xml.template does not contain token @plugin@!";
+fi
-# The directory of the plugins in the order they were built
-# Original: pluginDirs=`find $eclipseDir/plugins -name @dot -printf '%T@ %p\n' | sort -n | grep org.eclipse.emf.transaction | cut -f2 -d' ' | sed -e 's/\(\/.*\)\/.*/\1/'`
-# New (eclipseDir): pluginDirs=`find $eclipseDir/plugins -name 'org.eclipse.emf.transaction*' -maxdepth 1 -type d -printf '%T@ %p\n' | sort -n | cut -f2 -d' '`
# Finds plugins in the Workspace:
-pluginDirs=`find $currentPath/../.. -maxdepth 1 -name "${pluginName}*" -type d -printf '%T@ %p\n' | sort -n | cut -f2 -d' '`
-
-echo "pluginDirs =" $pluginDirs
+pluginDirs=`find $pluginPath -name "${pluginName}*" -maxdepth 1 -type d -printf '%T@ %p\n' | sort -n | cut -f2 -d' '`;
+if [ $debug -gt 0 ]; then
+ echo "[antJd] pluginDirs:";
+ for pluginDir in $pluginDirs; do echo "[antJd] "$pluginDir; done
+fi
-### TODO: missing emf/sdo/xsd plugins (?) in $eclipseDir - need to copy them over or reference source (?)
-### so that all classes/packages (and thus @links) can be resolved
+### TODO?: missing emf/sdo/xsd plugins in $eclipseDir - need to copy them over or reference source so that all classes/packages (and thus @links) can be resolved
# All the jars in the plugins directory
-classpath=`find $eclipseDir/plugins -name "*.jar" -printf "%p:"`
+classpath=`find $eclipseDir/plugins -name "*.jar" -printf "%p:"`; if [ $debug -gt 0 ]; then echo "[antJd] classpath: "$classpath; fi
# Calculates the packagesets and the calls to copyDocFiles
-packagesets=""
-copydocfiles=""
+packagesets="";
+copydocfiles="";
for pluginDir in $pluginDirs; do
- pluginDir=`echo $pluginDir | sed -e 's/\/runtime$//g'`
- srcDir=$pluginDir/src
+ pluginDir=`echo $pluginDir | sed -e 's/\/runtime$//g'`;
+ srcDir=$pluginDir/src;
+ if [ $debug -gt 0 ]; then echo "[antJd] srcDir: "$srcDir; fi
if [ -d "$srcDir" ]; then
- packagesets=$packagesets"<packageset dir=\"$srcDir\"><exclude name=\"**/antsrc/org/eclipse/jet/**\"/><exclude name=\"**/doc-files/**\"/><exclude name=\"**/internal/**\"/><exclude name=\"dataAccess/**\"/><exclude name=\"**/examples/**\"/><exclude name=\"**/tests/**\"/></packageset>"
- copydocfiles=$copydocfiles"<copyDocFiles pluginDir=\"$pluginDir\"/>"
+ # define what to include when javadoc'ing here:
+ packagesets=$packagesets"<packageset dir=\"$srcDir\"> ";
+ packagesets=$packagesets"<exclude name=\"$srcDir/**/doc-files/**\"/> ";
+ packagesets=$packagesets""$javadocExclusions;
+ packagesets=$packagesets"</packageset>";
+ copydocfiles=$copydocfiles"<copyDocFiles pluginDir=\"$pluginDir\"/>";
fi
done
-
+if [ $debug -gt 0 ]; then
+ echo "[antJd] packagesets:"; echo $packagesets;
+ echo "[antJd] copydocfiles:"; echo $copydocfiles;
+fi
+
# Finds the proper org.eclipse.platform.doc.isv jar
-docjar=`find $eclipseDir/plugins/ -name "org.eclipse.platform.doc.isv*.jar" -printf "%f"`
+docjar=`find $eclipseDir/plugins/ -name "org.eclipse.platform.doc.isv*.jar" -printf "%f"`; if [ $debug -gt 1 ]; then echo "[antJd] docjar: "$docjar; fi
-if [ -f $currentPath/javadoc.xml.template ]; then
+if [ -f $antScript.template ]; then
true;
else
- cp $currentPath/javadoc.xml.template $currentPath/javadoc.xml.template.tmp;
+ cp $antScript.template $antScript.template.tmp;
fi
-# Replaces the token @packagesets@ in the template by the actual value
-packagesets=`echo $packagesets | sed -e 's/\//\\\\\\//g' | sed -e 's/\./\\\\\./g'`
-sed -e "s/\@packagesets\@/${packagesets}/g" $currentPath/javadoc.xml.template.tmp > $currentPath/javadoc.xml.template.tmp2
-# Replaces the token @copydocfiles@ in the template by the actual value
-copydocfiles=`echo $copydocfiles | sed -e 's/\//\\\\\\//g' | sed -e 's/\./\\\\\./g'`
-sed -e "s/\@copydocfiles\@/${copydocfiles}/g" $currentPath/javadoc.xml.template.tmp2 > $currentPath/javadoc.xml.template.tmp
-# Replaces the token @docjar@ in the template by the actual value
-sed -e "s/\@docjar\@/${docjar}/g" $currentPath/javadoc.xml.template.tmp > $currentPath/javadoc.xml.template.tmp2
-# Replaces the token @eclipseDir@ in the template by the actual value
-eclipseDirEsc=`echo $eclipseDir | sed -e 's/\//\\\\\//g' | sed -e 's/\./\\\\\./g'`
-sed -e "s/\@eclipseDir\@/${eclipseDirEsc}/g" $currentPath/javadoc.xml.template.tmp2 > $currentPath/javadoc.xml
-
-cat $currentPath/javadoc.xml
-echo "classpath=" $classpath
-
-# Executes the ant script
-ant -f $currentPath/javadoc.xml \
+# do replacements in template
+if [ $debug -gt 1 ]; then echo "[antJd] Replace @packagesets@ in the template ..."; fi
+packagesets=`echo $packagesets | sed -e 's/\//\\\\\\//g' | sed -e 's/\./\\\\\./g'`;
+sed -e "s/\@packagesets\@/${packagesets}/g" $antScript.template.tmp > $antScript.template.tmp2;
+
+if [ $debug -gt 1 ]; then echo "[antJd] Replace @copydocfiles@ in the template ..."; fi
+copydocfiles=`echo $copydocfiles | sed -e 's/\//\\\\\\//g' | sed -e 's/\./\\\\\./g'`;
+sed -e "s/\@copydocfiles\@/${copydocfiles}/g" $antScript.template.tmp2 > $antScript;
+
+#run ant to do javadoc build
+ant -f $antScript \
-DdestDir="$destDir" \
-Dclasspath="$classpath" \
-DeclipseDir="$eclipseDir" \
- -Doverview="$currentPath/overview.html"
+ -Ddocjar="$docjar" \
+ -DwindowTitle="$windowTitle" \
+ -DgroupTitle="$groupTitle" \
+ -Doverview="$currentPath/overview.html";
# Clean up templates
-rm -f $currentPath/javadoc.xml.template.tmp $currentPath/javadoc.xml.template.tmp2 $currentPath/javadoc.xml
+rm -f $antScript $antScript.template.tmp $antScript.template.tmp2;
diff --git a/doc/org.eclipse.jet.doc/build/javadoc.xml.template b/doc/org.eclipse.jet.doc/build/javadoc.xml.template
index a6e08ce..e90d31a 100644
--- a/doc/org.eclipse.jet.doc/build/javadoc.xml.template
+++ b/doc/org.eclipse.jet.doc/build/javadoc.xml.template
@@ -3,7 +3,13 @@
<property name="destDir" value="doc"/>
<property name="classpath" value="bin"/>
<property name="overview" value="build/overview.html"/>
- <property name="eclipseDir" value="@eclipseDir@"/>
+ <property name="eclipseDir" value="."/>
+ <property name="docjar" value="org.eclipse.platform.doc.isv.jar"/>
+
+ <!-- other properties that must be passed to this script include:
+ windowTitle
+ groupTitle
+ -->
<property environment="env"/>
<property name="javaHome" value="${env.JAVA_HOME}"/>
@@ -32,8 +38,8 @@
classpath="${classpath}"
overview="${overview}"
- windowtitle="EMF JET Javadoc"
- footer="Copyright 2002, 2006 IBM Corporation and others.&lt;br&gt; All Rights Reserved."
+ windowtitle="${windowTitle}"
+ footer="Copyright 2006 IBM Corporation and others.&lt;br&gt; All Rights Reserved."
access="protected"
additionalparam="-breakiterator -tag model:X -tag generated:X -tag ordered:X"
@@ -50,7 +56,7 @@
splitindex="true"
use="true"
version="true">
- <arg value="-J-Xmx1024m"/>
+ <arg value="-J-Xmx180m"/>
<link offline="true" href="http://java.sun.com/j2se/1.4/docs/api/" packagelistLoc="${javaHome}/docs/api/"/>
<!-- TODO Enable link to platform documentation -->
@@ -66,7 +72,7 @@
<!-- If you add a @ plugin @ below, don't forget to update the antjavadoc.sh file -->
- <group title="JET" packages="@plugin@"/>
+ <group title="${groupTitle}" packages="@plugin@"/>
<!-- If you add a @ plugin @ above, don't forget to update the antjavadoc.sh file -->