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