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}"/>
80 <pathelement location="${freehep-graphics2d.jar}"/>
81 <pathelement location="${freehep-graphicsio-emf.jar}"/>
82 <pathelement location="${freehep-graphicsio.jar}"/>
85 <!-- Check the version of Java. If it changes after the configure
86 or if there is a mistake in the build system
87 Note: all class names are the same as in m4/java.m4
89 <available property="jdk1.6+" classname="java.util.ArrayDeque"/>
90 <available property="jdk1.7+" classname="java.nio.file.Path"/>
91 <available property="jdk1.8+" classname="java.util.stream.DoubleStream"/>
92 <fail message="Require JDK 1.6 or higher. Found ${ant.java.version}" unless="jdk1.6+"/>
93 <mkdir dir="${classes.dir}"/>
94 <mkdir dir="${classes.test.dir}"/>
95 <mkdir dir="${build.jar.dir}"/>
96 <!-- Create the time stamp -->
99 <!-- Clean sources -->
100 <target name="clean" description="Clean built files" depends="clean-test">
101 <delete dir="${build.dir}"/>
102 <delete dir="${build.jar.dir}"/>
103 <delete file="${build.jar.dir}/${library.name}"/>
105 <!-- Compile sources -->
106 <target name="compile" description="Build sources" depends="init">
107 <javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="compile.classpath" deprecation="on" debug="${build.debug}" debuglevel="lines,vars,source" verbose="off" listfiles="on" includeAntRuntime="no" source="6" target="6" encoding="utf-8">
108 <compilerarg value="-Xlint" />
109 <!-- Silent some warnings -->
110 <compilerarg value="-Xlint:-unchecked" />
111 <!-- Too borring and painful to fix -->
112 <compilerarg value="-Xlint:-rawtypes" />
113 <!-- Too borring and painful to fix -->
114 <compilerarg value="-Xlint:-path" />
115 <!-- Silent the bad path element -->
116 <compilerarg value="-Xlint:-serial" />
117 <!-- Silent warning about the serializable -->
118 <compilerarg value="-Xlint:-options" />
119 <!-- 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 -->
123 <!-- Create the jar -->
124 <target name="jar" description="Build the jar file" depends="compile">
125 <jar destfile="${build.jar.dir}/${library.name}" basedir="${classes.dir}">
127 <attribute name="Built-By" value="${user.name}"/>
128 <section name="org/scilab/modules/${ant.project.name}/">
129 <attribute name="Specification-Title" value="${library.title}"/>
130 <attribute name="Specification-Version" value="${SCIVERSION}"/>
131 <attribute name="Specification-Vendor" value="${library.vendor}"/>
132 <attribute name="Implementation-Title" value="${library.name}"/>
133 <attribute name="Implementation-Version" value="${DSTAMP} ${TSTAMP}"/>
134 <attribute name="Implementation-Vendor" value="${library.vendor}"/>
135 <attribute name="Class-Path" value="${manifest.class-path}"/>
141 <import file="build.qa.incl.xml"/>