/
buildDoc.xml
136 lines (102 loc) · 5.9 KB
/
buildDoc.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?xml version="1.0" encoding="UTF-8"?>
<project name="Jdt Doc Isv Build" default="all" basedir="." >
<property file="${basedir.properties}"/>
<target name="init">
<property environment="env" />
<echo message="env.JAVA_DOC_PROXIES: ${env.JAVA_DOC_PROXIES}" />
<available file="${basedir}/index" property="index.present"/>
</target>
<target name="all" depends="init" unless="index.present">
<antcall target="generateJavadoc" />
</target>
<target name="getJavadocPath" depends="getEclipseJavadocPath" unless="javadocExecutable">
<!-- WARNING: Ant bug: The <available> task overrides an already set property! https://bugs.eclipse.org/431236#c12 -->
<available file="${java.home}/../bin/javadoc.exe" property="javadocExecutable" value="${java.home}/../bin/javadoc.exe"/>
<available file="${java.home}/../bin/javadoc" property="javadocExecutable" value="${java.home}/../bin/javadoc" />
<available file="${java.home}/bin/javadoc.exe" property="javadocExecutable" value="${java.home}/bin/javadoc.exe"/>
<available file="${java.home}/bin/javadoc" property="javadocExecutable" value="${java.home}/bin/javadoc" />
</target>
<target name="getEclipseJavadocPath" unless="javadocExecutable">
<!-- Use custom javadoc executable if ${eclipse.javadoc} is set -->
<condition property="javadocExecutable" value="${eclipse.javadoc}">
<and>
<isset property="eclipse.javadoc"/>
<available file="${eclipse.javadoc}" />
</and>
</condition>
</target>
<target name="generateJavadoc" depends="getJavadocPath" if="javadocExecutable">
<!-- 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="target/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="
"/>
<pathconvert property="dirList" refid="dirSet" dirsep="/" pathsep="
"/>
<property name="replaceFile" value="target/jdtOptions.replace.txt" />
<echo file="${basedir}/${replaceFile}">${fileList}

${dirList}

</echo>
<echo>org.eclipse.jdt.doc.isv/buildDoc.xml - generateJavadoc:</echo>
<echo>Using java home: ${java.home} and javadocExecutable: ${javadocExecutable}</echo>
<echo>${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_*\3=\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
</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"/>
<!-- if not pass in from environment, set this value to empty -->
<property name="env.JAVA_DOC_PROXIES" value=""/>
<exec dir="." executable="${javadocExecutable}" output="target/doc.bin.log" timeout="600000">
<arg line="@${basedir}/${optionsFile} -J-Xmx1000M ${env.JAVA_DOC_PROXIES}" />
</exec>
<echo>target/doc.bin.log after javadoc execution</echo>
<concat><filelist files="${basedir}/target/doc.bin.log"></filelist></concat>
<!--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>