File: build.xml

package info (click to toggle)
texhyphj 1.2+dfsg-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 448 kB
  • sloc: java: 2,033; xml: 297; makefile: 24
file content (95 lines) | stat: -rw-r--r-- 3,430 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="buildZip">
	<description>Buildfile for this project</description>
	
	<import file="build-properties.xml"/>
	<import file="build-doc.xml"/>
	
	<property name="dist.jar" value="${dist.dir}/${release-name}.jar"/>
	<property name="build.dir" value="${ant-output.dir}/build.temp"/>

	<patternset id="dist-jar.patternset">
		<include name="**/*.*"/>
		<exclude name="**/package.html"/>
	</patternset>
	
	<!-- - - - - - - - - - - - - - - - - - 
          target: emptyBuildDir                      
         - - - - - - - - - - - - - - - - - -->
    <target name="emptyBuildDir">
    	<delete dir="${build.dir}"/>
    	<mkdir dir="${build.dir}"/>
    </target>

	<!-- - - - - - - - - - - - - - - - - - 
          target: createDistDir                      
         - - - - - - - - - - - - - - - - - -->
    <target name="createDistDir">
		<mkdir dir="${dist.dir}"/>
    </target>

	<!-- - - - - - - - - - - - - - - - - -
          target: compile              
         - - - - - - - - - - - - - - - - - -->
    <target name="compile" depends="emptyBuildDir, createDistDir">
    	<!-- Compile core files -->
        <javac srcdir="${main-src.dir}" destdir="${build.dir}" includeantruntime="false" encoding="UTF-8" debug="true">
            <!--
			<classpath>
                <fileset dir="/usr/share/java">
					<include name="*.jar"/>
				</fileset>
			</classpath>
            -->
        </javac>

    </target>

    <target name="buildJar" description="Builds distribution jar">
    	<antcall target="compile"></antcall>
    	<jar destfile="${dist.jar}">
    		<fileset dir="${build.dir}">
    			<patternset refid="dist-jar.patternset"/>
    		</fileset>
    		<fileset dir="${main-src.dir}">
    			<patternset refid="dist-jar.patternset"/>  			
    		</fileset>
    		<manifest>
    			<attribute name="Built-By" value="${user.name}"/>
    			<attribute name="Built-On" value="${ISO-TODAY}"/>
    			<attribute name="Implementation-Title" value="${release-name}"/>
    			<attribute name="Implementation-Version" value="${release-version}"/>
    			<attribute name="Implementation-URL" value="${release-url}"/>
    		</manifest>
    	</jar>
    	<delete dir="${build.dir}"/>
    </target>

	<target name="buildZip" depends="buildJar, buildDoc" description="Builds distribution zip including all required jars">
    	<zip destfile="${distribution.zip}">
    		<zipfileset file="${dist.jar}" prefix="${zip-foler-prefix}/"/>
    		<zipfileset dir="${lib.dir}" prefix="${zip-foler-prefix}">
    			<include name="*.jar"/>
    			<exclude name="junit*.jar"/>
    			<exclude name="hamcrest*.jar"/>
    		</zipfileset>
    		<zipfileset dir="${javadoc.dir}" prefix="${zip-foler-prefix}/doc/api">
    			<include name="**/*.*"/>
    		</zipfileset>
    		<zipfileset dir="${main-src.dir}" prefix="${zip-foler-prefix}">
    			<include name="**/*.*"/>
    		</zipfileset>
    		<zipfileset dir="${doc.dir}" prefix="${zip-foler-prefix}/doc">
    			<include name="**/*.*"/>
    			<include name="*"/>
			</zipfileset>
			<zipfileset dir="${ant-build.dir}/resources/etc" prefix="${zip-foler-prefix}/etc">
    			<include name="**/*.*"/>
			</zipfileset>
    	</zip>
	</target>

    <target name="clean">
        <delete dir="ant-build/output"/>
    </target>
</project>