-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.xml
99 lines (76 loc) · 3.32 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
<?xml version="1.0"?>
<project name="stackimpact" basedir="." default="bin">
<property name="src.dir" value="src"/>
<property name="lib.dir" value="lib"/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="classes"/>
<property name="dist.dir" value="dist"/>
<target name="build-jar">
<mkdir dir="${classes.dir}"/>
<mkdir dir="${dist.dir}"/>
<exec executable="make" failonerror="true">
</exec>
<delete includeEmptyDirs="true">
<fileset dir="${dist.dir}" />
</delete>
<copy todir="${classes.dir}">
<fileset dir="${build.dir}"/>
</copy>
<javac destdir="${classes.dir}" source="1.7" target="1.7" debug="true">
<src path="${src.dir}" />
<include name="com/eclipsesource/json/**"/>
<include name="com/stackimpact/agent/**"/>
</javac>
<jar manifest="${src.dir}/META-INF/MANIFEST.MF" destfile="${dist.dir}/stackimpact.jar">
<fileset dir="${classes.dir}" />
</jar>
</target>
<target name="build-tests">
<mkdir dir="${classes.dir}"/>
<javac destdir="${classes.dir}" source="1.7" target="1.7" debug="true">
<src path="${src.dir}" />
<include name="test/stackimpact/agent/**"/>
<classpath>
<pathelement location="${lib.dir}/junit-4.12.jar"/>
</classpath>
</javac>
<jar destfile="${dist.dir}/stackimpact-test.jar">
<fileset dir="${classes.dir}" />
</jar>
</target>
<target name="run-tests">
<delete>
<fileset dir="/tmp">
<include name="libstackimpact-*"/>
</fileset>
</delete>
<junit printsummary="yes" haltonfailure="yes">
<jvmarg value="-Xcheck:jni"/>
<jvmarg value="-XX:OnError='jstack -F %p'"/>
<classpath>
<pathelement location="${lib.dir}/junit-4.12.jar"/>
<pathelement location="${lib.dir}/hamcrest-core-1.3.jar"/>
<pathelement location="${dist.dir}/stackimpact.jar"/>
<pathelement location="${dist.dir}/stackimpact-test.jar"/>
</classpath>
<formatter type="plain" usefile="false"/>
<test name="test.stackimpact.agent.StackImpactTest"/>
<test name="test.stackimpact.agent.APIRequestTest"/>
<test name="test.stackimpact.agent.ConfigLoaderTest"/>
<test name="test.stackimpact.agent.MessageQueueTest"/>
<test name="test.stackimpact.agent.model.MetricTest"/>
<test name="test.stackimpact.agent.model.BreakdownTest"/>
<test name="test.stackimpact.agent.reporters.ProcessReporterTest"/>
<test name="test.stackimpact.agent.profilers.CPUProfilerTest"/>
<test name="test.stackimpact.agent.profilers.LockProfilerTest"/>
</junit>
</target>
<target name="cleanup">
<delete includeEmptyDirs="true">
<fileset erroronmissingdir="false" dir="${classes.dir}" />
</delete>
</target>
<target name="bin" depends="build-jar, cleanup" />
<target name="test" depends="build-jar, build-tests, run-tests, cleanup" />
<target name="test-nobuild" depends="run-tests, cleanup" />
</project>