forked from mdeanda/ajaxproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
114 lines (99 loc) · 3.71 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"?>
<project name="ajaxproxy" basedir="." default="build">
<property file="${user.home}/.ant/build.properties"/>
<property file="build.properties"/>
<property name="doc.dir" value="doc"/>
<property name="dist.dir" value="dist"/>
<property name="lib.dir" value="lib"/>
<property name="src.dir" value="src"/>
<property name="build.dir" value="bin"/>
<property name="main.class" value="com.thedeanda.ajaxproxy.Main"/>
<property name="temp.dir" value="tmp"/>
<path id="classpath">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
<pathelement path="${build.dir}"/>
</path>
<!-- This cleans the build -->
<target name="clean" description="Clean">
<delete dir="${build.dir}"/>
<delete dir="${lib.dir}"/>
</target>
<target name="prepare" description="Copies files to build directory">
<mkdir dir="${build.dir}"/>
<!-- copy files in src to classes directory -->
<copy todir="${build.dir}">
<fileset dir="${src.dir}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="jars" depends="prepare">
<taskdef name="easyget" classname="net.sf.easygettask.EasyGet"
classpath="${dist.dir}/easygettask.jar"/>
<mkdir dir="${lib.dir}"/>
<easyget dest="${lib.dir}">
<mirror url="http://jars.thedeanda.com"/>
<get path="net/sf/javajson" file="javajson-20120103.jar"/>
<get path="org/apache/commons-cli" file="commons-cli-1.1.jar"/>
<get path="org/apache/commons-httpclient" file="commons-httpclient-3.1.jar"/>
<get path="org/apache/commons-io" file="commons-io-1.4.jar"/>
<get path="org/apache/commons-lang" file="commons-lang-2.1.jar"/>
<get path="org/apache/commons-logging" file="commons-logging-1.0.4.jar"/>
<get path="org/apache/log4j" file="log4j-1.2.14.jar"/>
<get path="org/mortbay/jetty" file="jetty-6.1.26.jar"/>
<get path="org/mortbay/jetty-client" file="jetty-client-6.1.15.jar"/>
<get path="org/mortbay/jetty-sslengine" file="jetty-sslengine-6.1.15.jar"/>
<get path="org/mortbay/jetty-util" file="jetty-util-6.1.26.jar"/>
<get path="org/mortbay/servlet-api" file="servlet-api-2.5-20081211.jar"/>
<get path="com/yahoo" file="yuicompressor-2.4.2.jar"/>
<get path="com/miglayout" file="swingmiglayout-3.0.3.jar"/>
<get path="org/dom4j" file="dom4j-1.6.1.jar" />
</easyget>
</target>
<target name="build" depends="jars" description="Compile main source tree java files">
<javac destdir="${build.dir}" debug="true" target="1.5"
deprecation="false" optimize="false"
includeantruntime="false" failonerror="true">
<compilerarg value="-Xlint:unchecked"/>
<src path="${src.dir}"/>
<classpath refid="classpath"/>
</javac>
</target>
<target name="javadoc" description="Builds javadocs">
<mkdir dir="${doc.dir}"/>
<javadoc sourcepath="${src.dir}" destdir="${doc.dir}"
author="true" version="true" use="true">
<classpath refid="classpath"/>
<packageset dir="${src.dir}">
<include name="com/thedeanda/**"/>
</packageset>
</javadoc>
</target>
<target name="dist" depends="clean, build"
description="Builds jar file">
<mkdir dir="${dist.dir}"/>
<!--jar destfile="${dist.dir}/${ant.project.name}.jar" basedir="${build.dir}"/-->
<delete dir="${temp.dir}"/>
<mkdir dir="${temp.dir}"/>
<unzip dest="${temp.dir}">
<fileset dir="${lib.dir}"/>
</unzip>
<copy todir="${temp.dir}">
<fileset dir="${build.dir}"/>
</copy>
<jar destfile="${dist.dir}/${ant.project.name}.jar" basedir="${temp.dir}">
<manifest>
<attribute name="Main-Class"
value="${main.class}"/>
</manifest>
</jar>
</target>
<target name="run" depends="build" description="runs application">
<java maxmemory="2"
classpathref="classpath"
classname="${main.class}"
/>
</target>
</project>