File: build.xml

package info (click to toggle)
writer2latex 0.5-8
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,644 kB
  • ctags: 3,255
  • sloc: java: 17,985; xml: 3,432; sh: 168; makefile: 62
file content (139 lines) | stat: -rw-r--r-- 5,325 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
<!-- 
  ############################################################################
  # This is the Ant build file for writer2latex
  # Sep 2004 (mgn)
  # version 0.4.1d (2006-11-02)
  ############################################################################
-->
<project name="w2l" default="help" basedir=".">

    <!-- set this property to the location of your SO/OOo installation -->
	<property name="OFFICE_HOME" location=""/>

    <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 jar file.
          package
              Create extension package for OOo
          javadoc
              Create the javadoc documentation in target/javadoc. 
          clean
        </echo>
    </target>

    <!-- configure the directories -->
    <property name="jarfile" value="writer2latex"/>
    <property name="extensionfile" value="writer2latex.uno.pkg"/>
    <property name="src" location="source"/>
    <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"/>
    <!-- classpath for the application; needs java-uno classes -->
    <path id="main.class.path"> 
        <filelist dir="${OFFICE_HOME}/program/classes"
            files="jurt.jar,unoil.jar,ridl.jar,juh.jar"/>
    </path> 

    <target name="all"
            description="Build nearly everything"
            depends="javadoc,package" />

    <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}"
               debug="on">
            <classpath refid="main.class.path"/>
        </javac>
        <copy todir="${classes}">
            <fileset dir="source">
                <include name="**/*.xml"/>
            </fileset>
        </copy>
    </target>

    <target name="jar"
            depends="compile"
            description="Create writer2latex jar file containing all compiled classes except 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="**/*.class"/>
                	<include name="org/**/*"/>
                </patternset>
            </fileset>
            <manifest>
                <attribute name="Built-By" value="${user.name}"/>
                <attribute name="Main-Class" value="writer2latex.Application"/>
                <!-- OOo needs this to register the filter: -->
                <attribute name="RegistrationClassName" value="writer2latex.filter.W2LExportFilter" />
                <attribute name="Class-Path" value="jaxp.jar parser.jar"/>
            </manifest>
        </jar>
    </target>
	
    <!-- to do: new package format; include manifest etc. -->
    <target name="package"
            depends="jar"
            description="Create uno package (extension) for installation with OOo 2.x">
        <mkdir dir="${target.lib}"/>
        <mkdir dir="${target.lib}/META-INF"/>
        <copy todir="${target.lib}/META-INF" file="source/package/META-INF/manifest.xml" />
        <copy todir="${target.lib}" file="source/package/w2l_types.xcu" />
        <copy todir="${target.lib}" file="source/package/w2l_filters.xcu" />
        <zip destfile="${target.lib}/${extensionfile}" basedir="${target.lib}"
             includes="META-INF/manifest.xml,w2l_types.xcu,w2l_filters.xcu,writer2latex.jar" />            
    </target>

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

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

</project>