This repository has been archived by the owner on Aug 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
128 lines (109 loc) · 4 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
<?xml version="1.0"?>
<project name="Imperium" default="dist" basedir=".">
<description>
Clark & Parsia Empire Plugin for the Play! framework, Imperium
</description>
<!-- Global Properties -->
<property name="core.src" location="core/src" />
<property name="core.lib" location="core/lib" />
<property name="build" location="build" />
<property name="dist" location="dist" />
<property name="dist.module" location="${dist}/module"/>
<property name="project.name" value="imperium" />
<property name="project.version" value="0.2" />
<path id="project.class.path">
<pathelement location="${core.lib}" />
<pathelement location="${build}" />
<fileset dir="${core.lib}">
<include name="**/*.jar"/>
<exclude name="**/${project.name}*.jar"/>
</fileset>
</path>
<target name="init">
<pathconvert targetos="unix" property="classpath" refid="project.class.path" />
<echo>CLASSPATH=${classpath}</echo>
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init"
description="Compile source files." >
<javac source="1.5" target="1.5" srcdir="${core.src}" destdir="${build}" debug="yes" deprecation="yes">
<classpath refid="project.class.path"/>
</javac>
</target>
<target name="build" depends="compile"
description="Compile sources and copy data files into build directory.">
<copy todir="${build}">
<fileset dir="${core.src}">
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target name="distfiles">
<!-- Copy in lib files -->
<mkdir dir="${dist}/lib" />
<copy todir="${dist}/src">
<fileset dir="${core.src}">
<include name="**/*.java" />
</fileset>
</copy>
<copy todir="${dist}/lib">
<fileset dir="${core.lib}">
<include name="**/*.jar" />
<exclude name="**/${project.name}*.jar"/>
</fileset>
</copy>
</target>
<target name="dist" depends="build,distfiles"
description="Generate a distribution" >
<!-- Generate relative classpath for jar file -->
<property name="rlib" location="${core.lib}"/>
<pathconvert dirsep="/" pathsep=" " property="Class-Path">
<map from="${rlib}/" to=""/>
<map from="${rlib}\" to=""/>
<path>
<fileset dir="${rlib}">
<include name="**/*.jar" />
</fileset>
</path>
</pathconvert>
<echo>${Class-Path}</echo>
<!-- Make Jar file. -->
<jar jarfile="${dist}/lib/${project.name}-${project.version}.jar"
basedir="${build}">
</jar>
</target>
<target name="module" depends="clean">
<mkdir dir="${dist}"/>
<mkdir dir="${dist.module}"/>
<mkdir dir="${dist.module}/app"/>
<mkdir dir="${dist.module}/lib"/>
<copy todir="${dist.module}/lib" flatten="true">
<fileset dir="${core.lib}">
<include name="**/*.jar" />
<exclude name="**/${project.name}*.jar"/>
<exclude name="**/play*.jar"/>
</fileset>
</copy>
<copy todir="${dist.module}/app">
<fileset dir="${core.src}">
<include name="**/*.java" />
</fileset>
</copy>
</target>
<target name="clean" description="Clean up build files">
<delete dir="${build}" />
<delete dir="${dist}" />
</target>
<target name="dist-zip" depends="dist">
<zip destfile="${dist}/${project.name}-${DSTAMP}.zip">
<zipfileset dir="${dist}">
<include name="**/*"/>
<exclude name="**/src/**"/>
<exclude name="**/*.zip"/>
</zipfileset>
</zip>
</target>
</project>