1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- Common definitions of Java compilation for Scilab -->
3 <project name="common">
4 <!-- Base of Scilab source tree -->
5 <property name="base.dir" location="../../"/>
6 <!-- Where the module should be created (modules/xxx/jar) -->
7 <property name="build.jar.dir" value="jar/"/>
8 <!-- Where the thirdparty libraries could be found -->
9 <property name="thirdparty.dir" location="${base.dir}/thirdparty/"/>
10 <!-- The building directory -->
11 <property name="build.dir" location="build/"/>
12 <!-- The building test directory -->
13 <property name="build.test.dir" location="${build.dir}/test"/>
14 <!-- Where builded classes will be generated -->
15 <property name="classes.dir" location="${build.dir}/classes"/>
16 <!-- Where builded test classes will be generated -->
17 <property name="classes.test.dir" location="${build.test.dir}/classes"/>
18 <property name="instrumented.classes.test.dir" location="${build.test.dir}/instrumented-classes"/>
19 <!-- Where we store cache files -->
20 <property name="cache.dir" location="${build.dir}/cachefile"/>
21 <!-- Where we can find the sources -->
22 <property name="src.dir" location="src/java/"/>
24 <property name="modules.dir" value="${base.dir}/modules"/>
26 <property file="${base.dir}/scilab-lib.properties"/>
27 <property file="${base.dir}/scilab-lib-doc.properties"/>
28 <!-- Configure ANT flags -->
29 <property file="${base.dir}/scilab.properties"/>
30 <!-- Set ${SCIVERSION} -->
31 <property file="${base.dir}/Version.incl"/>
33 <path id="checkstyle.classpath">
34 <pathelement location="${checkstyle.jar}"/>
35 <pathelement location="${commons-logging.jar}"/>
36 <pathelement location="${commons-beanutils.jar}"/>
37 <pathelement location="${antlr.jar}"/>
40 <path id="compile.classpath">
41 <pathelement location="${library.types.dir}/${library.types.name}"/>
42 <pathelement location="${library.graph.dir}/${library.graph.name}"/>
43 <pathelement location="${library.graphic_objects.dir}/${library.graphic_objects.name}"/>
44 <pathelement location="${library.xcos.dir}/${library.xcos.name}"/>
45 <pathelement location="${library.hdf5.dir}/${library.hdf5.name}"/>
46 <pathelement location="${library.scinotes.dir}/${library.scinotes.name}"/>
47 <pathelement location="${library.localization.dir}/${library.localization.name}"/>
48 <pathelement location="${library.history_manager.dir}/${library.history_manager.name}"/>
49 <pathelement location="${library.completion.dir}/${library.completion.name}"/>
50 <pathelement location="${library.console.dir}/${library.console.name}"/>
51 <pathelement location="${library.action_binding.dir}/${library.action_binding.name}"/>
52 <pathelement location="${library.gui.dir}/${library.gui.name}"/>
53 <pathelement location="${library.commons.dir}/${library.commons.name}"/>
54 <pathelement location="${library.jvm.dir}/${library.jvm.name}"/>
55 <pathelement location="${library.renderer.dir}/${library.renderer.name}"/>
56 <pathelement location="${library.graphic_export.dir}/${library.graphic_export.name}"/>
57 <pathelement location="${library.core.dir}/${library.core.name}"/>
58 <pathelement location="${library.preferences.dir}/${library.preferences.name}"/>
59 <!-- Not use at build time but used for unitary tests -->
60 <pathelement location="${library.javasci.dir}/${library.javasci.name}"/>
61 <pathelement location="${library.javasci.dir}/${library.javasci-v1.name}"/>
62 <pathelement location="${commons-logging.jar}"/>
63 <pathelement location="${flexdock.jar}"/>
64 <pathelement location="${gluegen2.jar}"/>
65 <pathelement location="${jrosetta-API.jar}"/>
66 <pathelement location="${jrosetta-engine.jar}"/>
67 <pathelement location="${jogl2.jar}"/>
68 <pathelement location="${jhdf5.jar}"/>
69 <pathelement location="${jhall.jar}"/>
70 <pathelement location="${jgraphx.jar}"/>
71 <pathelement location="${scirenderer.jar}"/>
72 <!-- Only useful for the documentation -->
73 <pathelement location="${library.helptools.dir}/${library.helptools.name}"/>
74 <pathelement location="${batik.jar}"/>
75 <pathelement location="${xml_apis_ext.jar}"/>
76 <pathelement location="${saxon.jar}"/>
77 <pathelement location="${xmlgraphics-commons.jar}"/>
78 <pathelement location="${fop.jar}"/>
79 <pathelement location="${jlatexmath-fop.jar}"/>
80 <pathelement location="${avalon-framework.jar}"/>
81 <pathelement location="${jeuclid-core.jar}"/>
82 <pathelement location="${jlatexmath.jar}"/>
85 <!-- Check the version of Java. If it changes after the configure
86 or if there is a mistake in the build system
88 <fail message="JDK 1.6 or 1.7 required. Found ${ant.java.version}">
92 <equals arg1="${ant.java.version}" arg2="1.6"/>
93 <equals arg1="${ant.java.version}" arg2="1.7"/>
98 <mkdir dir="${classes.dir}"/>
99 <mkdir dir="${classes.test.dir}"/>
100 <mkdir dir="${build.jar.dir}"/>
101 <!-- Create the time stamp -->
104 <!-- Clean sources -->
105 <target name="clean" description="Clean built files" depends="clean-test">
106 <delete dir="${build.dir}"/>
107 <delete dir="${build.jar.dir}"/>
108 <delete file="${build.jar.dir}/${library.name}"/>
110 <!-- Compile sources -->
111 <target name="compile" description="Build sources" depends="init">
112 <javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="compile.classpath" deprecation="on" debug="${build.debug}" verbose="off" listfiles="on" includeAntRuntime="no" source="6" target="6">
113 <compilerarg value="-Xlint"/>
117 <!-- Create the jar -->
118 <target name="jar" description="Build the jar file" depends="compile">
119 <jar destfile="${build.jar.dir}/${library.name}" basedir="${classes.dir}">
121 <attribute name="Built-By" value="${user.name}"/>
122 <section name="org/scilab/modules/${ant.project.name}/">
123 <attribute name="Specification-Title" value="${library.title}"/>
124 <attribute name="Specification-Version" value="${SCIVERSION}"/>
125 <attribute name="Specification-Vendor" value="${library.vendor}"/>
126 <attribute name="Implementation-Title" value="${library.name}"/>
127 <attribute name="Implementation-Version" value="${DSTAMP} ${TSTAMP}"/>
128 <attribute name="Implementation-Vendor" value="${library.vendor}"/>
129 <attribute name="Class-Path" value="${manifest.class-path}"/>
135 <import file="build.qa.incl.xml"/>