@@ DEV @@ : Try to use Java MVC for graphics component.
[scilab.git] / scilab / build.incl.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- Common definitions of Java compilation for Scilab --> 
3 <project name="common">
4         
5         <!-- Base of Scilab source tree -->
6         <property name="base.dir"  location="../../" />
7         
8         <!-- Where the module should be created (modules/xxx/jar) -->
9         <property name="build.jar.dir"  value="jar/" />
10         
11         <!-- Where the thirdparty libraries could be found -->
12         <property name="thirdparty.dir" location="${base.dir}/thirdparty/" />
13         
14         <!-- The building directory -->
15         <property name="build.dir" location="build/"/>
16         
17         <!-- The building test directory -->
18         <property name="build.test.dir" location="build/test"/>
19         
20         <!-- Where builded classes will be generated -->
21         <property name="classes.dir" location="${build.dir}/classes" />
22         
23         <!-- Where builded test classes will be generated -->
24         <property name="classes.test.dir" location="${build.test.dir}/classes" />
25         
26         <!-- Where we store cache files -->
27         <property name="cache.dir" location="${build.dir}/cachefile" />
28         
29         <!-- Where we can find the sources -->
30         <property name="src.dir"  location="src/java/" />
31
32         <!-- Where we can find the test sources -->
33         <property name="src.test.dir"  location="tests/java/" />
34         
35         <!-- Check style definitions -->
36         <property name = "checkstyle.config.file"      value = "${base.dir}/checkstyle/scilab_checkstyle_convention.xml" />
37         <property name = "checkstyle.stylesheet"       value = "${thirdparty.dir}/checkstyle/contrib/checkstyle-noframes-sorted.xsl" />
38         <property name = "checkstyle.report.dir"       value = "${build.dir}/checkstyle" />
39         <property name = "checkstyle.xml.report.file"  value = "${checkstyle.report.dir}/checkstyle_errors.xml" />
40         <property name = "checkstyle.html.report.file" value = "${checkstyle.report.dir}/checkstyle_errors.htm" />
41         
42         <property name="modules.dir"                 value="${base.dir}/modules" />
43         
44         <property file="${base.dir}/scilab-lib.properties"/>
45
46         <property file="${base.dir}/scilab-lib-doc.properties"/>
47         
48
49         <path id="checkstyle.classpath">
50                 <pathelement location="${checkstyle.jar}"/>
51                 <pathelement location="${commons-logging.jar}"/>
52                 <pathelement location="${commons-beanutils.jar}"/>
53                 <pathelement location="${antlr.jar}"/>
54         </path>
55
56         <path id="unittest.classpath">
57                 <pathelement location="${testng.jar}"/>
58                 <pathelement location="${bsh.jar}"/> 
59                 <pathelement location="${junit.jar}"/>
60                 <pathelement location="${qdox.jar}"/>
61         </path>
62   
63
64
65         <path id="compile.classpath">
66                 <pathelement location="${library.types.dir}/${library.types.name}"/>
67                 <pathelement location="${library.graph.dir}/${library.graph.name}"/>
68                 <pathelement location="${library.graphic_objects.dir}/${library.graphic_objects.name}"/>
69                 <pathelement location="${library.xcos.dir}/${library.xcos.name}"/>
70                 <pathelement location="${library.hdf5.dir}/${library.hdf5.name}"/>
71                 <pathelement location="${library.scinotes.dir}/${library.scinotes.name}"/>
72                 <pathelement location="${library.localization.dir}/${library.localization.name}"/>
73                 <pathelement location="${library.shell.dir}/${library.shell.name}"/>
74                 <pathelement location="${library.history_manager.dir}/${library.history_manager.name}"/>
75                 <pathelement location="${library.completion.dir}/${library.completion.name}"/>
76                 <pathelement location="${library.console.dir}/${library.console.name}"/>
77                 <pathelement location="${library.action_binding.dir}/${library.action_binding.name}"/>
78                 
79                 <pathelement location="${library.gui.dir}/${library.gui.name}"/>
80                 <pathelement location="${library.jvm.dir}/${library.jvm.name}"/>
81                 <pathelement location="${library.renderer.dir}/${library.renderer.name}"/>
82                 <pathelement location="${library.graphic_export.dir}/${library.graphic_export.name}"/>
83                 
84                 <pathelement location="${commons-logging.jar}"/>
85                 
86                 <pathelement location="${flexdock.jar}"/>
87
88                 <pathelement location="${gluegen.jar}"/>
89                 
90                 <pathelement location="${jrosetta-API.jar}"/>
91                 
92                 <pathelement location="${jrosetta-engine.jar}"/>
93
94                 <pathelement location="${jogl.jar}"/>
95
96                 <pathelement location="${jhdf5.jar}"/>
97                 
98                 <pathelement location="${jhall.jar}"/>
99                 
100                 <pathelement location="${jgraphx.jar}"/>
101
102         <!-- Only usefull for the documentation -->     
103                 <pathelement location="${library.helptools.dir}/${library.helptools.name}"/>
104                 <pathelement location="${batik.jar}"/>
105
106                 <pathelement location="${saxon.jar}"/>
107
108                 <pathelement location="${fop.jar}"/>
109
110                 <pathelement location="${jlatexmath-fop.jar}"/>
111
112                 <pathelement location="${avalon-framework.jar}"/>
113
114                 <pathelement location="${avalon-framework-impl.jar}"/>
115
116                 <pathelement location="${jeuclid-core.jar}"/>
117
118                 <pathelement location="${jlatexmath.jar}"/>
119         </path>
120
121         <taskdef resource="checkstyletask.properties" classpathref="checkstyle.classpath"/>
122         
123         <!-- Checkstyle process -->
124         
125         <target
126                 name        = "checkstyle"
127                 depends     = "checkstyle-init"
128                 description = "Generates a report of code convention violations.">
129                 <checkstyle
130                         config          = "${checkstyle.config.file}"
131                         failOnViolation = "false">
132                         <fileset
133                                 dir      = "${src.dir}"
134                                 includes = "**/*.java"/>
135                         <!-- Location of cache-file. -->
136                         <property
137                                 key  = "checkstyle.cache.file"
138                                 file = "${cache.dir}"/>
139                         <formatter type="plain"/>
140                         <formatter
141                                 type   = "xml"
142                                 toFile = "${checkstyle.xml.report.file}"/>
143                 </checkstyle>
144                 <xslt
145                         in     = "${checkstyle.xml.report.file}"
146                         out    = "${checkstyle.html.report.file}"
147                         style  = "${checkstyle.stylesheet}" />
148         </target>
149         
150         <!-- Create the build directory -->
151         
152         <target name="checkstyle-init">
153                 <mkdir dir="${checkstyle.report.dir}"/>
154         </target>
155         
156         <!-- Delete the build directory -->
157         
158         <target name="checkstyle-clean">
159                 <delete dir="${checkstyle.report.dir}"/>
160         </target>
161
162         <target name="test" depends="compile-test, validate" if="test-present">
163         <taskdef name="testng" classpathref="unittest.classpath" classname="org.testng.TestNGAntTask" />
164             <testng verbose="2"  haltonfailure="true">
165                   <classpath>
166                       <path refid="unittest.classpath" />
167                       <path refid="compile.classpath" />
168                       <pathelement location="${classes.test.dir}" />
169                     </classpath>
170                   <classfileset dir="${build.test.dir}" includes="**/*.class"/>
171           <jvmarg value="-DdisableLoadJNIScilab=1"/>
172            </testng>
173          </target>
174
175         <target name="validate">
176         <!-- Empty target to be override by other build.xml -->
177         </target>
178
179         <target name="init">
180                 <mkdir dir="${classes.dir}"/>
181                 <mkdir dir="${classes.test.dir}"/>
182                 <mkdir dir="${build.jar.dir}"/>
183                         <!-- Create the time stamp -->
184                 <tstamp/>
185         </target>
186         
187         <!-- Clean sources -->
188         <target name="clean" description="Clean built files">
189                 <delete dir="${build.dir}"/>
190                 <delete dir="${build.test.dir}"/>
191                 <delete dir="${build.jar.dir}"/>
192                 <delete file="${build.jar.dir}/${library.name}"/>
193         </target>
194         
195         <!-- Compile sources -->
196         <target name="compile" description="Build sources" depends="init">
197                 <javac
198                         srcdir="${src.dir}" 
199                         destdir="${classes.dir}" 
200                         classpathref="compile.classpath" 
201                         deprecation="on"
202                         debug="off"
203                         verbose="off"
204                         listfiles="on"
205                         includeAntRuntime="no"
206                         source="5"
207                         />
208         </target>
209
210         <target name="existing-tests">
211                 <available property="test-present"
212                         directory="${src.test.dir}"
213                 />      
214         </target>
215
216         <!-- Compile test sources -->
217         <target name="compile-test" description="Build tests" depends="jar" if="test-present">
218
219                 <javac
220                         srcdir="${src.test.dir}" 
221                         destdir="${classes.test.dir}" 
222                         deprecation="on"
223                         debug="off"
224                         verbose="off"
225                         listfiles="on"
226                         includeAntRuntime="no"
227                         source="5"
228                         >
229                   <classpath>
230                       <path refid="unittest.classpath" />
231                           <path refid="compile.classpath" />
232                     </classpath>
233                         </javac>
234         </target>
235
236         <!-- Create the jar -->
237         <target name="jar" description="Build the jar file" depends="compile">
238         
239                 <jar destfile="${build.jar.dir}/${library.name}" basedir="${classes.dir}">
240                 <manifest>
241                 </manifest>
242                 </jar>
243         </target>
244
245 </project>