-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.xml
162 lines (132 loc) · 6.08 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<project name="Hello-Disruptors" default="compile" basedir=".">
<description>Learning Disruptor Library</description>
<!-- load environment variables as properties -->
<property environment="env"/>
<!-- load properties files -->
<property file="build.properties"/>
<!-- default folder location properties -->
<property name="version" value="0.1"/> <!-- EDIT THIS TO UPDATE VERSION -->
<property name="src.rel-dir" value="src"/>
<property name="lib.rel-dir" value="lib"/>
<property name="tests.src.rel-dir" value="${src.rel-dir}/com/syngenta/mint/test"/>
<property name="etc.rel-dir" value="etc"/>
<property name="build.rel-dir" value="build"/>
<property name="dist.rel-dir" value="dist"/>
<property name="doc.rel-dir" value="doc" />
<property name="javadoc.rel-dir" value="doc/javadoc" />
<property name="jar.rel-file" value="${dist.rel-dir}/${ant.project.name}-${version}.jar" />
<property name="test.dir" location="${build.rel-dir}/test" />
<property name="test.data.dir" location="${test.dir}/data" />
<property name="test.reports.dir" location="${test.dir}/reports" />
<!-- project classpath -->
<path id="project.classpath">
<!-- compiled classes -->
<pathelement location="${build.rel-dir}" />
<!-- libraries -->
<fileset dir="${lib.rel-dir}">
<include name="*.jar" />
</fileset>
</path>
<!-- basic -->
<target name="init">
<mkdir dir="${build.rel-dir}"/>
<mkdir dir="${dist.rel-dir}"/>
<mkdir dir="${javadoc.rel-dir}"/>
</target>
<target name="clean" description="Delete all rebuildable files">
<delete dir="${build.rel-dir}" failonerror="false" deleteonexit="true" />
<delete dir="${dist.rel-dir}" failonerror="false" deleteonexit="true" />
<delete dir="${javadoc.rel-dir}" failonerror="false" deleteonexit="true" />
</target>
<!-- compile -->
<target name="prepare-resources" depends="init">
<!-- description="Prepare application resource files" -->
<copy todir="${build.rel-dir}" overwrite="true">
<fileset dir="${src.rel-dir}" includes="**/*.properties,**/*.xml" excludes="" />
</copy>
<!-- ~TODO: not sure why we need replace ... -->
<!-- Replace is a directory based task for replacing the occurrence of a given
string with another string in selected file -->
<replace dir="${build.rel-dir}" includes="**/*.properties,**/*.xml" excludes="" summary="true">
<replacefilter token="@example-token@" value="${example-property}" />
</replace>
</target>
<property name="compile.debug" value="true" />
<property name="compile.debuglevel" value="lines,vars,source" />
<target name="compile" depends="init,prepare-resources" description="Compile java classes">
<!-- description="Compile source code" -->
<javac
srcdir="${src.rel-dir}"
destdir="${build.rel-dir}"
debug="${compile.debug}"
debuglevel="${compile.debuglevel}"
includeantruntime="false"> <!-- to overcome misfeature in Ant 1.8 -->
<compilerarg line="-Xlint:unchecked" /> <!-- "-Xlint:all", "-Xlint:all,-path", "-Xlint:all,-path,-unchecked" -->
<classpath refid="project.classpath" />
</javac>
</target>
<!-- run -->
<target name="run-simple" depends="compile" description="Run SimplePublishConsumeDemo">
<java classname="demo.disruptor.SimplePublishConsumeDemo">
<classpath refid="project.classpath" />
</java>
</target>
<target name="run-wrap" depends="compile" description="Run WrapBehavior demo">
<java classname="demo.disruptor.WrapBehavior">
<classpath refid="project.classpath" />
</java>
</target>
<target name="run-ahead" depends="compile" description="Run PublishAhead demo">
<java classname="demo.disruptor.PublishAhead">
<classpath refid="project.classpath" />
</java>
</target>
<target name="run-parallel-consumers" depends="compile"
description="Run GateOnTwoConsumers demo">
<java classname="demo.disruptor.GateOnTwoConsumers">
<classpath refid="project.classpath" />
</java>
</target>
<target name="run-batchproc" depends="compile" description="Run BatchEventProcessorDemo">
<java classname="demo.disruptor.BatchEventProcessorDemo">
<classpath refid="project.classpath" />
</java>
</target>
<target name="run-workerpool" depends="compile" description="Run WorkerPoolDemo">
<java classname="demo.disruptor.WorkerPoolDemo">
<classpath refid="project.classpath" />
</java>
</target>
<target name="run-3pubs" depends="compile" description="Run ThreePublishersDemo">
<java classname="demo.disruptor.ThreePublishersDemo">
<classpath refid="project.classpath" />
</java>
</target>
<!-- Targets that use the Fluent DSL API -->
<target name="run-disruptor" depends="compile" description="Run SimpleDisruptor demo (uses Fluent DSL)">
<java classname="demo.disruptor.fluent_dsl.SimpleDisruptor">
<classpath refid="project.classpath" />
</java>
</target>
<target name="run-serial-consumers" depends="compile" description="Run DisruptorWithSerialConsumers demo (uses Fluent DSL)">
<java classname="demo.disruptor.fluent_dsl.DisruptorWithSerialConsumers">
<classpath refid="project.classpath" />
</java>
</target>
<target name="run-manypubs-dsl" depends="compile" description="Run MultiplePublishersUsingDisruptor demo (uses Fluent DSL)">
<java classname="demo.disruptor.fluent_dsl.MultiplePublishersUsingDisruptor">
<classpath refid="project.classpath" />
</java>
</target>
<target name="run-manypubs-dsl-no-translator" depends="compile" description="Run MultiplePublishersUsingDisruptorNoTranslator demo (uses Fluent DSL)">
<java classname="demo.disruptor.fluent_dsl.MultiplePublishersUsingDisruptorNoTranslator">
<classpath refid="project.classpath" />
</java>
</target>
<!-- LMAX Setup Simulator -->
<target name="run-lmax" depends="compile" description="Run LMAXSetup demo (simluates LMAX Published model)">
<java classname="demo.disruptor.lmaxsetup.LMAXSetup">
<classpath refid="project.classpath" />
</java>
</target>
</project>