/[volute]/trunk/projects/theory/snapdm/build_java.xml
ViewVC logotype

Contents of /trunk/projects/theory/snapdm/build_java.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 297 - (show annotations)
Mon Apr 28 06:22:05 2008 UTC (12 years, 7 months ago) by bourges.laurent
File MIME type: text/xml
File size: 7461 byte(s)
forceMakeAll do not build base java code : fixed
1 <!--
2 build_java.xml file : specific targets for java code
3 -->
4 <property name="jalopyConvention" location="${libs}/ant/jalopy-java-laurent.xml" />
5
6
7 <!-- checks if build is necessary : java source code & libraries -->
8 <uptodate property="build.base.notRequired">
9 <srcfiles dir= "${root}" includes="build.properties"/>
10 <srcfiles dir= "${sources}" includes="**/*"/>
11 <srcfiles dir= "${libs}" includes="**/*.jar"/>
12 <mapper type="merge" to="${dist}/${build.file}"/>
13 </uptodate>
14
15
16 <!-- defines Jalopy task -->
17 <taskdef name="jalopy"
18 classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
19 <classpath>
20 <pathelement location="${libs}/ant/jalopy.jar" />
21 <pathelement location="${libs}/ant/jalopy-ant.jar" />
22 <pathelement location="${libs}/log4j-1.2.15.jar"/>
23 </classpath>
24 </taskdef>
25
26
27
28
29 <!-- target makeJava : cleans, compiles java code -->
30 <target name="makeJava" depends="cleanJava, compile">
31 <echo>makeJava : done.</echo>
32 </target>
33
34
35
36
37 <!-- target cleanJava : clean build files -->
38 <target name="cleanJava" depends="init, cleanDist">
39 <echo>cleaning directory : ${build} ...</echo>
40
41 <delete includeemptydirs="false" verbose="true">
42 <fileset dir="${build}" includes="**/*"/>
43 </delete>
44
45 <echo>cleaned directory : ${build} : done.</echo>
46 </target>
47
48
49
50
51 <!-- target cleanJava : clean build files -->
52 <target name="cleanDist" depends="init">
53 <echo>cleaning directory : ${dist} ...</echo>
54
55 <delete includeemptydirs="false" verbose="true">
56 <fileset dir="${dist}" includes="**/*"/>
57 </delete>
58
59 <echo>cleaned directory : ${dist} : done.</echo>
60 </target>
61
62
63
64
65
66 <!-- Compile java files and jar them -->
67 <target name="compile" depends="cleanJava" unless="build.base.notRequired">
68 <echo>compile ${base.title} ...</echo>
69 <echo>compile from : ${sources}</echo>
70 <echo>compile to : ${build.src}</echo>
71
72 <mkdir dir="${build.src}"/>
73
74 <javac sourcepath="" srcdir="${sources}" destdir="${build.src}" listfiles="false"
75 fork="true" verbose="false" encoding="UTF-8"
76 debug="on" deprecation="on" optimize="on" casesensitive="true"
77 source="1.5" target="1.5">
78
79 <classpath refid="project.class.path" />
80
81 <include name="**/*.java"/>
82 </javac>
83
84 <pathconvert pathsep=" " property="jar.classpath">
85 <path refid="project.class.path"/>
86 <map from="${root}/" to=""/>
87 </pathconvert>
88
89 <jar jarfile="${dist}/${build.file}" compress="true">
90 <fileset dir="${build.src}" />
91 <fileset file="${sources}/log4j.*" />
92
93 <manifest>
94 <attribute name="Built-By" value="${build.by}"/>
95 <attribute name="Built-Date" value="${build.date}"/>
96
97 <attribute name="Build-Jdk" value="${java.vm.version}"/>
98 <attribute name="Build-Os" value="${os.name} ${os.version} - ${os.arch}"/>
99
100 <attribute name="Class-Path" value="${jar.classpath}"/>
101
102 <section name="Common">
103 <attribute name="Specification-Title" value="${base.title}"/>
104 <attribute name="Specification-Version" value="${version}"/>
105 <attribute name="Specification-Vendor" value="${vendor}"/>
106 <attribute name="Implementation-Title" value="${base.title}"/>
107 <attribute name="Implementation-Version" value="${version} - ${build.date}"/>
108 </section>
109 </manifest>
110
111 </jar>
112
113 <delete dir="${build.src}"/>
114
115 <echo>compile ${base.title} : done.</echo>
116 </target>
117
118
119
120
121 <!-- target makeOutput : compiles generated java code and javadoc -->
122 <target name="makeOutput" depends="compileOutput, format, makeJavaDoc">
123 <echo>makeOutput : done.</echo>
124 </target>
125
126
127
128
129 <!-- Compile generated java files -->
130 <target name="compileOutput" depends="compile">
131 <echo>compile ${gen.title} ...</echo>
132 <echo>compile from : ${sources.gen}</echo>
133 <echo>compile to : ${build.gen}</echo>
134
135 <mkdir dir="${build.gen}"/>
136
137 <javac sourcepath="" srcdir="${sources.gen}" destdir="${build.gen}" listfiles="false"
138 fork="true" verbose="false" encoding="UTF-8"
139 debug="on" deprecation="on" optimize="on" casesensitive="true"
140 source="1.5" target="1.5">
141
142 <classpath refid="infrastructure.class.path" />
143
144 <include name="**/*.java"/>
145 </javac>
146
147 <pathconvert pathsep=" " property="jar.gen.classpath">
148 <path refid="infrastructure.class.path"/>
149 <map from="${dist}/" to=""/>
150 </pathconvert>
151
152 <jar jarfile="${sources.gen.dist}/${build.gen.file}" compress="true">
153 <fileset dir="${build.gen}" />
154
155 <manifest>
156 <attribute name="Built-By" value="${build.by}"/>
157 <attribute name="Built-Date" value="${build.date}"/>
158
159 <attribute name="Build-Jdk" value="${java.vm.version}"/>
160 <attribute name="Build-Os" value="${os.name} ${os.version} - ${os.arch}"/>
161
162 <attribute name="Class-Path" value="${jar.gen.classpath}"/>
163
164 <section name="Common">
165 <attribute name="Specification-Title" value="${gen.title}"/>
166 <attribute name="Specification-Version" value="${version}"/>
167 <attribute name="Specification-Vendor" value="${vendor}"/>
168 <attribute name="Implementation-Title" value="${gen.title}"/>
169 <attribute name="Implementation-Version" value="${version} - ${build.date}"/>
170 </section>
171 </manifest>
172
173 </jar>
174
175 <!-- remove to avoid classes in svn -->
176 <delete dir="${build.gen}"/>
177
178 <echo>compile ${gen.title} : done.</echo>
179 </target>
180
181
182
183
184 <!-- target makeJavaDoc : creates javadoc from source code -->
185 <target name="makeJavaDoc">
186 <echo>making generated Java classes javadoc ...</echo>
187
188 <mkdir dir="${sources.gen.docs}"/>
189
190 <javadoc additionalparam="-notimestamp"
191 destdir="${sources.gen.docs}"
192 access="private"
193 author="true"
194 encoding="UTF-8"
195 use="false"
196 windowtitle="${source} : ${gen.title}" >
197
198 <classpath refid="project.class.path" />
199
200 <fileset dir="${sources}" defaultexcludes="yes" includes="**/*.java" />
201 <fileset dir="${sources.gen}" defaultexcludes="yes" includes="**/*.java" />
202
203 </javadoc>
204
205 <echo>generated Java classes javadoc : done.</echo>
206 </target>
207
208
209
210
211 <!-- target format : formats all generated java sources -->
212 <target name="format" depends="compileOutput">
213 <!--
214 Invokes Jalopy as follows:
215
216 - All formatted files will have unix fileformat (\n)
217 - Load your code convention from the given url
218 - Override the convention to use loglevel "info"
219 - Override the convention to use 2 threads
220 - The import optimization feature will work (if enabled in the active
221 convention), because a classpath reference is specified
222
223 Don't forget to setup an include pattern as Jalopy truly expects
224 valid Java source files as input!
225
226
227 -->
228 <jalopy fileformat="unix"
229 convention="${jalopyConvention}"
230 encoding="UTF-8"
231 failonerror="false"
232 history="NONE"
233 loglevel="warn"
234 threads="1"
235 classpathref="infrastructure.class.path">
236 <fileset dir="${sources.gen}">
237 <include name="**/*.java" />
238 </fileset>
239 </jalopy>
240 </target>
241
242
243 <!-- end of build_java.xml -->

msdemlei@ari.uni-heidelberg.de
ViewVC Help
Powered by ViewVC 1.1.26