Ant target for apiDocs building

This commit is contained in:
alena 2011-06-07 11:16:11 -07:00
parent 416efeb59a
commit 27d6020569
3 changed files with 85 additions and 0 deletions

View File

@ -70,12 +70,14 @@
<property name="client.target.dir" location="${target.dir}/ui" /> <property name="client.target.dir" location="${target.dir}/ui" />
<property name="ui.user.dir" location="${base.dir}/ui" /> <property name="ui.user.dir" location="${base.dir}/ui" />
<property name="setup.db.dir" location="${base.dir}/setup/db" /> <property name="setup.db.dir" location="${base.dir}/setup/db" />
<property name="setup.apidoc.dir" location="${base.dir}/setup/apidoc" />
<!-- directories for server compilation--> <!-- directories for server compilation-->
<property name="server.dir" location="${base.dir}/server" /> <property name="server.dir" location="${base.dir}/server" />
<property name="server.test.dir" location="${server.dir}/test" /> <property name="server.test.dir" location="${server.dir}/test" />
<property name="server.dist.dir" location="${dist.dir}/client" /> <property name="server.dist.dir" location="${dist.dir}/client" />
<property name="db.scripts.dir" location="${target.dir}/db"/> <property name="db.scripts.dir" location="${target.dir}/db"/>
<property name="apidoc.scripts.dir" location="${target.dir}/apidoc"/>
<!-- directories for core code compilation--> <!-- directories for core code compilation-->
<property name="core.dir" location="${base.dir}/core" /> <property name="core.dir" location="${base.dir}/core" />
@ -304,7 +306,19 @@
<filter token="VERSION" value="${impl.version}"/> <filter token="VERSION" value="${impl.version}"/>
</filterset> </filterset>
</copy> </copy>
<copy overwrite="true" todir="${apidoc.scripts.dir}">
<fileset dir="${setup.apidoc.dir}">
<include name="**/*"/>
</fileset>
<filterset>
<filter token="VERSION" value="${impl.version}"/>
</filterset>
</copy>
</target> </target>
<path id="console-common.classpath"> <path id="console-common.classpath">
<path refid="deps.classpath" /> <path refid="deps.classpath" />

View File

@ -20,6 +20,9 @@
<property name="unittest.dir" location="${base.dir}/unittest"/> <property name="unittest.dir" location="${base.dir}/unittest"/>
<property name="unittest.target.dir" location="${unittest.dir}/classes"/> <property name="unittest.target.dir" location="${unittest.dir}/classes"/>
<property name="unittest.jar.dir" location="${unittest.dir}/jar"/> <property name="unittest.jar.dir" location="${unittest.dir}/jar"/>
<!-- directories for api doc -->
<property name="api.docs.dir" location="${dist.dir}/apidocs" />
<condition property="jmxport" value="${jmxport.override}" else="45219"> <condition property="jmxport" value="${jmxport.override}" else="45219">
<isset property="jmxport.override" /> <isset property="jmxport.override" />
@ -338,5 +341,26 @@
</junitreport> </junitreport>
<fail if="junit.failure" message="Unit test(s) failed. See reports!"/> <fail if="junit.failure" message="Unit test(s) failed. See reports!"/>
</target> </target>
<target name="build-apidocs" description="Generate api documentation">
<property name="commands.file" location="${tomcat.home}/conf/commands.properties" />
<property name="commands.ext.file" location="${tomcat.home}/conf/commands-ext.properties" />
<echo message="build-apidocs" />
<exec dir="${apidoc.scripts.dir}" executable="bash">
<arg value="build-apidoc.sh" />
<arg value="-f ${commands.file},${commands.ext.file}" />
<arg value="-d ${dist.dir}" />
<env key="CATALINA_HOME" value="${tomcat.home}"/>
</exec>
<chmod perm="666">
<fileset dir="${apidoc.scripts.dir}">
<include name="**/*"/>
</fileset>
</chmod>
</target>
</project> </project>

View File

@ -0,0 +1,47 @@
#!/usr/bin/env bash
#
# Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
#
# This software is licensed under the GNU General Public License v3 or later.
#
# It is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# cloud-build-api-doc.sh -- builds api documentation.
#
#set -x
PATHSEP=':'
if [[ $OSTYPE == "cygwin" ]] ; then
PATHSEP=';'
fi
CP=$PATHSEP/
CP=${CP}$PATHSEP$CATALINA_HOME/conf
for file in $CATALINA_HOME/webapps/client/WEB-INF/lib/*.jar
do
CP=${CP}$PATHSEP$file
done
for file in $CATALINA_HOME/lib/*.jar; do
CP=${CP}$PATHSEP$file
done
java -cp $CP com.cloud.api.doc.ApiXmlDocWriter $*
if [ $? -ne 0 ]
then
exit 1
fi