Migrate to JDK 1.8
[scilab.git] / scilab / modules / scirenderer / build.xml
1         <project name="scirenderer" default="jar">
2     
3     
4     
5     <property file="scirenderer-version.properties"/>
6     
7     <!-- Scirenderer is built from Scilab itself -->
8     <condition property="dependencies.prop" value="../../scilab-lib.properties">
9         <isset property="fromScilab" />
10     </condition>
11     
12     <!-- Scirenderer is built as a thirdparty application -->
13     <condition property="dependencies.prop" value="scirenderer-libs.properties">
14         <not>
15             <isset property="fromScilab"/>
16         </not>
17     </condition>
18     
19     <property file="${dependencies.prop}"/>
20     
21     <!-- Scirenderer is built from Scilab itself -->
22     <property name="library.noversion.name" value="scirenderer.jar" />
23     
24     <!-- Scirenderer is built as a thirdparty application -->
25     <condition property="library.name" value="scirenderer-${version}.jar">
26         <not>
27             <isset property="fromScilab"/>
28         </not>
29     </condition>
30     
31     <echo message="Using:" />
32     <echo message="${thirdparty.dir}"/>
33     <echo message="${jogl2.jar}"/>
34     <echo message="${gluegen2.jar}"/>
35     <echo message="${jlatexmath.jar}"/>
36     
37     <description>
38         Build scirenderer
39     </description>
40     
41     <!-- Where the module should be created (modules/xxx/jar) -->
42     <property name="build.jar.dir"  value="jar/" />
43     
44     <property name="library.jar" value="${build.jar.dir}/${library.name}" />
45     <property name="library.noversion.jar" value="${build.jar.dir}/${library.noversion.name}" />
46     
47     <!-- The building directory -->
48     <property name="build.dir" location="build/"/>
49     
50     <!-- The building example directory -->
51     <property name="build.example.dir" location="build-example/"/>
52     
53     <!-- The building document directory -->
54     <property name="doc.dir" location="docs/"/>
55     
56     
57     <!-- The building test directory -->
58     <property name="build.test.dir" location="build/test"/>
59     
60     <!-- Where built classes will be generated -->
61     <property name="classes.dir" location="${build.dir}/classes" />
62     
63     <!-- Where built test classes will be generated -->
64     <property name="classes.test.dir" location="${build.test.dir}/" />
65     
66     <!-- Where we store cache files -->
67     <property name="cache.dir" location="${build.dir}/cachefile" />
68     
69     <!-- Where we can find the sources -->
70     <property name="src.dir"  location="src/" />
71     
72     <!-- Where we can find the sources -->
73     <property name="src.examples.dir"  location="examples/" />
74     
75     <path id="compile.classpath">
76         <pathelement location="${jogl2.jar}"/>
77         <pathelement location="${gluegen2.jar}"/>
78         <pathelement location="${jlatexmath.jar}"/>
79     </path>
80     
81     <target name="init">
82         <mkdir dir="${classes.dir}"/>
83         <mkdir dir="${classes.test.dir}"/>
84         <mkdir dir="${build.jar.dir}"/>
85         <!-- Create the time stamp -->
86         <tstamp/>
87     </target>
88     
89     <!-- Clean sources -->
90     <target name="clean" description="Clean built files" depends="clean-test">
91         <delete dir="${build.dir}"/>
92         <delete dir="${build.example.dir}"/>
93         <delete dir="${build.jar.dir}"/>
94         <delete dir="${doc.dir}"/>
95         <delete file="${library.jar}"/>
96     </target>
97     
98     <!-- Clean test -->
99     <target name="clean-test" description="Clean test files">
100         <delete dir="${build.test.dir}"/>
101     </target>
102     
103     <!-- Compile sources -->
104     <target name="compile" description="Build sources" depends="init">
105         <javac
106        srcdir="${src.dir}"
107        destdir="${classes.dir}"
108        classpathref="compile.classpath"
109        deprecation="on"
110        debug="off"
111        verbose="off"
112        listfiles="on"
113        includeAntRuntime="no"
114        >
115             <compilerarg value="-Xlint"/>
116         </javac>
117     </target>
118     
119     <!-- Compile examples -->
120     <target name="compile-examples" description="Build the examples" depends="compile">
121         <javac
122        srcdir="${src.examples.dir}"
123        destdir="${classes.dir}"
124        classpathref="compile.classpath"
125        deprecation="on"
126        debug="off"
127        verbose="off"
128        listfiles="on"
129        includeAntRuntime="no"
130        >
131             <compilerarg value="-Xlint"/>
132         </javac>
133     </target>
134     
135     <target name="existing-tests">
136         <available property="test-present"
137                file="${src.examples.dir}"
138                />
139     </target>
140     
141     <!-- Compile test sources -->
142     <target name="compile-test" description="Build tests" depends="existing-tests, jar" if="test-present">
143         <mkdir dir="${build.test.dir}"/>
144         
145         <!-- clean the test to make sure it will build properly -->
146         <javac
147        srcdir="${src.examples.dir}"
148        destdir="${classes.test.dir}"
149        deprecation="on"
150        debug="off"
151        verbose="off"
152        listfiles="on"
153        includeAntRuntime="no"
154        >
155             <classpath>
156                 <path refid="compile.classpath" />
157                 <path location="${library.jar}" />
158             </classpath>
159         </javac>
160     </target>
161     
162     <!-- Create the jar -->
163     <target name="jar" description="Build the jar file" depends="compile">
164         
165         <jar destfile="${library.jar}" basedir="${classes.dir}">
166             <manifest>
167                 <attribute name="Class-Path" value="jogl2.jar gluegen2.jar"/>
168             </manifest>
169         </jar>
170     </target>
171     
172     <!-- Create the jar without the extension -->
173     <target name="noversion" description="Build the jar file without version" depends="compile">
174         
175         <antcall target="jar">
176             <param name="library.jar" value="${library.noversion.jar}"/>
177         </antcall>
178     </target>
179     
180     <target name="doc">
181         <javadoc
182            destdir="${doc.dir}"
183            author="true"
184            version="true"
185            use="true"
186            windowtitle="SciRenderer API">
187             <packageset dir="src" defaultexcludes="yes">
188                 <include name="org/**"/>
189             </packageset>
190         </javadoc>
191     </target>
192     
193     <target name="all" depends="jar, doc" />
194     
195     <target name="list-example" description="List all examples available">
196         <echo message="Examples available :"/>
197         <echo message=""/>
198         <echo message="    plot2d"/>
199         <echo message="    lightenedrotatingcube"/>
200         <echo message="    linerendering"/>
201         <echo message="    milkdrop"/>
202         <echo message="    simplerotatingcube"/>
203         <echo message="    clipping"/>
204         <echo message="    JLatexMath"/>
205     </target>
206     
207     <target name="all-examples" description="Launch all examples" depends="
208     example-lightened-cube,
209     example-plot2d,
210     example-chicken-pox-cube,
211     example-clipped-tetrahedron,
212     example-jLatex-math,
213     example-line-rendering,
214     example-milk-drop,
215     example-sprite,
216     example-rotatable-sprite,
217     example-ruler,
218     example-texture
219     "/>
220     
221     <target name="example-plot2d" description="Scilab Like Plot2d Example">
222         <antcall target="check">
223             <param name="ClassName" value="org.scilab.forge.scirenderer.examples.ScilabLikePlot2D"/>
224         </antcall>
225     </target>
226     
227     <target name="example-lightened-cube" description="Lightened Rotating Cube Example">
228         <antcall target="check">
229             <param name="ClassName" value="org.scilab.forge.scirenderer.examples.LightenedCube" />
230         </antcall>
231     </target>
232     
233     <target name="example-line-rendering" description="Line Rendering Example">
234         <antcall target="check">
235             <param name="ClassName" value="org.scilab.forge.scirenderer.examples.LineRendering" />
236         </antcall>
237     </target>
238     
239     <target name="example-milk-drop" description="Milk Drop Example">
240         <antcall target="check">
241             <param name="ClassName" value="org.scilab.forge.scirenderer.examples.MilkDrop" />
242         </antcall>
243     </target>
244     
245     <target name="example-chicken-pox-cube" description="Cube With Chicken Pox Example">
246         <antcall target="check">
247             <param name="ClassName" value="org.scilab.forge.scirenderer.examples.ChickenPoxCube" />
248         </antcall>
249     </target>
250     
251     <target name="example-clipped-tetrahedron" description="Clipping Example">
252         <antcall target="check">
253             <param name="ClassName" value="org.scilab.forge.scirenderer.examples.ClippedTetrahedron" />
254         </antcall>
255     </target>
256     
257     <target name="example-sprite" description="Sprite Example">
258         <antcall target="check">
259             <param name="ClassName" value="org.scilab.forge.scirenderer.examples.Sprites" />
260         </antcall>
261     </target>
262     
263     <target name="example-rotatable-sprite" description="Rotatable Sprite Example">
264         <antcall target="check">
265             <param name="ClassName" value="org.scilab.forge.scirenderer.examples.RotatableSprite" />
266         </antcall>
267     </target>
268     
269     <target name="example-jLatex-math" description="JLatexMath editor Example">
270         <antcall target="check">
271             <param name="ClassName" value="org.scilab.forge.scirenderer.examples.JLatexMath" />
272         </antcall>
273     </target>
274     
275     <target name="example-ruler" description="Ruler Example">
276         <antcall target="check">
277             <param name="ClassName" value="org.scilab.forge.scirenderer.examples.SimpleRuler" />
278         </antcall>
279     </target>
280     
281     <target name="example-texture" description="Texture Example">
282         <antcall target="check">
283             <param name="ClassName" value="org.scilab.forge.scirenderer.examples.TextureExample" />
284         </antcall>
285     </target>
286     
287     <target name="example-JScrollPane" description="JScrollPane Example">
288         <antcall target="check">
289             <param name="ClassName" value="org.scilab.forge.scirenderer.examples.JScrollPaneExample" />
290         </antcall>
291     </target>
292     
293     <target name="check" description="Launch some Examples" depends="jar, compile-test">
294         <fail unless="ClassName" message="check should not be called directly. Please use all-examples"/>
295         <java ClassName="${ClassName}" fork="yes">
296             <classpath>
297                 <pathelement path="${jogl2.jar}"/>
298                 <pathelement path="${gluegen2.jar}"/>
299                 <pathelement path="${jlatexmath.jar}"/>
300                 <pathelement path="${library.jar}"/>
301                 <pathelement path="${build.test.dir}"/>
302             </classpath>
303             <jvmarg value="-Djava.library.path=${jni.path}"/>
304         </java>
305     </target>
306     
307 </project>