-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
115 lines (100 loc) · 4.81 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
<project name="NeRPN" default="dist" basedir=".">
<description>NeRPN, a Markdown viewer, by Eron Hennessey</description>
<!-- set global properties for this build -->
<property name="src" location="src/abstrys/NeRPN"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="pkg" location="pkg"/>
<target name="init" depends="clean">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init" description="compile the source">
<path id="build.classpath">
<fileset dir="${basedir}"/>
</path>
<!-- Compile the java code from ${src} into ${build} -->
<javac includeantruntime="false" debug="true" srcdir="${src}" destdir="${build}">
<classpath>
<pathelement path="${build.classpath}"/>
</classpath>
</javac>
</target>
<target name="dist" depends="compile" description="generate the distribution">
<!-- Create the distribution directory -->
<!-- Construct the manifest's classpath -->
<pathconvert property="manifest.classpath" pathsep=" ">
<path refid="build.classpath"/>
<mapper>
<chainedmapper>
<flattenmapper/>
</chainedmapper>
</mapper>
</pathconvert>
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
<jar jarfile="${dist}/NeRPN.jar" basedir="${build}">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="abstrys.NeRPN.NeRPN"/>
<attribute name="Class-Path" value="${manifest.classpath}"/>
<section name="common">
<attribute name="Specification-Title" value="NeRPN"/>
<attribute name="Specification-Version" value="1.0"/>
<attribute name="Specification-Vendor" value="Eron Hennessey / Abstrys"/>
<attribute name="Implementation-Title" value="NeRPN"/>
<attribute name="Implementation-Version" value="${version} ${TODAY}"/>
<attribute name="Implementation-Vendor" value="Eron Hennessey / Abstrys"/>
</section>
</manifest>
</jar>
</target>
<target name="copy_license" depends="dist"
description="copy the license files into the dist directory">
<!-- Copy the License and Readme files. -->
<copy file="LICENSE" todir="${dist}"/>
<copy file="README.md" tofile="${dist}/README.txt"/>
</target>
<target name="pkg_nix" depends="copy_license"
description="package NeRPN in a .tar.bz2 file for distribution on Unix-like systems.">
<!-- Copy the *nix shell files. -->
<copy file="shell/install.sh" todir="${dist}"/>
<!-- tar it up! -->
<tar destfile="${build}/NeRPN.tar" longfile="gnu">
<!-- put the right permissions on the executable files -->
<tarfileset dir="${dist}" filemode="755" prefix="NeRPN-${DSTAMP}">
<include name="install.sh"/>
</tarfileset>
<!-- and just include the rest... -->
<tarfileset dir="${dist}" prefix="NeRPN-${DSTAMP}">
<include name="**"/>
<exclude name="install.sh"/>
</tarfileset>
</tar>
<!-- make sure the pkg directory is there -->
<mkdir dir="${pkg}"/>
<gzip destfile="${pkg}/NeRPN-${DSTAMP}.tar.gz" src="${build}/NeRPN.tar"/>
<bzip2 destfile="${pkg}/NeRPN-${DSTAMP}.tar.bz2" src="${build}/NeRPN.tar"/>
</target>
<target name="pkg_win" depends="copy_license"
description="package NeRPN in a .zip file for distribution on Microsoft Windows">
<!-- Make the zipfile, containing everything within the `dist` directory -->
<mkdir dir="${pkg}"/>
<zip destfile="${pkg}/NeRPN-${DSTAMP}.zip" update="true">
<zipfileset dir="${dist}" prefix="NeRPN-${DSTAMP}">
<include name="**"/>
</zipfileset>
</zip>
</target>
<target name="pkg_all" depends="pkg_win,pkg_nix"
description="package NeRPN for all supported platforms"/>
<target name="clean" description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<target name="spotless" depends="clean" description="clean up *everything*, including the pkg directory">
<delete dir="${pkg}"/>
</target>
</project>