File: build.xml

package info (click to toggle)
writer2latex 1.4-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 4,732 kB
  • sloc: java: 31,558; xml: 4,703; makefile: 73; sh: 38
file content (310 lines) | stat: -rw-r--r-- 13,320 bytes parent folder | download
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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
         <!-- 
  ############################################################################
  # This is the Ant build file for writer2latex
  # Original: Sep 2004 (mgn)
  # version 1.4 (2014-10-01)
  ############################################################################
-->
<project name="w2l" default="help" basedir=".">

    <!-- set this property to the location of your SO/OOo installation -->
	<property name="OFFICE_CLASSES" location="/usr/share/java" />
	<property name="URE_CLASSES" location="/usr/share/java" />
    <!-- set this property to the location of the java 6 bootstrap classes (rt.jar) -->
	<property name="JAVA6_RT_JAR" location="/home/hj/jre6/lib/rt.jar" />

    <description>writer2latex - build file</description>

    <target name="help" description="Displays usage information">
        <echo>Usage: ant &lt;target&gt;
          The following targets are supported:
          all
              Build nearly everything
          compile
              Compile all file except the tests.        
          jar
              Create the standalone jar file.
          oxt
              Create extension packages for OOo
          distro
              Create the distribution packages
          javadoc
              Create the javadoc documentation in target/javadoc. 
          clean
        </echo>
    </target>

    <!-- configure the directories -->
    <property name="jarfile" value="writer2latex"/>
    <property name="basename" value="writer2latex14"/>
    <property name="distrofile" value="${basename}.zip" />
    <!--<property name="sourcedistrofile" value="${basename}source.zip" />-->
    <property name="src" location="source/java"/>
    <property name="source.distro" location="source/distro" />
    <property name="classes" location="target/classes"/>
    <property name="javadoc" location="target/javadoc"/>
    <property name="tmp" location="target/tmp"/>
    <property name="target" location="target"/>
    <property name="target.lib" location="target/lib"/>
    <property name="source.idl" location="source/idl"/>
    <!-- classpath for the application; needs java-uno classes -->
    <path id="main.class.path"> 
        <!-- java uno classes -->
    	<filelist dir="/usr/share/java"
                files="com.android.json.jar"/>
    	<filelist dir="/usr/share/java"
                files="jaxb-api.jar"/>
    	<filelist dir="${URE_CLASSES}"
	        files="jurt.jar,juh.jar,ridl.jar"/>
        <filelist dir="${OFFICE_CLASSES}"
    		files="unoil.jar"/>
        <!-- additional uno interfaces generated from idl -->
        <pathelement path="${source.idl}/writer2latex"/>
        <pathelement path="${source.idl}/writer2xhtml"/>
    </path> 

    <target name="all"
            description="Build nearly everything"
            depends="javadoc,jar,oxt,distro" />

    <target name="compile"
            description="Compile the Java files (without tests)">
        <!-- create empty output directory for classes if not present -->
        <mkdir dir="${classes}"/>
        <!-- compile the application code -->
        <javac srcdir="${src}" 
               destdir="${classes}"
               encoding="us-ascii"
        	   source="1.6"
        	   target="1.6"
        	   bootclasspath="${JAVA6_RT_JAR}"
        	   includeantruntime="false"
               debug="on">
            <classpath refid="main.class.path"/>
        </javac>
        <copy todir="${classes}">
            <fileset dir="${src}">
                <include name="**/*.xml"/>
                <include name="**/*.properties"/>
            </fileset>
        </copy>
    </target>

    <target name="jar"
            depends="compile"
            description="Create writer2latex jar file containing all compiled classes except OOo components and test cases.">
    <!-- make a jar from the classes not matching magic testcase identifiers-->
        <mkdir dir="${target.lib}"/>
        <jar jarfile="${target.lib}/${jarfile}.jar">
            <fileset dir="${classes}">
                <patternset>
                    <exclude name="**/*Test.class"/>
                    <exclude name="**/AllTests.class"/>
		    		<include name="**/*.xml"/>
		    		<include name="**/*.properties"/>
                	<include name="**/*.class"/>
                    <!-- do not include OOo components in standalone library -->
                	<exclude name="org/openoffice/**/*"/>
                </patternset>
            </fileset>
            <manifest>
                <attribute name="Main-Class" value="writer2latex.Application"/>
                <attribute name="Class-Path" value="jaxp.jar parser.jar /usr/share/java/com.android.json.jar /usr/share/java/jaxb-api.jar"/>
            </manifest>
        </jar>
    </target>
	
    <!-- Create extension package for OOo 2.0.4+ -->
    <target name="oxt"
            depends="jar"
            description="Create extension package for installation with OOo 2.0.4+">
        <mkdir dir="${target.lib}"/>
        <mkdir dir="${tmp}"/>

        <!-- First extension: writer2latex.oxt -->
		
        <!-- Create jar with relevant files  -->
        <jar jarfile="${tmp}/writer2latex-filter.jar">
            <fileset dir="${classes}">
                <patternset>
                    <exclude name="**/*Test.class"/>
                    <exclude name="**/AllTests.class"/>
		    		<include name="**/*.xml"/>
                	<include name="**/*.class"/>
                    <exclude name="writer2latex/Application.class"/>
                    <exclude name="writer2latex/xhtml/**/*"/>
                	<exclude name="org/openoffice/da/comp/writer2xhtml/**/*"/>
                </patternset>
            </fileset>
            <!-- also include uno interface as generated from idl -->
            <fileset dir="${source.idl}/writer2latex">
                <include name="org/**/*"/>
            </fileset>
            <manifest>
                <!-- OOo needs this to register the filter: -->
                <attribute name="RegistrationClassName" value="org.openoffice.da.comp.writer2latex.W2LRegistration" />
                <attribute name="Class-Path" value="jaxp.jar parser.jar"/>
            </manifest>
        </jar>

        <!-- Pack extension -->
        <zip destfile="${target.lib}/writer2latex.oxt">
            <zipfileset dir="source/oxt/writer2latex" prefix="" />
            <zipfileset dir="${tmp}" includes="writer2latex-filter.jar" />
            <zipfileset dir="${source.idl}/writer2latex" includes="writer2latex.rdb"/>
        </zip>
		
        <!-- delete the jar for this extension -->
        <delete file="${tmp}/writer2latex-filter.jar" />
		
		
        <!-- Second extension: writer2xhtml.oxt -->

        <!-- Create jar with relevant files  -->
        <jar jarfile="${tmp}/writer2xhtml-filter.jar">
            <fileset dir="${classes}">
                <patternset>
                    <exclude name="**/*Test.class"/>
                    <exclude name="**/AllTests.class"/>
                	<include name="org/openoffice/da/comp/w2lcommon/**/*.class"/>
                	<include name="org/openoffice/da/comp/writer2xhtml/**/*.class"/>
                	<include name="writer2latex/api/**/*.class"/>
                	<include name="writer2latex/base/**/*.class"/>
                	<include name="writer2latex/epub/**/*.class"/>
                	<include name="writer2latex/office/**/*.class"/>
                	<include name="writer2latex/util/**/*.class"/>
                	<include name="writer2latex/xhtml/**/*.class"/>
                	<include name="writer2latex/xhtml/**/*.xml"/>
                	<include name="writer2latex/xhtml/**/*.properties"/>
                	<include name="writer2latex/xmerge/**/*.class"/>
                	<!-- include the portions of w2l necessary to convert formulas -->
                	<include name="writer2latex/latex/StarMathConverter.class"/>
                	<include name="writer2latex/latex/CharClasses.class"/>
                	<include name="writer2latex/latex/Token.class"/>
                   	<include name="writer2latex/latex/TGroup.class"/>
                   	<include name="writer2latex/latex/SmTokenTableEntry.class"/>
                   	<include name="writer2latex/latex/SmTokenTable.class"/>
                   	<include name="writer2latex/latex/SmToken.class"/>
                	<include name="writer2latex/latex/LaTeXDocumentPortion.class"/>
                	<include name="writer2latex/latex/LaTeXConfig.class"/>
                	<include name="writer2latex/latex/util/HeadingMap.class"/>
                    <include name="writer2latex/latex/util/StyleMap.class"/>
                	<include name="writer2latex/latex/i18n/*.class"/>
                </patternset>
            </fileset>
            <!-- also include uno interface as generated from idl -->
            <fileset dir="${source.idl}/writer2xhtml">
                <include name="org/**/*"/>
            </fileset>
            <manifest>
                <!-- OOo needs this to register the filter: -->
                <attribute name="RegistrationClassName" value="org.openoffice.da.comp.writer2xhtml.W2XRegistration" />
                <attribute name="Class-Path" value="jaxp.jar parser.jar"/>
            </manifest>
        </jar>

        <!-- Pack extension -->
        <zip destfile="${target.lib}/writer2xhtml.oxt">
            <zipfileset dir="source/oxt/writer2xhtml" prefix="" />
            <zipfileset dir="${tmp}" includes="writer2xhtml-filter.jar" />
            <zipfileset dir="${source.idl}/writer2xhtml" includes="writer2xhtml.rdb"/>
        </zip>
		
        <!-- delete the jar for this extension -->
        <delete file="${tmp}/writer2xhtml-filter.jar" />

        <!-- Third extension: writer4latex.oxt -->
    	
        <!-- Create jar with relevant files  -->
        <jar jarfile="${tmp}/writer4latex.jar">
            <fileset dir="${classes}">
                <patternset>
                	<include name="org/openoffice/da/comp/w2lcommon/helper/**/*"/>
                	<include name="org/openoffice/da/comp/writer4latex/**/*"/>
                	<include name="com/sun/star/lib/loader/**/*"/>
                </patternset>
            </fileset>
            <manifest>
                <attribute name="Class-Path" value="jaxp.jar parser.jar"/>
                <!-- OOo needs this to register the filter: -->
                <attribute name="RegistrationClassName" value="org.openoffice.da.comp.writer4latex.W4LRegistration" />
            </manifest>
        </jar>
        
    	<!-- Pack extension -->
        <zip destfile="${target.lib}/writer4latex.oxt">
            <zipfileset dir="source/oxt/writer4latex" prefix="" />
            <zipfileset dir="${tmp}" includes="writer4latex.jar" />
        </zip>

    	<!-- delete the jar for this extension -->
        <delete file="${tmp}/writer4latex.jar" />
		
        <!-- Fourth extension: xhtml-config-package.oxt (xhtml sample configuration package) -->

        <zip destfile="${target.lib}/xhtml-config-sample.oxt" basedir="source/oxt/xhtml-config-sample"/>
            
    </target>
	
    <!-- Create distribution packages -->
    <target name="distro" depends="jar,oxt"
            description="Create Writer2LaTeX distribution">
		
        <zip destfile="${target.lib}/${distrofile}">

            <!-- Add misc files (documentation, readmes, scripts etc.) -->
            <zipfileset dir="${source.distro}" prefix="${basename}"/>
		
            <!-- Add default configurations (copied from source tree) -->
            <zipfileset dir="${src}/writer2latex/latex/config"  prefix="${basename}/config" />
            <zipfileset dir="${src}/writer2latex/xhtml/config"  prefix="${basename}/config" />
		
            <!-- Add jar and oxt's -->
            <zipfileset dir="${target.lib}" prefix="${basename}"
             includes="${jarfile}.jar,writer2latex.oxt,writer2xhtml.oxt,writer4latex.oxt,xhtml-config-sample.oxt"/>
        </zip>
		
        <!-- Pack the source distribution -->
        <!--<zip destfile="${target.lib}/${sourcedistrofile}">
            <zipfileset dir="." includes="source/**/*,build.xml" prefix="${basename}" /> 
        </zip>-->
			 
    </target>

    <target name="clean"
            description="Remove unneccesary files and directories.">
        <delete dir="${classes}"/>
        <delete dir="${javadoc}"/>
		<delete dir="${target.lib}" />
        <delete dir="${tmp}" />
        </target>

    <target name="javadoc"
            description="Create JavaDoc HTML pages.">
        <mkdir dir="${javadoc}" />
        <javadoc 
             encoding="us-ascii"
             destdir="${javadoc}"
             author="true"
             version="true"
             use="true"
			 breakiterator="true" 
             splitindex="true"
             notree="false"
             nonavbar="false"
             noindex="false"
             nodeprecatedlist="false"
             nodeprecated="false">
            <classpath refid="main.class.path"/>
            <arg value="-notimestamp"/>
            <packageset dir="${src}" defaultexcludes="yes" />
        </javadoc>
        <copy todir="${javadoc}">
            <fileset dir="${src}">
                <include name="**/*.gif"/>
                <include name="**/*.png"/>
            </fileset>
        </copy>
    </target>

</project>