This repository has been archived by the owner on May 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathbuild.xml
114 lines (99 loc) · 4.61 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="newrelic-plugins" default="dist" basedir=".">
<property name="version" value="2.0.0" />
<property name="filename" value="newrelic_3legs_plugin-${version}" />
<property name="jarfile" value="plugin.jar" />
<property name="tarfile_full" value="${filename}.tar.gz" />
<property name="tarfile_cassandra" value="${filename}-cassandra.tar.gz" />
<property name="tarfile_jmxremote" value="${filename}-jmxremote.tar.gz" />
<property name="tarfile_varnish" value="${filename}-varnish.tar.gz" />
<property name="build.dir" location="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="dist.dir" location="dist/${version}" />
<property name="src.dir" location="src" />
<property name="lib.dir" location="lib" />
<property name="conf.dir" location="config" />
<property name="platform-metrics-java" value="${lib.dir}/metrics_publish-2.0.0.jar" />
<property name="typesafe-config" value="${lib.dir}/config-1.0.1.jar" />
<path id="classpath">
<pathelement location="${platform-metrics-java}" />
<pathelement location="${typesafe-config}" />
</path>
<target name="clean">
<echo>Cleaning project...</echo>
<delete dir="${build.dir}" />
<delete dir="${dist.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="Newrelic Plugin" />
<attribute name="Specification-Vendor" value="3legs" />
<attribute name="Implementation-Vendor" value="3legs" />
<attribute name="Built-Date" value="${TODAY}" />
<attribute name="Specification-Version" value="${version}" />
<attribute name="Implementation-Version" value="${version} ${TODAY}" />
<attribute name="Main-Class" value="ar.com.threelegs.newrelic.Main" />
</manifest>
<fileset dir="${build.classes.dir}" />
<zipfileset src="${platform-metrics-java}" />
<zipfileset src="${typesafe-config}" />
</jar>
</target>
<target name="prepare" depends="jar" description="prepare package">
<mkdir dir="${build.tar.src.dir}" />
<copy todir="${build.tar.src.dir}/config">
<fileset dir="${conf.dir}">
<exclude name="newrelic.json" />
<exclude name="plugin.json" />
</fileset>
</copy>
<copy file="LICENSE" todir="${build.tar.src.dir}" />
<copy file="README.md" todir="${build.tar.src.dir}" />
<copy file="${build.jar.dir}/${jarfile}" todir="${build.tar.src.dir}" />
</target>
<target name="dist_cassandra" depends="prepare" description="create a downloadable file">
<copy file="env/cassandra/plugin.template.json" overwrite="true" todir="${build.tar.src.dir}/config" />
<tar compression="gzip" destfile="${dist.dir}/${tarfile_cassandra}">
<tarfileset dir="${build.tar.dir}" />
</tar>
</target>
<target name="dist_jmxremote" depends="prepare" description="create a downloadable file">
<copy file="env/jmxremote/plugin.template.json" overwrite="true" todir="${build.tar.src.dir}/config" />
<tar compression="gzip" destfile="${dist.dir}/${tarfile_jmxremote}">
<tarfileset dir="${build.tar.dir}" />
</tar>
</target>
<target name="dist_varnish" depends="prepare" description="create a downloadable file">
<copy file="env/varnish/plugin.template.json" overwrite="true" todir="${build.tar.src.dir}/config" />
<tar compression="gzip" destfile="${dist.dir}/${tarfile_varnish}">
<tarfileset dir="${build.tar.dir}" />
</tar>
</target>
<target name="dist_full" depends="prepare" description="create a downloadable file">
<copy file="env/full/plugin.template.json" overwrite="true" todir="${build.tar.src.dir}/config" />
<tar compression="gzip" destfile="${dist.dir}/${tarfile_full}">
<tarfileset dir="${build.tar.dir}" />
</tar>
</target>
<target name="dist" depends="dist_full, dist_cassandra, dist_jmxremote, dist_varnish" description="create a downloadable file" />
</project>