-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
executable file
·167 lines (124 loc) · 5.21 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
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
<?xml version="1.0"?>
<project name="twinkle" default="default">
<!-- ============================================ -->
<!-- Load build properties -->
<!-- ============================================ -->
<property file="info.properties" />
<condition property="os.mac">
<os family="mac"/>
</condition>
<!-- ============================================ -->
<!-- Load external tasks -->
<!-- ============================================ -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${project.antdir}/ant-contrib-1.0b3.jar" />
</classpath>
</taskdef>
<!-- ============================================ -->
<!-- Specify the classpath -->
<!-- ============================================ -->
<path id="project.classpath">
<fileset dir="${project.libdir}">
<include name="${project.libs}" />
</fileset>
</path>
<!-- ============================================ -->
<!-- The default target -->
<!-- ============================================ -->
<target name="default" depends="dist"/>
<!-- ============================================ -->
<!-- Compile the java sources to classes -->
<!-- ============================================ -->
<target name="compile" depends="version"
description="Compile the Java sources to class files">
<javac srcdir="${project.source}" destdir="${project.bin}" classpathref="project.classpath"/>
</target>
<!-- ============================================ -->
<!-- Pack the java classes in a jar file -->
<!-- ============================================ -->
<target name="jar" depends="compile"
description="Packs classes and dependencies into a jar">
<mkdir dir="${project.deploy.jar}" />
<pathconvert property="jar.classpath" pathsep=" ">
<path refid="project.classpath" />
<chainedmapper>
<flattenmapper />
<globmapper from="*" to="${project.deploy.jarlibs}/*" />
</chainedmapper>
</pathconvert>
<jar destfile="${project.deploy.jar}/${project.deploy.jarname}" index="false">
<fileset dir="${project.bin}" excludes="${project.pluginptrn}/** **/tests/**" />
<manifest>
<attribute name="Created-By" value="${info.software.author}" />
</manifest>
</jar>
<copy todir="${project.deploy.jar}">
<fileset dir="${basedir}">
<include name="${project.conf}" />
</fileset>
</copy>
</target>
<!-- ============================================ -->
<!-- Pack the generated files for distribution -->
<!-- ============================================ -->
<target name="dist" depends="jar"
description="Packs the generated files for distribution">
<zip destfile="${project.deploy}/${ant.project.name}_jar.zip">
<zipfileset dir="${project.deploy.jar}" />
</zip>
</target>
<target name="docs"
description="Builds the Javadoc documentation for the project">
<javadoc packagenames="barrysoft.jsubsgetter.*"
sourcepath="${project.source}"
destdir="${project.docs.dir}"
classpathref="project.classpath"
author="true"
version="true"
use="true"
windowtitle="${project.name} Documentation"/>
</target>
<!-- ============================================ -->
<!-- Remove any generated file -->
<!-- ============================================ -->
<target name="clean"
description="Remove any generated file">
<delete quiet="true">
<fileset dir="${project.bin}" includes="**/*" />
</delete>
<delete quiet="true">
<fileset dir="${project.deploy}" includes="**/*" />
</delete>
</target>
<!-- ============================================ -->
<!-- Embedd version and build informations -->
<!-- ============================================ -->
<target name="version"
description="Embed version and build informations">
<propertyfile file="${project.buildfile}" comment="Build Informations (Autogenerated)">
<entry key="build.number" type="int" default="0000" operation="+" pattern="0000" />
<entry key="build.date" type="date" value="now" pattern="dd/MM/yyyy HH:mm" />
<entry key="build.year" type="date" value="now" pattern="yyyy" />
<entry key="build.copyright" type="string" value="(c) ${build.year} ${info.software.author}" />
<entry key="build.os" type="string" value="${os.name}" />
<entry key="build.name" type="string" value="${ant.project.name}" />
</propertyfile>
<property file="${project.buildfile}"/>
<echo>Write build info to file ${info.dest}/${info.source}</echo>
<copy overwrite="true" file="${project.res.dir}/${info.source}"
tofile="${info.dest}/${info.source}">
<filterset begintoken="@@" endtoken="@@">
<filter token="NAME" value="${info.software.name}" />
<filter token="AUTHOR" value="${info.software.author}" />
<filter token="COPYRIGHT" value="${build.copyright}" />
<filter token="WEBSITE" value="${info.website}" />
<filter token="VERSION" value="${info.version}" />
<filter token="ABOUTIMAGE" value="${info.about.image}" />
<filter token="REVISION" value="${info.revision.number}" />
<filter token="BLDDATE" value="${build.date}" />
<filter token="BLDNUM" value="${build.number}" />
</filterset>
</copy>
</target>
</project>