blob: a77ed181b2b076c849a9fff61ec807ebec528421 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<project name="Jdt Doc Isv Build" default="all" basedir="." >
<property file="${basedir.properties}"/>
<target name="init">
<available file="${basedir}/index" property="index.present"/>
</target>
<target name="all" depends="init" unless="index.present">
<antcall target="convertSchemaToHtml" />
<antcall target="generateJavadoc" />
<antcall target="build.index" />
<!--antcall target="createDocZip" /-->
</target>
<target name="build.index" description="Builds search index for the plug-in: org.eclipse.jdt.doc.isv" if="eclipse.running">
<help.buildHelpIndex manifest="${basedir}/plugin.xml" destination="${basedir}"/>
</target>
<target name="convertSchemaToHtml" if="eclipse.running">
<property name="dest" value="reference/extension-points" />
<record name="${basedir}/jdtconvert.txt" action="start"/>
<property name="jdtSearchPath" value="${eclipse.jdt.core},${eclipse.jdt.debug},${eclipse.jdt.ui}" />
<property name="platformSearchPath" value="${eclipse.platform.ant},${eclipse.platform.debug},${eclipse.platform.platform},${eclipse.platform.resources.bundles},${eclipse.platform.runtime.bundles},${eclipse.platform.swt.bundles},${eclipse.platform.team.bundles},${eclipse.platform.text},${eclipse.platform.ua},${eclipse.platform.ui.bundles}" />
<property name="runtimeSearchPath" value="${rt.equinox.bundles.bundles},${rt.equinox.framework.bundles},${rt.equinox.p2.bundles}" />
<property name="searchPaths" value="${jdtSearchPath},${platformSearchPath},${runtimeSearchPath}" />
<pde.convertSchemaToHTML manifest="${eclipse.jdt.core}/org.eclipse.jdt.apt.core/plugin.xml" destination="${dest}" additionalsearchpaths="${searchPaths}" />
<pde.convertSchemaToHTML manifest="${eclipse.jdt.core}/org.eclipse.jdt.core/plugin.xml" destination="${dest}" additionalsearchpaths="${searchPaths}" />
<pde.convertSchemaToHTML manifest="${eclipse.jdt.ui}/org.eclipse.jdt.core.manipulation/plugin.xml" destination="${dest}" additionalsearchpaths="${searchPaths}" />
<pde.convertSchemaToHTML manifest="${eclipse.jdt.debug}/org.eclipse.jdt.debug/plugin.xml" destination="${dest}" additionalsearchpaths="${searchPaths}" />
<pde.convertSchemaToHTML manifest="${eclipse.jdt.debug}/org.eclipse.jdt.debug.ui/plugin.xml" destination="${dest}" additionalsearchpaths="${searchPaths}" />
<pde.convertSchemaToHTML manifest="${eclipse.jdt.ui}/org.eclipse.jdt.junit/plugin.xml" destination="${dest}" additionalsearchpaths="${searchPaths}" />
<pde.convertSchemaToHTML manifest="${eclipse.jdt.ui}/org.eclipse.jdt.junit.core/plugin.xml" destination="${dest}" additionalsearchpaths="${searchPaths}" />
<pde.convertSchemaToHTML manifest="${eclipse.jdt.debug}/org.eclipse.jdt.launching/plugin.xml" destination="${dest}" additionalsearchpaths="${searchPaths}" />
<pde.convertSchemaToHTML manifest="${eclipse.jdt.ui}/org.eclipse.jdt.ui/plugin.xml" destination="${dest}" additionalsearchpaths="${searchPaths}" />
<record name="${basedir}/jdtconvert.txt" action="stop"/>
</target>
<target name="getJavadocPath">
<echoproperties />
<condition property="javadoc" value="${eclipse.javadoc}">
<isset property="eclipse.javadoc"/>
</condition>
<condition property="javadoc" value="${eclipse.javadoc8}">
<isset property="eclipse.javadoc8"/>
</condition>
<available file="${java.home}/../bin/javadoc.exe" property="javadoc" value="${java.home}/../bin/javadoc.exe"/>
<available file="${java.home}/../bin/javadoc" property="javadoc" value="${java.home}/../bin/javadoc" />
</target>
<target name="generateJavadoc" depends="getJavadocPath" if="javadoc">
<!-- HACK to ensure the Platform Doc is built before JDT - call to this script should be moved to build.jars target -->
<!-- NOTE: This works with PDE Build but not with CBI (Maven/Tycho), see https://bugs.eclipse.org/415115 for details. -->
<available file="../org.eclipse.platform.doc.isv/index" property="platform.index.present"/>
<antcall target="buildPlatformDoc" />
<!-- replace "\n;" with platform-dependent list entry delimiter -->
<property name="optionsFile" value="jdtOptions.tmp.txt" />
<copy file="jdtOptions.txt" tofile="${optionsFile}" overwrite="true">
<filterchain>
<expandproperties/>
</filterchain>
</copy>
<condition property="argsListDelimiter" value=":">
<os family="unix" />
</condition>
<condition property="argsListDelimiter" value=";">
<os family="windows" />
</condition>
<replaceregexp file="${basedir}/${optionsFile}" flags="g" match="(\r\n?|\n);" replace="${argsListDelimiter}" />
<replace file="${basedir}/${optionsFile}" token="@rt@" value="${bootclasspath}" />
<replace file="${basedir}/${optionsFile}" token="@baseLocation@" value="${baseLocation}" />
<!-- expand _* to actual version -->
<!-- prepare ${replaceFile} with all files and folders from workspace -->
<fileset dir="${basedir}/${dependency.dir}" id="fileSet">
<include name="*"/>
</fileset>
<dirset dir="${basedir}/${dependency.dir}" id="dirSet">
<include name="*"/>
</dirset>
<pathconvert property="fileList" refid="fileSet" dirsep="/" pathsep="&#xA;"/>
<pathconvert property="dirList" refid="dirSet" dirsep="/" pathsep="&#xA;"/>
<property name="replaceFile" value="platformOptions.replace.txt" />
<echo file="${basedir}/${replaceFile}">${fileList}&#xA;&#xA;${dirList}&#xA;&#xA;</echo>
<echo>org.eclipse.jdt.doc.isv/buildDoc.xml - generateJavadoc:
${basedir}/${replaceFile} before _* expansion:</echo>
<concat><filelist files="${basedir}/${replaceFile}"></filelist></concat>
<!-- strip away leading path -->
<replaceregexp file="${basedir}/${replaceFile}" flags="g" match="(?m)^.*/([^/]*)$$" replace="\1" />
<!-- remove lines without version pattern "[_-]\d+\.\d+\.\d+"; version pattern is a workaround for bug 402392 -->
<replaceregexp file="${basedir}/${replaceFile}" flags="g" match="(?m)^(.*[-_]\d+\.\d+\.\d+.*)|(.*)$$" replace="\1" />
<!-- create "<aa>_*[.jar]=<aa><version>[.jar]" property for lines with a version -->
<replaceregexp file="${basedir}/${replaceFile}" flags="g" match="(?m)^(.*)[-_]\d+\.\d+\.\d+.*?(.jar)?$$" replace="\1_*\2=\0" />
<echo>${basedir}/${replaceFile} after _* expansion:</echo>
<concat><filelist files="${basedir}/${replaceFile}"></filelist></concat>
<!-- workaround for bug 402392, which can make the ${replaceFile} end up empty: -->
<echo file="${basedir}/${replaceFile}" append="true">dummyForBug402392=dummyForBug402392&#xA;</echo>
<replace file="${basedir}/${optionsFile}" replacefilterfile="${basedir}/${replaceFile}"/>
<echo>${basedir}/${optionsFile} after _* expansion:</echo>
<concat><filelist files="${basedir}/${optionsFile}"></filelist></concat>
<!--scrub isv plugin directories of any preexisting api doc content-->
<delete dir="reference/api"/>
<mkdir dir="reference/api"/>
<exec dir="." executable="${javadoc}" output="doc.bin.log">
<arg line="@${basedir}/${optionsFile} -J-Xmx500M" />
</exec>
<!--workaround for bug 409511, bug 101048-->
<replace dir="reference/api" token="='/../misc/api-usage-rules.html" value="='./../misc/api-usage-rules.html">
<include name="*.htm*" />
</replace>
</target>
<target name="buildPlatformDoc" unless="platform.index.present">
<ant antfile="buildDoc.xml" dir="../org.eclipse.platform.doc.isv" />
</target>
<target name="createDocZip">
<zip zipfile="${basedir}/doc.zip"
basedir="${basedir}"
includes="book.css, cpy.png, notices.html, about.html, no_help_exists.htm, concepts/**, gettingStarted/**, images/**, reference/**, tasks/**,samples/**,guide/**,questions/**"
/>
</target>
</project>