07120dc4548b55f3ae4f7fee2d258bec802f9aca
[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         <!-- Where builded classes will be generated -->
18         <property name="classes.dir" location="${build.dir}/classes" />
19         
20         <!-- Where we store cache files -->
21         <property name="cache.dir" location="${build.dir}/cachefile" />
22         
23         <!-- Where we can find the sources -->
24         <property name="src.dir"  location="src/java/" />
25         
26         <!-- Check style definitions -->
27         <property name = "checkstyle.config.file"      value = "${base.dir}/checkstyle/scilab_checkstyle_convention.xml" />
28         <property name = "checkstyle.stylesheet"       value = "${thirdparty.dir}/checkstyle/contrib/checkstyle-noframes-sorted.xsl" />
29         <property name = "checkstyle.report.dir"       value = "${build.dir}/checkstyle" />
30         <property name = "checkstyle.xml.report.file"  value = "${checkstyle.report.dir}/checkstyle_errors.xml" />
31         <property name = "checkstyle.html.report.file" value = "${checkstyle.report.dir}/checkstyle_errors.htm" />
32         
33         <property name="modules.dir"                 value="${base.dir}/modules" />
34         
35         <property file="${base.dir}/scilab-lib.properties"/>
36         
37         <!-- Loading of the thirdparty libraries
38         We could specify one by one library that we are using -->
39         <!--  <path id="classpath">
40                 <fileset dir="${thirdparty.dir}" includes="**/*.jar"/>
41         </path>
42                 <classpath id="compile.classpath"
43                         path="${oro.jar}:${xalan.jar}"
44                 />
45         -->
46         
47         <path id="checkstyle.classpath">
48                 <pathelement location="${checkstyle.jar}"/>
49         </path>
50         
51         <path id="compile.classpath">
52         
53           <pathelement location="${library.localization.dir}/${library.localization.name}"/>
54                 <pathelement location="${library.shell.dir}/${library.shell.name}"/>
55                 <pathelement location="${library.history_manager.dir}/${library.history_manager.name}"/>
56                 <pathelement location="${library.completion.dir}/${library.completion.name}"/>
57                 <pathelement location="${library.console.dir}/${library.console.name}"/>
58                 <pathelement location="${library.action_binding.dir}/${library.action_binding.name}"/>
59                 
60                 <pathelement location="${library.gui.dir}/${library.gui.name}"/>
61                 <pathelement location="${library.jvm.dir}/${library.jvm.name}"/>
62                 <pathelement location="${library.renderer.dir}/${library.renderer.name}"/>
63                 <pathelement location="${library.graphic_export.dir}/${library.graphic_export.name}"/>
64                 
65                 <pathelement location="${commons-logging.jar}"/>
66                 
67                 <pathelement location="${flexdock.jar}"/>
68                 
69                 <pathelement location="${gluegen.jar}"/>
70                 
71                 <pathelement location="${jrosetta-API.jar}"/>
72                 
73                 <pathelement location="${jrosetta-engine.jar}"/>
74
75                 <pathelement location="${jogl.jar}"/>
76                 
77         </path>
78         
79         <taskdef resource="checkstyletask.properties" classpathref="checkstyle.classpath"/>
80         
81         <!-- Checkstyle process -->
82         
83         <target
84                 name        = "checkstyle"
85                 depends     = "checkstyle-init"
86                 description = "Generates a report of code convention violations.">
87                 <checkstyle
88                         config          = "${checkstyle.config.file}"
89                         failOnViolation = "false">
90                         <fileset
91                                 dir      = "${src.dir}"
92                                 includes = "**/*.java"/>
93                         <!-- Location of cache-file. -->
94                         <property
95                                 key  = "checkstyle.cache.file"
96                                 file = "${cache.dir}"/>
97                         <formatter type="plain"/>
98                         <formatter
99                                 type   = "xml"
100                                 toFile = "${checkstyle.xml.report.file}"/>
101                 </checkstyle>
102                 <xslt
103                         in     = "${checkstyle.xml.report.file}"
104                         out    = "${checkstyle.html.report.file}"
105                         style  = "${checkstyle.stylesheet}" />
106         </target>
107         
108         <!-- Create the build directory -->
109         
110         <target name="checkstyle-init">
111                 <mkdir dir="${checkstyle.report.dir}"/>
112         </target>
113         
114         <!-- Delete the build directory -->
115         
116         <target name="checkstyle-clean">
117                 <delete dir="${checkstyle.report.dir}"/>
118         </target>
119         
120         <target name="init">
121                 <mkdir dir="${classes.dir}"/>
122                 <mkdir dir="${build.jar.dir}"/>
123                         <!-- Create the time stamp -->
124                 <tstamp/>
125         </target>
126         
127         <!-- Clean sources -->
128         <target name="clean" description="clean sources">
129                 <delete dir="${build.dir}"/>
130                 <delete dir="${build.jar.dir}"/>
131                 <delete file="${build.jar.dir}/${library.name}"/>
132         </target>
133         
134         <!-- Compile sources -->
135         <target name="compile" description="Build sources" depends="init">
136                 <javac
137                         srcdir="${src.dir}" 
138                         destdir="${classes.dir}" 
139                         classpathref="compile.classpath" 
140                         deprecation="on"
141                         debug="off"
142                         verbose="off"
143                         listfiles="on"
144                         source="5"
145                         />
146         </target>
147         
148         <!-- Create the jar -->
149         <target name="jar" description="Build the jar file" depends="compile">
150         
151                 <jar destfile="${build.jar.dir}/${library.name}" basedir="${classes.dir}">
152                 <manifest>
153                 </manifest>
154                 </jar>
155         </target>
156
157 </project>