author | David Powell <david.e.powell@oracle.com> |
Thu, 11 Aug 2011 15:41:42 -0700 | |
changeset 764 | ebb25c1dac73 |
parent 748 | abe2cd8b419a |
child 797 | a33daeba9b4c |
permissions | -rw-r--r-- |
0 | 1 |
<?xml version="1.0"?> |
2 |
<!-- |
|
3 |
CDDL HEADER START |
|
4 |
||
5 |
The contents of this file are subject to the terms of the |
|
6 |
Common Development and Distribution License (the "License"). |
|
7 |
You may not use this file except in compliance with the License. |
|
8 |
||
9 |
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
10 |
or http://www.opensolaris.org/os/licensing. |
|
11 |
See the License for the specific language governing permissions |
|
12 |
and limitations under the License. |
|
13 |
||
14 |
When distributing Covered Code, include this CDDL HEADER in each |
|
15 |
file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
16 |
If applicable, add the following below this CDDL HEADER, with the |
|
17 |
fields enclosed by brackets "[]" replaced with your own identifying |
|
18 |
information: Portions Copyright [yyyy] [name of copyright owner] |
|
19 |
||
20 |
CDDL HEADER END |
|
21 |
||
652
4f41b7727e42
17867 enforce optional type restrictions
David Powell <david.e.powell@oracle.com>
parents:
594
diff
changeset
|
22 |
Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. |
0 | 23 |
--> |
24 |
||
25 |
<project name="commondef"> |
|
26 |
<import file="env-common.xml"/> |
|
27 |
||
28 |
<!-- |
|
29 |
Projects can redefine these paths to set the classpath for |
|
30 |
javac, javadoc (uses classpath.javac), and jar tasks. |
|
31 |
--> |
|
32 |
<path id="classpath.javac" /> |
|
33 |
<path id="classpath.jar" refid="classpath.javac" /> |
|
34 |
||
748
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
35 |
<presetdef name="copy.remove.cddl"> |
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
36 |
<copy> |
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
37 |
<filterchain> |
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
38 |
<filterreader |
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
39 |
classname="com.oracle.solaris.util.ant.RemoveCDDLFilterReader"> |
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
40 |
|
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
41 |
<classpath> |
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
42 |
<pathelement |
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
43 |
path="${ws.java}/ant/ant.jar"/> |
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
44 |
</classpath> |
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
45 |
</filterreader> |
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
46 |
</filterchain> |
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
47 |
</copy> |
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
48 |
</presetdef> |
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
49 |
|
0 | 50 |
<!-- |
51 |
Generic copy/filter-based file generation task. |
|
52 |
--> |
|
53 |
<macrodef name="generate.filter"> |
|
54 |
<attribute name="pattern" /> |
|
55 |
<attribute name="fromdir" default="." /> |
|
56 |
<attribute name="from" /> |
|
57 |
<attribute name="to" /> |
|
58 |
<element name="filters" implicit="yes" /> |
|
59 |
<sequential> |
|
60 |
<copy todir="${proj.gen}"> |
|
61 |
<globmapper from="@{from}" to="@{to}" /> |
|
62 |
<fileset dir="@{fromdir}" |
|
63 |
includes="@{pattern}" /> |
|
64 |
<filterset begintoken="<" endtoken=">"> |
|
65 |
<filters /> |
|
66 |
</filterset> |
|
67 |
</copy> |
|
68 |
</sequential> |
|
69 |
</macrodef> |
|
70 |
||
391 | 71 |
<macrodef name="generate.adr"> |
72 |
<attribute name="api" /> |
|
73 |
<sequential> |
|
764
ebb25c1dac73
18812 Support building with alternate java implementations
David Powell <david.e.powell@oracle.com>
parents:
748
diff
changeset
|
74 |
<java fork="yes" classpath="${ws.java}/adr/adr.jar" |
ebb25c1dac73
18812 Support building with alternate java implementations
David Powell <david.e.powell@oracle.com>
parents:
748
diff
changeset
|
75 |
classname="org.opensolaris.os.adr.adrgen.ADRGen"> |
391 | 76 |
<arg value="-j" /> |
77 |
<arg value="${proj.gen}" /> |
|
78 |
<arg value="${ws.apis}/@{api}" /> |
|
764
ebb25c1dac73
18812 Support building with alternate java implementations
David Powell <david.e.powell@oracle.com>
parents:
748
diff
changeset
|
79 |
</java> |
391 | 80 |
</sequential> |
81 |
</macrodef> |
|
82 |
||
652
4f41b7727e42
17867 enforce optional type restrictions
David Powell <david.e.powell@oracle.com>
parents:
594
diff
changeset
|
83 |
<macrodef name="generate.adropt"> |
4f41b7727e42
17867 enforce optional type restrictions
David Powell <david.e.powell@oracle.com>
parents:
594
diff
changeset
|
84 |
<attribute name="api" /> |
4f41b7727e42
17867 enforce optional type restrictions
David Powell <david.e.powell@oracle.com>
parents:
594
diff
changeset
|
85 |
<sequential> |
764
ebb25c1dac73
18812 Support building with alternate java implementations
David Powell <david.e.powell@oracle.com>
parents:
748
diff
changeset
|
86 |
<java fork="yes" classpath="${ws.java}/adr/adr.jar" |
ebb25c1dac73
18812 Support building with alternate java implementations
David Powell <david.e.powell@oracle.com>
parents:
748
diff
changeset
|
87 |
classname="org.opensolaris.os.adr.adrgen.ADRGen"> |
652
4f41b7727e42
17867 enforce optional type restrictions
David Powell <david.e.powell@oracle.com>
parents:
594
diff
changeset
|
88 |
<arg value="-N" /> |
4f41b7727e42
17867 enforce optional type restrictions
David Powell <david.e.powell@oracle.com>
parents:
594
diff
changeset
|
89 |
<arg value="-j" /> |
4f41b7727e42
17867 enforce optional type restrictions
David Powell <david.e.powell@oracle.com>
parents:
594
diff
changeset
|
90 |
<arg value="${proj.gen}" /> |
4f41b7727e42
17867 enforce optional type restrictions
David Powell <david.e.powell@oracle.com>
parents:
594
diff
changeset
|
91 |
<arg value="${ws.apis}/@{api}" /> |
764
ebb25c1dac73
18812 Support building with alternate java implementations
David Powell <david.e.powell@oracle.com>
parents:
748
diff
changeset
|
92 |
</java> |
652
4f41b7727e42
17867 enforce optional type restrictions
David Powell <david.e.powell@oracle.com>
parents:
594
diff
changeset
|
93 |
</sequential> |
4f41b7727e42
17867 enforce optional type restrictions
David Powell <david.e.powell@oracle.com>
parents:
594
diff
changeset
|
94 |
</macrodef> |
4f41b7727e42
17867 enforce optional type restrictions
David Powell <david.e.powell@oracle.com>
parents:
594
diff
changeset
|
95 |
|
391 | 96 |
<macrodef name="generate.adrimpl"> |
97 |
<attribute name="api" /> |
|
98 |
<sequential> |
|
764
ebb25c1dac73
18812 Support building with alternate java implementations
David Powell <david.e.powell@oracle.com>
parents:
748
diff
changeset
|
99 |
<java fork="yes" classpath="${ws.java}/adr/adr.jar" |
ebb25c1dac73
18812 Support building with alternate java implementations
David Powell <david.e.powell@oracle.com>
parents:
748
diff
changeset
|
100 |
classname="org.opensolaris.os.adr.adrgen.ADRGen"> |
391 | 101 |
<arg value="-j" /> |
102 |
<arg value="${proj.gen}" /> |
|
103 |
<arg value="-i" /> |
|
104 |
<arg value="${ws.apis}/@{api}" /> |
|
764
ebb25c1dac73
18812 Support building with alternate java implementations
David Powell <david.e.powell@oracle.com>
parents:
748
diff
changeset
|
105 |
</java> |
391 | 106 |
</sequential> |
107 |
</macrodef> |
|
108 |
||
0 | 109 |
<target name="generate_project" /> |
110 |
<target name="generate" depends="generate_project"> |
|
111 |
<mkdir dir="${proj.gen}" /> |
|
112 |
</target> |
|
113 |
||
114 |
<target name="clean_project" /> |
|
115 |
<target name="clean" depends="clean_project"> |
|
116 |
<delete dir="${proj.build}" /> |
|
117 |
</target> |
|
118 |
||
119 |
<target name="clobber_project" /> |
|
120 |
<target name="clobber" depends="clean,clobber_project"> |
|
121 |
<delete file="${proj.jarfile}" /> |
|
122 |
</target> |
|
123 |
||
124 |
<!-- |
|
125 |
Default compile target body. |
|
126 |
--> |
|
127 |
<presetdef name="javac.default"> |
|
128 |
<javac includeAntRuntime="no" sourcepathref="proj.srcroots" |
|
391 | 129 |
destdir="${proj.classes}" debug="on" |
314
8decc90a3ec6
9416 more fully featured FMRI type (fix lint)
David Powell <David.Powell@sun.com>
parents:
284
diff
changeset
|
130 |
classpathref="classpath.javac"> |
748
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
131 |
<src> |
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
132 |
<dirset dir="."> |
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
133 |
<include name="com"/> |
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
134 |
<include name="org"/> |
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
135 |
</dirset> |
abe2cd8b419a
18737 remove cddl from binary product
Stephen Talley <stephen.talley@oracle.com>
parents:
699
diff
changeset
|
136 |
</src> |
391 | 137 |
<src location="build/gen" /> |
314
8decc90a3ec6
9416 more fully featured FMRI type (fix lint)
David Powell <David.Powell@sun.com>
parents:
284
diff
changeset
|
138 |
<compilerarg value="-Xlint" /> |
8decc90a3ec6
9416 more fully featured FMRI type (fix lint)
David Powell <David.Powell@sun.com>
parents:
284
diff
changeset
|
139 |
<compilerarg value="-Xlint:-serial" /> |
8decc90a3ec6
9416 more fully featured FMRI type (fix lint)
David Powell <David.Powell@sun.com>
parents:
284
diff
changeset
|
140 |
</javac> |
0 | 141 |
</presetdef> |
142 |
||
143 |
<target name="compile_project" /> |
|
144 |
<target name="compile" depends="generate,compile_project"> |
|
145 |
<mkdir dir="${proj.classes}" /> |
|
146 |
<javac.default /> |
|
147 |
</target> |
|
148 |
||
149 |
<!-- |
|
150 |
Default jar target body. |
|
151 |
--> |
|
152 |
<presetdef name="jar.default"> |
|
153 |
<jar destfile="${proj.jarfile}"> |
|
154 |
<fileset dir="${proj.classes}" /> |
|
155 |
<fileset dir="."> |
|
156 |
<patternset id="pattern.resources"> |
|
391 | 157 |
<!-- <include name="org/**/*.rng" /> --> |
158 |
<include name="org/**/*.xsd" /> |
|
699
34ec90cc612c
adrgen5 - documentation generator
devjani.ray@oracle.com <devjani.ray@oracle.com>
parents:
652
diff
changeset
|
159 |
<include name="org/**/*.xsl" /> |
0 | 160 |
<include name="org/**/*.properties" /> |
591
7c5752b99fd6
12473 panels should probably be run in a sandbox
Stephen Talley <stephen.talley@oracle.com>
parents:
391
diff
changeset
|
161 |
<include name="org/**/panel.policy" /> |
0 | 162 |
<include name="org/**/help/**" /> |
163 |
<include name="org/**/images/**" /> |
|
327
bb43a6fa6f0b
10096 time: new UI design and NTP support
Stephen Talley <stephen.talley@sun.com>
parents:
314
diff
changeset
|
164 |
<exclude name="org/**/images/**/*.xcf" /> |
0 | 165 |
</patternset> |
166 |
</fileset> |
|
167 |
<fileset dir="${proj.gen}"> |
|
168 |
<patternset refid="pattern.resources" /> |
|
169 |
</fileset> |
|
170 |
</jar> |
|
171 |
</presetdef> |
|
172 |
||
173 |
<!-- |
|
174 |
A pathmapper that maps from a classpath in build-space to |
|
175 |
install-space, mapping paths in the workspace to a single |
|
176 |
directory and leaving absolute paths alone. |
|
177 |
--> |
|
178 |
<macrodef name="map.targetjar"> |
|
179 |
<attribute name="targetdir" default="${abs.java}" /> |
|
180 |
<attribute name="pathsep" default=" " /> |
|
181 |
<attribute name="property" /> |
|
182 |
<attribute name="pathref" /> |
|
183 |
<sequential> |
|
184 |
<pathconvert pathsep="@{pathsep}" property="@{property}" |
|
185 |
refid="@{pathref}"> |
|
186 |
<filtermapper> |
|
187 |
<replaceregex pattern="^${ws.java}/.*/" |
|
188 |
replace="@{targetdir}/" /> |
|
189 |
</filtermapper> |
|
190 |
</pathconvert> |
|
191 |
</sequential> |
|
192 |
</macrodef> |
|
193 |
||
194 |
<!-- |
|
195 |
Alternate jar target body, used for creating executables. |
|
196 |
--> |
|
197 |
<macrodef name="jar.executable"> |
|
198 |
<attribute name="mainclass" /> |
|
199 |
<attribute name="targetdir" default="${abs.java}" /> |
|
200 |
<element name="jar-elements" implicit="yes" optional="yes"/> |
|
201 |
<sequential> |
|
202 |
<map.targetjar targetdir="@{targetdir}" |
|
203 |
property="jarclasspath" pathref="classpath.jar" /> |
|
204 |
<jar.default> |
|
205 |
<manifest> |
|
206 |
<attribute name="Main-Class" |
|
207 |
value="@{mainclass}" /> |
|
208 |
<attribute name="Class-Path" |
|
209 |
value="${jarclasspath}" /> |
|
210 |
</manifest> |
|
211 |
<jar-elements /> |
|
212 |
</jar.default> |
|
213 |
</sequential> |
|
214 |
</macrodef> |
|
215 |
||
216 |
<target name="jar" depends="compile"> |
|
217 |
<jar.default /> |
|
218 |
</target> |
|
219 |
||
220 |
<!-- |
|
221 |
Default javadoc target body. |
|
222 |
--> |
|
223 |
<presetdef name="javadoc.default"> |
|
224 |
<javadoc noqualifier="all" sourcepathref="proj.srcroots" |
|
225 |
destdir="${proj.javadoc}" classpathref="classpath.javac"> |
|
226 |
<packageset dir="." includes="org/" /> |
|
227 |
</javadoc> |
|
228 |
</presetdef> |
|
229 |
||
594
d1172c8862df
17314 need way to build without building javadoc, revisited
Stephen Talley <stephen.talley@oracle.com>
parents:
591
diff
changeset
|
230 |
<target name="javadoc" unless="env.ANT_SKIP_JAVADOC"> |
0 | 231 |
<javadoc.default /> |
232 |
</target> |
|
233 |
||
234 |
<!-- |
|
235 |
Default install target body. |
|
236 |
--> |
|
237 |
<macrodef name="install.default"> |
|
238 |
<attribute name="targetdir" default="${proto.java}" /> |
|
239 |
<sequential> |
|
240 |
<mkdir dir="@{targetdir}" /> |
|
241 |
<copy file="${proj.jarfile}" todir="@{targetdir}" /> |
|
242 |
</sequential> |
|
243 |
</macrodef> |
|
244 |
||
245 |
<!-- |
|
246 |
Optionally used by a project's install_project to install |
|
247 |
javadoc. Currently copies from build/javadoc; in the future |
|
248 |
it might make sense to build javadoc differently in, and |
|
249 |
directly into, each location. |
|
250 |
--> |
|
251 |
<macrodef name="install.javadoc"> |
|
252 |
<sequential> |
|
253 |
<copy todir="${proto.javadoc}"> |
|
594
d1172c8862df
17314 need way to build without building javadoc, revisited
Stephen Talley <stephen.talley@oracle.com>
parents:
591
diff
changeset
|
254 |
<fileset dir="${proj.javadoc}" |
d1172c8862df
17314 need way to build without building javadoc, revisited
Stephen Talley <stephen.talley@oracle.com>
parents:
591
diff
changeset
|
255 |
erroronmissingdir="false"/> |
0 | 256 |
</copy> |
257 |
</sequential> |
|
258 |
</macrodef> |
|
259 |
||
260 |
<target name="install_project" /> |
|
261 |
||
262 |
<target name="install" depends="jar,install_project"> |
|
263 |
<!-- Temporarily set targetdir --> |
|
264 |
<install.default targetdir="${proto.vpanels}" /> |
|
265 |
</target> |
|
266 |
||
267 |
<target name="all" depends="jar,javadoc" /> |
|
268 |
||
269 |
<target name="lint" /> |
|
270 |
</project> |