-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
90 lines (82 loc) · 3.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
<?xml version="1.0"?>
<project name="splice-certmaker" default="why">
<property environment="env" />
<property name="certmaker-home" location="." />
<property name="script.dir" location="${certmaker-home}/buildconf/" />
<property name="src.main.dir" location="${certmaker-home}/src/main/java" />
<property name="res.main.dir" location="${certmaker-home}/src/main/resources" />
<property name="webapp.main.dir" location="${certmaker-home}/src/main/webapp" />
<property name="src.test.dir" location="${certmaker-home}/src/test/java" />
<property name="res.test.dir" location="${certmaker-home}/src/test/resources" />
<property name="webapp.test.dir" location="${certmaker-home}/src/test/webapp" />
<property name="target.dir" location="${certmaker-home}/target" />
<property name="lib.dir" location="${libdir}" />
<property name="pkgname" value="org.candlepin.splice" />
<macrodef name="grepfromspec">
<attribute name="text" />
<attribute name="prop" />
<sequential>
<exec executable="${script.dir}/antgetvr" outputproperty="@{prop}">
<arg value="@{text}" />
</exec>
</sequential>
</macrodef>
<target name="why">
<echo message="This is for building in an rpm environment," />
<echo message="don't use otherwise. Please use buildr instead." />
</target>
<target name="setvr">
<grepfromspec text="Version:" prop="version" />
<grepfromspec text="Release:" prop="release" />
<property name="certmaker.jar"
value="${target.dir}/splice-certmaker.jar" />
</target>
<target name="init" depends="setvr"/>
<target name="compile" depends="init">
<mkdir dir="${target.dir}/classes" />
<mkdir dir="${target.dir}/resources" />
<javac destdir="${target.dir}/classes"
optimize="off"
debug="on"
source="1.6"
target="1.6"
encoding="utf-8"
fork="yes">
<src>
<path location="${src.main.dir}" />
<path location="${res.main.dir}" />
</src>
<classpath>
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>
<copy todir="${target.dir}/resources">
<fileset dir="${res.main.dir}" />
<filterset begintoken="$${" endtoken="}">
<filter token="version" value="${version}" />
<filter token="release" value="${release}" />
</filterset>
</copy>
</target>
<target name="package" depends="compile">
<jar destfile="${certmaker.jar}">
<fileset dir="${target.dir}/classes"/>
<fileset dir="${target.dir}/resources"/>
<manifest>
<attribute name="Implementation-Vendor" value="" />
<attribute name="Manifest-Version" value="1.0" />
<attribute name="Build-By" value="${env.USER}" />
<attribute name="Created-By" value="Buildr" />
<attribute name="Implementation-Version" value="" />
<attribute name="Implementation-Title" value="splice certmaker" />
<attribute name="Build-Jdk" value="" />
<attribute name="Main-Class" value="org.candlepin.splice.Main" />
</manifest>
</jar>
</target>
<target name="clean">
<delete dir="${target.dir}" quiet="true" />
</target>
</project>