This repository has been archived by the owner on Apr 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.xml
75 lines (65 loc) · 3.04 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="wikipedia" default="dist" basedir=".">
<property name="version" value="2.0.0" />
<property name="filename" value="newrelic_wikipedia_plugin-${version}"/>
<property name="jarfile" value="plugin.jar" />
<property name="tarfile" value="${filename}.tar.gz" />
<property name="build.dir" value="build" />
<property name="build.classes.dir" value="${build.dir}/classes"/>
<property name="build.jar.dir" value="${build.dir}/jar"/>
<property name="build.tar.dir" value="${build.dir}/tar"/>
<property name="build.tar.src.dir" value="${build.tar.dir}/${filename}"/>
<property name="src.dir" value="src" />
<property name="lib.dir" value="lib" />
<property name="conf.dir" value="config" />
<property name="dist.dir" location="dist" />
<property name="sdk.jar" value="${lib.dir}/metrics_publish-2.0.0.jar" />
<path id="classpath">
<pathelement location="${sdk.jar}" />
</path>
<target name="clean">
<echo>Cleaning project...</echo>
<delete dir="${build.dir}" />
<echo>Done.</echo>
</target>
<target name="init" depends="clean">
<echo>Creating directory: ${build.dir}</echo>
<mkdir dir="${build.dir}" />
</target>
<target name="compile" depends="init">
<!-- Compile the java code -->
<echo>Building project...</echo>
<mkdir dir="${build.classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${build.classes.dir}" target="1.6" source="1.6">
<classpath refid="classpath" />
</javac>
<echo>Done.</echo>
</target>
<target name="jar" depends="compile" description="create a jar file for the application">
<mkdir dir="${build.jar.dir}"/>
<tstamp />
<jar destfile="${build.jar.dir}/${jarfile}">
<manifest>
<attribute name="Specification-Title" value="New Relic Platform Wikipedia Example" />
<attribute name="Specification-Vendor" value="New Relic, Inc." />
<attribute name="Implementation-Vendor" value="New Relic, Inc." />
<attribute name="Built-Date" value="${TODAY}" />
<attribute name="Specification-Version" value="${version}" />
<attribute name="Implementation-Version" value="${version} ${TODAY}" />
<attribute name="Main-Class" value="com.newrelic.examples.wikipedia.Main" />
</manifest>
<fileset dir="${build.classes.dir}"/>
<zipfileset src="${sdk.jar}" />
</jar>
</target>
<target name="dist" depends="jar" description="create a downloadable file">
<mkdir dir="${build.tar.src.dir}" />
<copy todir="${build.tar.src.dir}/config">
<fileset dir="${conf.dir}" />
</copy>
<copy file="${build.jar.dir}/${jarfile}" todir="${build.tar.src.dir}" />
<tar compression="gzip" destfile="${dist.dir}/${tarfile}">
<tarfileset dir="${build.tar.dir}" />
</tar>
</target>
</project>