-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.xml
57 lines (48 loc) · 1.89 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
<?xml version="1.0"?>
<project name="fakehttp" default="jar" xmlns:ivy="antlib:org.apache.ivy.ant">
<import file="ivybootstrap.xml"/>
<target name="retrieve" depends="ivy.bootstrap" description="downloads jars for the project">
<ivy:resolve/>
<ivy:retrieve pattern="bin/lib/[conf]/[type]s/[artifact].[ext]" conf="*" type="*"/>
</target>
<target name="clean" description="delete the bin directory">
<delete dir="bin"/>
</target>
<target name="compile" depends="retrieve" description="compile src/ to bin/main/">
<path id="build.classpath">
<fileset dir="bin/lib/default" includes="**/*.jar"/>
<fileset dir="bin/lib/buildtime" includes="**/*.jar"/>
</path>
<taskdef resource="scala/tools/ant/antlib.xml">
<classpath>
<path refid="build.classpath" />
</classpath>
</taskdef>
<mkdir dir="bin/main"/>
<scalac destdir="bin/main" deprecation="on">
<src>
<pathelement path="src/main/scala" />
</src>
<classpath>
<path refid="build.classpath" />
</classpath>
</scalac>
</target>
<target name="jar" depends="compile" description="jar bin/main/ into bin/fakehttp.jar">
<jar destfile="bin/fakehttp.jar">
<fileset dir="bin/main" includes="**/*.class"/>
</jar>
<jar destfile="bin/fakehttp-all.jar" manifest="src/main/resources/manifest.mf">
<fileset dir="bin/main" includes="**/*.class"/>
<zipfileset src="bin/lib/default/jars/scala-library.jar" includes="**/*" />
<zipfileset src="bin/lib/default/bundles/netty.jar" includes="**/*" />
</jar>
</target>
<target name="run" depends="jar" description="Run the default Proxy">
<!-- Can override via command line, eg "ant run -Dproxy.port=8121" -->
<property name="proxy.port" value="8120" />
<java fork="true" jar="bin/fakehttp.jar">
<arg value="${proxy.port}" />
</java>
</target>
</project>