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 built classes will be generated -->
15 <property name="classes.dir" location="${build.dir}/classes"/>
16 <!-- Where built 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="${jhall.jar}"/>
69 <pathelement location="${jgraphx.jar}"/>
70 <pathelement location="${scirenderer.jar}"/>
71 <!-- Only useful for the documentation -->
72 <pathelement location="${library.helptools.dir}/${library.helptools.name}"/>
73 <pathelement location="${batik.jar}"/>
74 <pathelement location="${xmlgraphics-commons.jar}"/>
75 <pathelement location="${fop.jar}"/>
76 <pathelement location="${jlatexmath-fop.jar}"/>
77 <pathelement location="${avalon-framework.jar}"/>
78 <pathelement location="${jeuclid-core.jar}"/>
79 <pathelement location="${jlatexmath.jar}"/>
82 <!-- Check the version of Java. If it changes after the configure
83 or if there is a mistake in the build system
85 <fail message="JDK 1.6 or 1.7 required. Found ${ant.java.version}">
89 <equals arg1="${ant.java.version}" arg2="1.6"/>
90 <equals arg1="${ant.java.version}" arg2="1.7"/>
95 <mkdir dir="${classes.dir}"/>
96 <mkdir dir="${classes.test.dir}"/>
97 <mkdir dir="${build.jar.dir}"/>
98 <!-- Create the time stamp -->
101 <!-- Clean sources -->
102 <target name="clean" description="Clean built files" depends="clean-test">
103 <delete dir="${build.dir}"/>
104 <delete dir="${build.jar.dir}"/>
105 <delete file="${build.jar.dir}/${library.name}"/>
107 <!-- Compile sources -->
108 <target name="compile" description="Build sources" depends="init">
109 <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" encoding="utf-8">
110 <compilerarg value="-Xlint" />
111 <!-- Silent some warnings -->
112 <compilerarg value="-Xlint:-unchecked" />
113 <!-- Too borring and painful to fix -->
114 <compilerarg value="-Xlint:-rawtypes" />
115 <!-- Too borring and painful to fix -->
116 <compilerarg value="-Xlint:-path" />
117 <!-- Silent the bad path element -->
118 <compilerarg value="-Xlint:-serial" />
119 <!-- Silent warning about the serializable -->
120 <compilerarg value="-Xlint:-options" />
121 <!-- Silent 'bootstrap class path not set in conjunction with -source 1.6'. We don't want to manage the detection of rt.jar. See https://blogs.oracle.com/darcy/entry/bootclasspath_older_source -->
125 <!-- Create the jar -->
126 <target name="jar" description="Build the jar file" depends="compile">
127 <jar destfile="${build.jar.dir}/${library.name}" basedir="${classes.dir}">
129 <attribute name="Built-By" value="${user.name}"/>
130 <section name="org/scilab/modules/${ant.project.name}/">
131 <attribute name="Specification-Title" value="${library.title}"/>
132 <attribute name="Specification-Version" value="${SCIVERSION}"/>
133 <attribute name="Specification-Vendor" value="${library.vendor}"/>
134 <attribute name="Implementation-Title" value="${library.name}"/>
135 <attribute name="Implementation-Version" value="${DSTAMP} ${TSTAMP}"/>
136 <attribute name="Implementation-Vendor" value="${library.vendor}"/>
137 <attribute name="Class-Path" value="${manifest.class-path}"/>
143 <import file="build.qa.incl.xml"/>