/
build.xml
84 lines (71 loc) · 2.69 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2010-2012 napile.org
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project name="java2napile.runtime" default="dist" basedir=".">
<property name="build.version" value="0.1" />
<property name="dist" location="dist" />
<property name="lib" location="lib" />
<property name="build" location="build" />
<property name="build.classes" location="${build}/classes" />
<property name="build.dist" location="${build}/dist" />
<tstamp>
<format property="build.tstamp" pattern="HH:mm dd.MM.yyyy" />
</tstamp>
<target name="clean" description="Remove the output directories.">
<delete dir="${build}" />
</target>
<target name="init" description="Create the output directories.">
<mkdir dir="${build}" />
</target>
<macrodef name="compile">
<attribute name="name" />
<sequential>
<antcall target="init" />
<delete dir="${build.classes}/" />
<mkdir dir="${build.classes}" />
<path id="classpath">
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</path>
<javac srcdir="src/main/java" destdir="${build.classes}" source="1.6" target="1.6" encoding="UTF-8" nowarn="off" classpathref="classpath">
<compilerarg value="-Xlint:all" />
</javac>
<jar destfile="${build.dist}/@{name}-${build.version}.jar">
<fileset dir="${build.classes}" />
<manifest>
<attribute name="Build-By" value="${user.name}" />
<attribute name="Build-Date" value="${build.tstamp}" />
<attribute name="Implementation-Version" value="${build.version}" />
</manifest>
</jar>
<jar destfile="${build.dist}/@{name}-${build.version}-sources.jar">
<fileset dir="src/main/java" />
<manifest>
<attribute name="Build-By" value="${user.name}" />
<attribute name="Build-Date" value="${build.tstamp}" />
<attribute name="Implementation-Version" value="${build.version}" />
</manifest>
</jar>
</sequential>
</macrodef>
<target name="build.libs">
<compile name="${ant.project.name}" />
</target>
<target name="dist" depends="clean, init, build.libs">
<zip destfile="${build}/${ant.project.name}-${build.version}-full.zip" basedir="${build.dist}" />
</target>
</project>