File: build.xml

package info (click to toggle)
xz-java 1.8-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 904 kB
  • sloc: java: 6,864; xml: 164; makefile: 7
file content (161 lines) | stat: -rw-r--r-- 6,236 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
<?xml version="1.0" encoding="UTF-8"?>

<!--
    build.xml

    Author: Lasse Collin <lasse.collin@tukaani.org>

    This file has been put into the public domain.
    You can do whatever you want with this file.
-->

<project name="XZ" default="jar">

    <property file="build.properties"/>

    <target name="clean"
            description="Deletes generated files except 'extdoc/package-list'">
        <delete dir="${build_dir}"/>
    </target>

    <target name="distclean" depends="clean"
            description="Deletes all generated files">
        <delete dir="extdoc"/>
    </target>

    <target name="dist" description="Creates a source package (.zip)">
        <mkdir dir="${dist_dir}"/>
        <zip destfile="${dist_file}">
            <fileset dir="." includesfile="fileset-misc.txt"/>
            <fileset dir="." includesfile="fileset-src.txt"/>
        </zip>
    </target>

    <target name="doc"
            description="Generates HTML documentation with javadoc">
        <mkdir dir="${doc_dir}"/>
        <mkdir dir="${extdoc_dir}"/>
        <javadoc sourcepath="${src_dir}" destdir="${doc_dir}"
                 source="${sourcever}" packagenames="org.tukaani.xz"
                 locale="en" additionalparam="-notimestamp"
                 windowtitle="XZ data compression"
                 link="${extdoc_url}"/>
    </target>

    <target name="compile" description="Compiles the classes">
        <mkdir dir="${classes_dir}"/>
        <javac srcdir="." sourcepath="${src_dir}" destdir="${classes_dir}"
               includeAntRuntime="false" debug="${debug}"
               source="${sourcever}" target="${sourcever}"
               includesfile="fileset-src.txt"
               excludes="**/package-info.java">
            <compilerarg compiler="modern" value="-Xlint"/>
        </javac>
    </target>

    <target name="jar" depends="compile"
            description="Creates JAR packages">
        <mkdir dir="${jar_dir}"/>

        <jar destfile="${jar_dir}/xz.jar" basedir="${classes_dir}"
             includes="org/tukaani/xz/**">
            <manifest>
                <attribute name="Implementation-Title" value="${title}"/>
                <attribute name="Implementation-Version" value="${version}"/>
                <attribute name="Implementation-URL" value="${homepage}"/>
                <attribute name="Sealed" value="true"/>
                <attribute name="Automatic-Module-Name"
                           value="org.tukaani.xz"/>
                <!-- Attributes required for OSGi bundles. -->
                <attribute name="Bundle-ManifestVersion" value="2"/>
                <attribute name="Bundle-SymbolicName" value="org.tukaani.xz"/>
                <attribute name="Bundle-Version" value="${version}"/>
                <attribute name="Export-Package" value="org.tukaani.xz"/>
                <attribute name="Bundle-Name" value="${title}"/>
                <attribute name="Bundle-DocURL" value="${homepage}"/>
            </manifest>
        </jar>

        <jar destfile="${jar_dir}/TestAllocSpeed.jar" basedir="${classes_dir}"
             includes="TestAllocSpeed.class">
            <manifest>
                <attribute name="Main-Class" value="TestAllocSpeed"/>
                <attribute name="Class-Path" value="xz.jar"/>
            </manifest>
        </jar>

        <jar destfile="${jar_dir}/XZEncDemo.jar" basedir="${classes_dir}"
             includes="XZEncDemo.class">
            <manifest>
                <attribute name="Main-Class" value="XZEncDemo"/>
                <attribute name="Class-Path" value="xz.jar"/>
            </manifest>
        </jar>

        <jar destfile="${jar_dir}/XZDecDemo.jar" basedir="${classes_dir}"
             includes="XZDecDemo.class">
            <manifest>
                <attribute name="Main-Class" value="XZDecDemo"/>
                <attribute name="Class-Path" value="xz.jar"/>
            </manifest>
        </jar>

        <jar destfile="${jar_dir}/XZSeekEncDemo.jar" basedir="${classes_dir}"
             includes="XZSeekEncDemo.class">
            <manifest>
                <attribute name="Main-Class" value="XZSeekEncDemo"/>
                <attribute name="Class-Path" value="xz.jar"/>
            </manifest>
        </jar>

        <jar destfile="${jar_dir}/XZSeekDecDemo.jar" basedir="${classes_dir}"
             includes="XZSeekDecDemo.class">
            <manifest>
                <attribute name="Main-Class" value="XZSeekDecDemo"/>
                <attribute name="Class-Path" value="xz.jar"/>
            </manifest>
        </jar>

        <jar destfile="${jar_dir}/LZMAEncDemo.jar" basedir="${classes_dir}"
             includes="LZMAEncDemo.class">
            <manifest>
                <attribute name="Main-Class" value="LZMAEncDemo"/>
                <attribute name="Class-Path" value="xz.jar"/>
            </manifest>
        </jar>

        <jar destfile="${jar_dir}/LZMADecDemo.jar" basedir="${classes_dir}"
             includes="LZMADecDemo.class">
            <manifest>
                <attribute name="Main-Class" value="LZMADecDemo"/>
                <attribute name="Class-Path" value="xz.jar"/>
            </manifest>
        </jar>
    </target>

    <!-- It's an ugly quick hack. Maybe some day there will be a cleaner
         version (e.g. by using Maven). -->
    <target name="maven" depends="dist, doc, jar"
            description="Creates the files for a Maven repository">
        <mkdir dir="${maven_dir}"/>

        <copy file="${pom_template}" tofile="${maven_dir}/xz-${version}.pom"
              overwrite="true">
            <filterset>
                <filter token="VERSION" value="${version}"/>
                <filter token="TITLE" value="${title}"/>
                <filter token="HOMEPAGE" value="${homepage}"/>
            </filterset>
        </copy>

        <copy file="${jar_dir}/xz.jar" tofile="${maven_dir}/xz-${version}.jar"
              preservelastmodified="true" overwrite="true"/>

        <jar destfile="${maven_dir}/xz-${version}-javadoc.jar"
             basedir="${doc_dir}"/>

        <jar destfile="${maven_dir}/xz-${version}-sources.jar"
             basedir="${src_dir}" includes="org/tukaani/xz/**"/>
    </target>

</project>