/
build.xml
120 lines (102 loc) · 3.82 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
<?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="velocity" default="dist" basedir=".">
<property name="build.version" value="2.0dev" />
<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="main.compile">
<attribute name="dir" />
<attribute name="name" />
<sequential>
<antcall target="init" />
<delete dir="${build.classes}/@{dir}" />
<mkdir dir="${build.classes}/@{dir}" />
<mkdir dir="${build.dist}/@{name}" />
<javac srcdir="@{dir}/src/main/java" destdir="${build.classes}/@{dir}" source="1.6" target="1.6" encoding="UTF-8" nowarn="off" classpathref="classpath">
<compilerarg value="-Xlint:all" />
</javac>
<copy todir="${build.classes}/@{dir}" failonerror="false">
<fileset dir="@{dir}/src/main/resources">
<include name="**/*.properties" />
</fileset>
</copy>
<jar destfile="${build.dist}/@{name}/@{name}-${build.version}.jar">
<fileset dir="${build.classes}/@{dir}" />
<manifest>
<attribute name="Build-By" value="${user.name}" />
<attribute name="Build-Date" value="${build.tstamp}" />
<attribute name="Implementation-Version" value="${build.version}" />
</manifest>
</jar>
<copy todir="${build.dist}/@{name}">
<fileset dir="@{dir}/lib">
<include name="*.jar" />
<exclude name="*-sources.jar" />
</fileset>
</copy>
</sequential>
</macrodef>
<macrodef name="core.compile">
<attribute name="dir" />
<attribute name="name" />
<sequential>
<path id="classpath">
<fileset dir="@{dir}/lib">
<include name="**/*.jar" />
</fileset>
</path>
<main.compile name="@{name}" dir="@{dir}" />
</sequential>
</macrodef>
<macrodef name="etc.compile">
<attribute name="dir" />
<attribute name="name" />
<sequential>
<path id="classpath">
<fileset dir="@{dir}/lib">
<include name="**/*.jar" />
</fileset>
<fileset dir="${build.dist}/${ant.project.name}">
<include name="${ant.project.name}-${build.version}.jar" />
</fileset>
</path>
<main.compile name="@{name}" dir="@{dir}" />
</sequential>
</macrodef>
<target name="build.libs">
<core.compile dir="${ant.project.name}-engine-core" name="${ant.project.name}" />
<etc.compile dir="${ant.project.name}-engine-commons-logging" name="${ant.project.name}-commons-logging" />
<etc.compile dir="${ant.project.name}-engine-log4j" name="${ant.project.name}-log4j" />
<etc.compile dir="${ant.project.name}-engine-servlet" name="${ant.project.name}-servlet" />
<etc.compile dir="${ant.project.name}-engine-slf4j" name="${ant.project.name}-slf4j" />
</target>
<target name="dist" depends="clean, init, build.libs">
<zip destfile="${build}/${ant.project.name}-${build.version}-full.zip" basedir="${build.dist}" />
</target>
</project>