summaryrefslogtreecommitdiffstats
path: root/scilab/build.incl.xml
blob: 371f0887315a283da01cc8812c35a6715cd66e25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<?xml version="1.0" encoding="UTF-8"?>
<!-- Common definitions of Java compilation for Scilab --> 
<project name="common">
	
	<!-- Base of Scilab source tree -->
	<property name="base.dir"  location="../../" />
	
	<!-- Where the module should be created (modules/xxx/jar) -->
	<property name="build.jar.dir"  value="jar/" />
	
	<!-- Where the thirdparty libraries could be found -->
	<property name="thirdparty.dir" location="${base.dir}/thirdparty/" />
	
	<!-- The building directory -->
	<property name="build.dir" location="build/"/>
	
	<!-- The building test directory -->
	<property name="build.test.dir" location="build/test"/>
	
	<!-- Where builded classes will be generated -->
	<property name="classes.dir" location="${build.dir}/classes" />
	
	<!-- Where builded test classes will be generated -->
	<property name="classes.test.dir" location="${build.test.dir}/classes" />
	
	<!-- Where we store cache files -->
	<property name="cache.dir" location="${build.dir}/cachefile" />
	
	<!-- Where we can find the sources -->
	<property name="src.dir"  location="src/java/" />

	<!-- Where we can find the test sources -->
	<property name="src.test.dir"  location="tests/java/" />
	
	<!-- Check style definitions -->
	<property name = "checkstyle.config.file"      value = "${base.dir}/checkstyle/scilab_checkstyle_convention.xml" />
	<property name = "checkstyle.stylesheet"       value = "${thirdparty.dir}/checkstyle/contrib/checkstyle-noframes-sorted.xsl" />
	<property name = "checkstyle.report.dir"       value = "${build.dir}/checkstyle" />
	<property name = "checkstyle.xml.report.file"  value = "${checkstyle.report.dir}/checkstyle_errors.xml" />
	<property name = "checkstyle.html.report.file" value = "${checkstyle.report.dir}/checkstyle_errors.htm" />
	
	<property name="modules.dir"                 value="${base.dir}/modules" />
	
	<property file="${base.dir}/scilab-lib.properties"/>

	<property file="${base.dir}/scilab-lib-doc.properties"/>
	

	<path id="checkstyle.classpath">
		<pathelement location="${checkstyle.jar}"/>
                <pathelement location="${commons-logging.jar}"/>
                <pathelement location="${commons-beanutils.jar}"/>
                <pathelement location="${antlr.jar}"/>
	</path>

	<path id="unittest.classpath">
		<pathelement location="${testng.jar}"/>
		<pathelement location="${bsh.jar}"/> 
		<pathelement location="${junit.jar}"/>
		<pathelement location="${qdox.jar}"/>
	</path>
  


	<path id="compile.classpath">
		<pathelement location="${library.types.dir}/${library.types.name}"/>
		<pathelement location="${library.graph.dir}/${library.graph.name}"/>
		<pathelement location="${library.xcos.dir}/${library.xcos.name}"/>
		<pathelement location="${library.hdf5.dir}/${library.hdf5.name}"/>
		<pathelement location="${library.xpad.dir}/${library.xpad.name}"/>
		<pathelement location="${library.localization.dir}/${library.localization.name}"/>
		<pathelement location="${library.shell.dir}/${library.shell.name}"/>
		<pathelement location="${library.history_manager.dir}/${library.history_manager.name}"/>
		<pathelement location="${library.completion.dir}/${library.completion.name}"/>
		<pathelement location="${library.console.dir}/${library.console.name}"/>
		<pathelement location="${library.action_binding.dir}/${library.action_binding.name}"/>
		
		<pathelement location="${library.gui.dir}/${library.gui.name}"/>
		<pathelement location="${library.jvm.dir}/${library.jvm.name}"/>
		<pathelement location="${library.renderer.dir}/${library.renderer.name}"/>
		<pathelement location="${library.graphic_export.dir}/${library.graphic_export.name}"/>
		
		<pathelement location="${commons-logging.jar}"/>
		
		<pathelement location="${flexdock.jar}"/>

		<pathelement location="${gluegen.jar}"/>
		
		<pathelement location="${jrosetta-API.jar}"/>
		
		<pathelement location="${jrosetta-engine.jar}"/>

		<pathelement location="${jogl.jar}"/>

		<pathelement location="${jhdf5.jar}"/>
		
		<pathelement location="${jhall.jar}"/>
		
		<pathelement location="${jgraphx.jar}"/>

	<!-- Only usefull for the documentation -->	
		<pathelement location="${library.helptools.dir}/${library.helptools.name}"/>
		<pathelement location="${batik.jar}"/>

		<pathelement location="${saxon.jar}"/>

		<pathelement location="${fop.jar}"/>

		<pathelement location="${jlatexmath-fop.jar}"/>

		<pathelement location="${avalon-framework.jar}"/>

		<pathelement location="${avalon-framework-impl.jar}"/>

		<pathelement location="${jeuclid-core.jar}"/>

		<pathelement location="${jlatexmath.jar}"/>
	</path>

	<taskdef resource="checkstyletask.properties" classpathref="checkstyle.classpath"/>
	
	<!-- Checkstyle process -->
	
	<target
		name        = "checkstyle"
		depends     = "checkstyle-init"
		description = "Generates a report of code convention violations.">
		<checkstyle
			config          = "${checkstyle.config.file}"
			failOnViolation = "false">
			<fileset
				dir      = "${src.dir}"
				includes = "**/*.java"/>
			<!-- Location of cache-file. -->
			<property
				key  = "checkstyle.cache.file"
				file = "${cache.dir}"/>
			<formatter type="plain"/>
			<formatter
				type   = "xml"
				toFile = "${checkstyle.xml.report.file}"/>
		</checkstyle>
		<xslt
			in     = "${checkstyle.xml.report.file}"
			out    = "${checkstyle.html.report.file}"
			style  = "${checkstyle.stylesheet}" />
	</target>
	
	<!-- Create the build directory -->
	
	<target name="checkstyle-init">
		<mkdir dir="${checkstyle.report.dir}"/>
	</target>
	
	<!-- Delete the build directory -->
	
	<target name="checkstyle-clean">
		<delete dir="${checkstyle.report.dir}"/>
	</target>

	<target name="test" depends="compile-test, validate" if="test-present">
        <taskdef name="testng" classpathref="unittest.classpath" classname="org.testng.TestNGAntTask" />
	    <testng verbose="2"  haltonfailure="true">
		  <classpath>
		      <path refid="unittest.classpath" />
		      <path refid="compile.classpath" />
		      <pathelement location="${classes.test.dir}" />
		    </classpath>
		  <classfileset dir="${build.test.dir}" includes="**/*.class"/>
          <jvmarg value="-DdisableLoadJNIScilab=1"/>
	   </testng>
	 </target>

	<target name="validate">
	<!-- Empty target to be override by other build.xml -->
	</target>

	<target name="init">
		<mkdir dir="${classes.dir}"/>
		<mkdir dir="${classes.test.dir}"/>
		<mkdir dir="${build.jar.dir}"/>
			<!-- Create the time stamp -->
		<tstamp/>
	</target>
	
	<!-- Clean sources -->
	<target name="clean" description="Clean built files">
		<delete dir="${build.dir}"/>
		<delete dir="${build.test.dir}"/>
		<delete dir="${build.jar.dir}"/>
		<delete file="${build.jar.dir}/${library.name}"/>
	</target>
	
	<!-- Compile sources -->
	<target name="compile" description="Build sources" depends="init">
		<javac
			srcdir="${src.dir}" 
			destdir="${classes.dir}" 
			classpathref="compile.classpath" 
			deprecation="on"
			debug="off"
			verbose="off"
			listfiles="on"
			includeAntRuntime="no"
			source="5"
			/>
	</target>

	<target name="existing-tests">
		<available property="test-present"
			directory="${src.test.dir}"
		/>	
	</target>

	<!-- Compile test sources -->
	<target name="compile-test" description="Build tests" depends="jar" if="test-present">

		<javac
			srcdir="${src.test.dir}" 
			destdir="${classes.test.dir}" 
			deprecation="on"
			debug="off"
			verbose="off"
			listfiles="on"
			includeAntRuntime="no"
			source="5"
			>
		  <classpath>
		      <path refid="unittest.classpath" />
			  <path refid="compile.classpath" />
		    </classpath>
			</javac>
	</target>

	<!-- Create the jar -->
	<target name="jar" description="Build the jar file" depends="compile">
	
		<jar destfile="${build.jar.dir}/${library.name}" basedir="${classes.dir}">
		<manifest>
		</manifest>
		</jar>
	</target>

</project>