/
build.xml
138 lines (116 loc) · 5.16 KB
/
build.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
137
138
<?xml version="1.0"?>
<project name="proxy-doclet" default="all" basedir=".">
<property name="main.src" value="src"/>
<property name="main.bsrc" value="build/src"/>
<property name="main.make" value="build/main"/>
<property name="main.dst" value="dist"/>
<property name="test.src" value="test"/>
<property name="test.make" value="build/test"/>
<property name="test.dst" value="run"/>
<property name="doc.src" value="doc"/>
<property name="doc.dst" value="site"/>
<property name="doc.api" value="site/api"/>
<property name="tmp" value="tmp"/>
<property name="lib" value="lib"/>
<path id="lib.path">
<fileset dir="${lib}" includes="**/*.jar"/>
</path>
<property name="doclet.package" value="proxy/doclets"/>
<condition property="doclet.orig" value="src.orig/openjdk-6-src-b16-24_apr_2009/">
<equals arg1="${ant.java.version}" arg2="1.6"/></condition>
<condition property="doclet.orig" value="src.orig/openjdk-7-ea-src-b65-16_jul_2009/">
<equals arg1="${ant.java.version}" arg2="1.7"/></condition>
<basename property="doclet.base" file="${doclet.orig}"/>
<dirname property="doclet.dir" file="${doclet.orig}"/>
<property name="doclet.home" value="${main.bsrc}/${doclet.package}"/>
<!--<echoproperties/>-->
<!-- =================================================================== -->
<!-- Miscellaneous -->
<!-- =================================================================== -->
<target name="dist" depends="clean-all, all" description="clean-build everything"/>
<target name="all" depends="package, doc" description="build everything"/>
<target name="clean-all" depends="clean, clean-doc" description="clean all build products"/>
<!-- =================================================================== -->
<!-- Standard build -->
<!-- =================================================================== -->
<target name="init">
<mkdir dir="${main.make}"/>
<mkdir dir="${main.bsrc}"/>
<mkdir dir="${main.dst}"/>
</target>
<target name="check-src">
<uptodate property="doclet.skip" targetfile="${doclet.home}/src.properties">
<srcfiles dir="${doclet.orig}/com/sun/tools/doclets/" id="doclet.src">
<include name="formats/**/*"/>
<include name="standard/**/*"/>
<include name="internal/toolkit/AbstractDoclet.java"/>
</srcfiles>
<srcfiles file="proxy-doclet.diff"/>
</uptodate>
</target>
<target name="build-src" depends="init, check-src" description="build the source code for the entire package" unless="${doclet.skip}">
<delete dir="${doclet.home}"/>
<mkdir dir="${doclet.home}"/>
<copy todir="${doclet.home}"><fileset refid="doclet.src"/></copy>
<patch dir="${doclet.home}" patchfile="proxy-doclet.diff" strip="0" />
<replace dir="${doclet.home}" summary="true">
<replacefilter token="com.sun.tools.doclets.formats" value="proxy.doclets.formats"/>
<replacefilter token="com.sun.tools.doclets.standard" value="proxy.doclets.standard"/>
<replacefilter token="proxy.doclets.formats.html.resources.standard" value="com.sun.tools.doclets.formats.html.resources.standard"/>
</replace>
<tstamp><format property="doclet.tstamp" pattern="yyyy-MM-dd HH:mm:ssZ"/></tstamp>
<echo file="${doclet.home}/src.properties"># Source automatically generated from ${doclet.orig}
# by ${ant.project.name}.build-src on ${doclet.tstamp}
path=${doclet.orig}
base=${doclet.base}
dir=${doclet.dir}
</echo>
</target>
<target name="build" depends="build-src">
<tstamp/>
<javac destdir="${main.make}" debug="on" optimize="on">
<src path="${main.bsrc}"/>
<src path="${main.src}"/>
<classpath>
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</classpath>
<include name="**/*.java"/>
</javac>
</target>
<target name="package" depends="build">
<jar jarfile="${main.dst}/proxy-doclet+${doclet.base}.jar" duplicate="fail">
<fileset dir="${main.make}"/>
<fileset dir="${main.bsrc}/" casesensitive="no">
<include name="**/*.properties"/>
</fileset>
<zipgroupfileset dir="${lib}" includes="**/*.jar"/>
</jar>
</target>
<target name="clean">
<delete dir="${main.make}"/>
<delete dir="${main.bsrc}"/>
<delete dir="${main.dst}"/>
</target>
<!-- =================================================================== -->
<!-- Documentation -->
<!-- =================================================================== -->
<target name="init-doc">
<mkdir dir="${doc.api}"/>
</target>
<target name="javadoc" depends="init-doc, package">
<javadoc classpathref="lib.path" sourcepath="${main.src}" destdir="${doc.api}" use="true">
<doclet name="proxy.doclets.standard.Standard" path="${main.dst}/proxy-doclet+${doclet.base}.jar"/>
<arg value="-J-Dproxy.adapters.markup=${proxy.adapters.markup}"/>
<fileset dir="${main.src}" includes="**/*.java" />
<link href="http://java.sun.com/j2se/1.5.0/docs/api"/>
</javadoc>
</target>
<target name="doc" depends="javadoc" description="build documentation">
<!-- currently, no other documentation apart from javadocs -->
</target>
<target name="clean-doc">
<delete dir="${doc.api}"/>
</target>
</project>