forked from neel-shah/JLatexMath
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
239 lines (214 loc) · 12.2 KB
/
build.xml
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
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="jlatexmath" basedir="." default="buildJar">
<import file="version.xml"/>
<!-- Init -->
<target name="init" description="Initialize build">
<property name="project.root.dir" value="." />
<property name="fop.base.dir" value="${project.root.dir}/plugin/fop" />
<property name="doc.dir" value="${project.root.dir}/doc/" />
<property name="project.src.basedir" value="${project.root.dir}/src/" />
<property name="class.dir" value="/org/scilab/forge/jlatexmath" />
<property name="project.src.dir" value="${project.root.dir}/src/${class.dir}" />
<property name="project.bin.dir" value="${project.root.dir}/bin" />
<property name="project.ex.dir" value="${project.root.dir}/examples" />
<property name="ex.basic" value="${project.ex.dir}/Basic" />
<property name="ex.macros" value="${project.ex.dir}/Macros" />
<property name="package.dir" value="dist/" />
<property name="output.jar.dir" value="${package.dir}" />
<property name="jarfile" value="${package.dir}/jlatexmath-${version}.jar" />
<mkdir dir="${project.bin.dir}"/>
<mkdir dir="${project.bin.dir}/cyrillic"/>
<mkdir dir="${project.bin.dir}/greek"/>
<mkdir dir="${package.dir}"/>
<mkdir dir="${ex.macros}/bin"/>
</target>
<!-- Info -->
<target name="info" depends="init" description="Display configuration">
<echo message="**********************" />
<echo message="* JLaTeXMath *" />
<echo message="**********************" />
<echo message="Author : Calixte Denizet" />
<echo message="Script version : 1.0.0" />
<echo message="Ant version : ${ant.version}" />
<echo message="Java version : ${ant.java.version}" />
<echo message="Java home directory : ${java.home}" />
<echo message="Java classpath : ${java.class.path}" />
</target>
<!-- Remove all temp directories and/or files-->
<target name="clean" depends="info" description="Removes all generated files">
<delete dir="${project.bin.dir}"/>
<delete dir="${doc.dir}"/>
<delete>
<fileset dir="${ex.basic}" includes="**/Example*.png **/*.class"/>
</delete>
<delete dir="${ex.macros}/bin">
<fileset dir="${ex.macros}" includes="**/*.png **/*.class **/*.jar"/>
</delete>
<delete verbose="true">
<fileset dir="${project.root.dir}" includes="**/*~" defaultexcludes="no"/>
</delete>
</target>
<target name="dir.fop.check">
<condition property="dir.exists">
<available file="${fop.base.dir}" type="dir"/>
</condition>
</target>
<target name="example" depends="buildJar">
<javac includeantruntime="false" srcdir="${ex.basic}" destdir="${ex.basic}" debug="on" source="${java_version}" target="${java_version}" classpath="${output.jar.dir}/jlatexmath-${version}.jar:${output.jar.dir}/jlm_cyrillic.jar:${output.jar.dir}/jlm_greek.jar">
</javac>
<java fork="true" classpath="${ex.basic}:${output.jar.dir}/jlatexmath-${version}.jar:${output.jar.dir}/jlm_cyrillic.jar:${output.jar.dir}/jlm_greek.jar" dir="${ex.basic}" className="Main"/>
</target>
<target name="Macros" depends="compile">
<javac includeantruntime="false" srcdir="${ex.macros}" destdir="${ex.macros}/bin" debug="on" source="${java_version}" target="${java_version}" classpath="${output.jar.dir}/jlatexmath-${version}.jar">
</javac>
<move file="${ex.macros}/bin/Main.class" todir="${ex.macros}"/>
<jar jarfile="${ex.macros}/Foo.jar" basedir="${ex.macros}/bin"/>
<java fork="true" classpath="${ex.macros}:${ex.macros}/Foo.jar:${output.jar.dir}/jlatexmath-${version}.jar" dir="${ex.macros}" className="Main"/>
</target>
<target name="examples" depends="example"/>
<!-- Compile source files -->
<target name="compileWithoutAlph" depends="init">
<javac includeantruntime="false" srcdir="${project.src.dir}" destdir="${project.bin.dir}" debug="on" source="${java_version}" target="${java_version}" excludes="cyrillic/** greek/** **/WebStartAlphabetRegistration.java">
<!--compilerarg value="-Xlint"/-->
</javac>
</target>
<!-- Compile source files -->
<target name="compile" depends="init">
<javac includeantruntime="false" srcdir="${project.src.dir}" destdir="${project.bin.dir}" debug="on" source="${java_version}" target="${java_version}" excludes="**/WebStartAlphabetRegistration.java">
<!--compilerarg value="-Xlint"/-->
</javac>
</target>
<target name="compileMinimal" depends="compileWithoutAlph, cyrillic, greek">
<javac includeantruntime="false" srcdir="${project.src.dir}" destdir="${project.bin.dir}" debug="on" source="${java_version}" target="${java_version}" classpath="${project.bin.dir}/cyrillic:${project.bin.dir}/greek">
<include name="**/WebStartAlphabetRegistration.java"/>
</javac>
</target>
<target name="cyrillic" depends="init">
<javac includeantruntime="false" srcdir="${project.src.dir}/cyrillic" destdir="${project.bin.dir}/cyrillic" debug="on" source="${java_version}" target="${java_version}" classpath="${project.bin.dir}">
<!--compilerarg value="-Xlint"/-->
</javac>
<copy todir="${project.bin.dir}/cyrillic/${class.dir}/cyrillic" >
<fileset dir="${project.src.dir}/cyrillic">
<exclude name="**/*.java"/>
<exclude name="LICENSE"/>
<exclude name="COPYING"/>
<exclude name="MANIFEST.MF"/>
</fileset>
</copy>
<mkdir dir="${project.bin.dir}/cyrillic/META-INF" />
<copy file="${project.src.dir}/cyrillic/LICENSE" todir="${project.bin.dir}/cyrillic/META-INF" />
<copy file="${project.src.dir}/cyrillic/COPYING" todir="${project.bin.dir}/cyrillic/META-INF" />
<jar jarfile="dist/jlm_cyrillic.jar" basedir="${project.bin.dir}/cyrillic" manifest="${project.src.dir}/cyrillic/MANIFEST.MF"/>
</target>
<target name="greek" depends="init">
<javac includeantruntime="false" srcdir="${project.src.dir}/greek" destdir="${project.bin.dir}/greek" debug="on" source="${java_version}" target="${java_version}" classpath="${project.bin.dir}">
<!--compilerarg value="-Xlint"/-->
</javac>
<copy todir="${project.bin.dir}/greek/${class.dir}/greek" >
<fileset dir="${project.src.dir}/greek">
<exclude name="**/*.java"/>
<exclude name="LICENSE"/>
<exclude name="COPYING"/>
<exclude name="MANIFEST.MF"/>
</fileset>
</copy>
<mkdir dir="${project.bin.dir}/greek/META-INF" />
<copy file="${project.src.dir}/greek/LICENSE" todir="${project.bin.dir}/greek/META-INF" />
<copy file="${project.src.dir}/greek/COPYING" todir="${project.bin.dir}/greek/META-INF" />
<jar jarfile="dist/jlm_greek.jar" basedir="${project.bin.dir}/greek" manifest="${project.src.dir}/greek/MANIFEST.MF"/>
</target>
<!-- Build JAR files-->
<target name="minimal" depends="buildJarMinimal"/>
<target name="buildJarMinimal" depends="compileMinimal">
<copy todir="${project.bin.dir}${class.dir}" >
<fileset dir="${project.src.dir}">
<exclude name="**/*.java"/>
<exclude name="cyrillic/**"/>
<exclude name="greek/**"/>
</fileset>
</copy>
<mkdir dir="${project.bin.dir}/META-INF" />
<copy file="LICENSE" todir="${project.bin.dir}/META-INF" />
<copy file="COPYING" todir="${project.bin.dir}/META-INF" />
<delete dir="${project.bin.dir}/META-INF/services"/>
<jar jarfile="${package.dir}/jlatexmath-minimal-${version}.jar" basedir="${project.bin.dir}" manifest="MANIFEST.MF" excludes="cyrillic/** greek/** **/greek/** **/cyrillic/** **/fop/** **/services/**"/>
<zip destfile="${package.dir}/jlatexmath-minimal.zip">
<fileset dir="${package.dir}" includes="jlm_greek.jar"/>
<fileset dir="${package.dir}" includes="jlm_cyrillic.jar"/>
<fileset dir="${package.dir}" includes="jlatexmath-minimal-${version}.jar"/>
<fileset dir="." includes="README_MINIMAL"/>
</zip>
</target>
<target name="buildJar" depends="compile">
<copy todir="${project.bin.dir}${class.dir}" >
<fileset dir="${project.src.dir}">
<exclude name="**/*.java"/>
</fileset>
</copy>
<mkdir dir="${project.bin.dir}/META-INF" />
<copy file="LICENSE" todir="${project.bin.dir}/META-INF" />
<copy file="COPYING" todir="${project.bin.dir}/META-INF" />
<delete dir="${project.bin.dir}/META-INF/services"/>
<jar jarfile="${package.dir}/jlatexmath-${version}.jar" basedir="${project.bin.dir}" manifest="MANIFEST.MF" excludes="cyrillic/** greek/**"/>
</target>
<target name="fop" depends="plugin,dir.fop.check" if="dir.exists"/>
<target name="plugin" depends="init,dir.fop.check" if="dir.exists">
<ant antfile="build.xml" dir="${fop.base.dir}" inheritAll="false"/>
<copy file="${fop.base.dir}/dist/jlatexmath-fop-${version}.jar" todir="${package.dir}"/>
</target>
<target name="plugin-src" depends="init,dir.fop.check" if="dir.exists">
<ant antfile="build.xml" target="source" dir="${fop.base.dir}" inheritAll="false"/>
<copy file="${fop.base.dir}/dist/jlatexmath-fop-src-${version}.zip" tofile="${package.dir}/jlatexmath-fop-src-${version}.zip"/>
</target>
<target name="font-alone" depends="init">
<zip destfile="${package.dir}/jlatexmath-fonts.zip">
<fileset dir="${project.src.dir}/greek/fonts" includes="*.ttf"/>
<fileset dir="${project.src.dir}/cyrillic/fonts" includes="*.ttf"/>
<fileset dir="${project.src.dir}/fonts/maths" includes="*.ttf"/>
<fileset dir="${project.src.dir}/fonts/latin" includes="*.ttf"/>
<fileset dir="${project.src.dir}/fonts/euler" includes="*.ttf"/>
<fileset dir="${project.src.dir}/fonts/base" includes="*.ttf"/>
</zip>
</target>
<target name="embedded-zip" depends="embedded,dir.fop.check" if="dir.exists">
<zip destfile="${package.dir}/jlatexmath-embedded-fop-${version}.zip">
<fileset dir="${package.dir}" includes="jlatexmath-embedded-fop-${version}.jar"/>
<fileset dir="${fop.base.dir}" includes="examples/*"/>
</zip>
</target>
<target name="embedded" depends="compile,dir.fop.check" if="dir.exists">
<ant antfile="build.xml" dir="${fop.base.dir}" inheritAll="false" target="embedded"/>
<copy todir="${project.bin.dir}${class.dir}" >
<fileset dir="${project.src.dir}">
<exclude name="**/*.java"/>
</fileset>
</copy>
<mkdir dir="${project.bin.dir}/META-INF" />
<copy file="LICENSE" todir="${project.bin.dir}/META-INF" />
<copy file="COPYING" todir="${project.bin.dir}/META-INF" />
<jar jarfile="${package.dir}/jlatexmath-embedded-fop-${version}.jar" basedir="${project.bin.dir}" manifest="MANIFEST.MF" excludes="cyrillic/** greek/**"/>
<ant antfile="build.xml" dir="${fop.base.dir}" inheritAll="false" target="clean_embedded"/>
</target>
<target name="source" depends="info" >
<zip destfile="${output.jar.dir}/jlatexmath-src-${version}.zip">
<zipfileset prefix="jlatexmath-${version}/" dir="${project.root.dir}" includes="COPYING LICENSE README build.xml version.xml MANIFEST.MF src/**/*.java src/**/*.xml src/**/*.ttf src/**/licences/* src/**/greek/* src/**/cyrillic/* src/**/README examples/**/*.java examples/**/lion.png examples/**/*.xml examples/**/README" />
</zip>
</target>
<target name="src-all" depends="info,dir.fop.check" if="dir.exists" >
<zip destfile="${output.jar.dir}/jlatexmath-src-all-${version}.zip" >
<zipfileset prefix="jlatexmath-${version}/" dir="${project.root.dir}" includes="COPYING LICENSE README fop.properties build.xml version.xml MANIFEST.MF src/**/*.java src/**/*.xml src/**/*.ttf src/**/licences/* src/**/greek/* src/**/cyrillic/* src/**/README examples/**/*.java examples/**/lion.png examples/**/*.xml examples/**/README plugin/**/src/**/*.java plugin/**/src/META-INF/**/* plugin/**/build.xml plugin/**/COPYING plugin/**/LICENSE plugin/**/MANIFEST.MF plugin/**/examples/*.*" />
</zip>
</target>
<target name="all" depends="init, buildJar, buildJarMinimal, source, src-all, embedded, plugin, plugin-src, embedded-zip"/>
<target name="doc" depends="compile" description="Generates the API specification (javadoc)">
<javadoc packagenames="org.scilab.forge.jlatexmath.*"
sourcepath="${project.src.basedir}"
defaultexcludes="yes"
destdir="${doc.dir}"
author="true"
version="true"
use="true"
>
</javadoc>
</target>
</project>