blob: 8bd05b64377c196244545bae0361e584e24928ea [file] [log] [blame]
<project name="doc" default="all" basedir="." xmlns:if="ant:if">
<property name="gwt.root" location=".." />
<property name="project.tail" value="doc" />
<import file="${gwt.root}/common.ant.xml" />
<property.ensure name="java.tools.path" location="${java.home}/../lib/tools.jar" unless="build.host.ismac" message="Cannot find ${java.home}/../lib/tools.jar; please use a JDK when building doc rather than a JRE." />
<property.ensure name="gwt.user.jar" location="${gwt.build.lib}/gwt-user.jar" />
<!-- Platform shouldn't matter here, just picking one -->
<property.ensure name="gwt.dev.jar" location="${gwt.build.lib}/gwt-dev.jar" />
<!--
*** Note that if the USER_SOURCE_PATH paths are updated,
the fileset dependencies in the outofdate tags in the
javadoc target must be updated as well.
-->
<path id="USER_SOURCE_PATH">
<pathelement location="${gwt.root}/user/src" />
<pathelement location="${gwt.root}/user/javadoc" />
<pathelement location="${gwt.root}/user/super" />
<pathelement location="${gwt.root}/dev/core/src" />
<pathelement location="${gwt.root}/dev/core/super" />
</path>
<path id="USER_CLASS_PATH">
<pathelement location="${gwt.dev.jar}" />
<pathelement location="${gwt.user.jar}" />
<pathelement location="${gwt.tools.lib}/junit/junit-4.8.2.jar" />
<pathelement location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA.jar" />
<pathelement location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA-sources.jar" />
<pathelement location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
</path>
<path id="DOC_PATH">
<pathelement location="./src" />
<pathelement location="${gwt.build.lib}/gwt-doctool.jar" />
<path path="${java.tools.path}" />
<path refid="USER_SOURCE_PATH" />
</path>
<!-- Rebuild the javadoc if a source file is newer than the index-->
<target name="javadoc">
<outofdate>
<sourcefiles>
<fileset file="./src/gwt-user.html" />
<fileset dir="${gwt.root}/user/src">
<include name="**/*.java" />
</fileset>
<fileset dir="${gwt.root}/user/javadoc">
<include name="**/*.java" />
</fileset>
<fileset dir="${gwt.root}/user/super">
<include name="**/*.java" />
</fileset>
<fileset dir="${gwt.root}/dev/core/src">
<include name="**/*.java" />
</fileset>
<fileset dir="${gwt.root}/dev/core/super">
<include name="**/*.java" />
</fileset>
</sourcefiles>
<targetfiles>
<!--
only checks one output file, will not rebuild other
files if this one is up to date
-->
<pathelement path="${project.build}/javadoc/index.html" />
</targetfiles>
<sequential>
<echo>Building javadoc</echo>
<antcall target="makeJavadoc" />
</sequential>
</outofdate>
</target>
<!-- Really rebuild the javadoc -->
<target name="makeJavadoc">
<java classpathref="DOC_PATH" classname="com.google.doctool.custom.FindPackages" fork="yes" failonerror="true">
<arg value="${gwt.root}" />
</java>
<property file="${gwt.root}/build/out/packages.properties" />
<java classpathref="DOC_PATH" classname="com.google.doctool.custom.GWTJavaDoclet" fork="yes" failonerror="true">
<jvmarg value="-Xmx1024m" />
<arg value="-Xdoclint:none" if:true="${isJava8}" />
<arg value="-noindex" />
<arg value="-notree" />
<arg value="-quiet" />
<arg value="-notimestamp" />
<arg value="-use" />
<arg value="-source" />
<arg value="${javac.source}" />
<arg value="-windowtitle" />
<arg value="GWT Javadoc" />
<arg value="-doctitle" />
<arg value="GWT API Reference" />
<arg value="-header" />
<arg value="GWT ${gwt.version}" />
<arg value="-package" />
<arg value="-encoding"/>
<arg value="UTF-8"/>
<arg value="-d" />
<arg value="${project.build}/javadoc" />
<arg value="-linkoffline" />
<arg value="http://download.oracle.com/javaee/6/api/" />
<arg value="validation-package-list" />
<arg value="-classpath" />
<arg pathref="USER_CLASS_PATH" />
<arg value="-sourcepath" />
<arg pathref="USER_SOURCE_PATH" />
<arg value="-examplepackages" />
<arg value="com.google.gwt.examples;com.google.gwt.examples.i18n;com.google.gwt.examples.http.client;com.google.gwt.examples.rpc.server;com.google.gwt.examples.benchmarks;com.google.gwt.examples.cell;com.google.gwt.examples.cellview;com.google.gwt.examples.view;com.google.gwt.examples.cellview;com.google.gwt.examples.dom.builder" />
<arg value="-packages" />
<arg value="${USER_PKGS};${USER_CLASSES}" />
</java>
</target>
<target name="emul-ezt">
<outofdate>
<sourcefiles>
<fileset dir="${gwt.root}/user/super/com/google/gwt/emul">
<include name="**/*.java" />
</fileset>
</sourcefiles>
<targetfiles>
<pathelement path="${project.build}/emul-ezt/fragment.html" />
</targetfiles>
<sequential>
<echo>Building JRE emulation EZT</echo>
<java classpathref="DOC_PATH" classname="com.google.doctool.custom.FindPackages" fork="yes" failonerror="true">
<arg value="${gwt.root}" />
</java>
<property file="${gwt.root}/build/out/packages.properties" />
<java classpathref="DOC_PATH" classname="com.google.doctool.JreDocTool" fork="yes" failonerror="true">
<arg value="-out" />
<arg value="${project.build}/emul-ezt/fragment.html" />
<arg value="-classpath" />
<arg pathref="USER_CLASS_PATH" />
<arg value="-sourcepath" />
<arg path="${gwt.root}/user/super/com/google/gwt/emul:${gwt.root}/dev/core/super/com/google/gwt/dev/jjs/intrinsic" />
<arg value="-packages" />
<arg value="${JAVA_PKGS}" />
</java>
</sequential>
</outofdate>
</target>
<target name="build" depends="javadoc, emul-ezt" />
</project>