forked from Kecon/JSocksProxy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
168 lines (139 loc) · 6.82 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
162
163
164
165
166
167
168
<?xml version="1.0" encoding="utf-8"?>
<!--
! This is the ANT build file for JSocksProxy
!
! JSocksProxy Copyright (c) 2006-2008 Kenny Colliander Nordin
!
! Licensed under the Apache License, Version 2.0 (the "License");
! you may not use this file except in compliance with the License.
! You may obtain a copy of the License at
!
! http://www.apache.org/licenses/LICENSE-2.0
!
! Unless required by applicable law or agreed to in writing, software
! distributed under the License is distributed on an "AS IS" BASIS,
! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! See the License for the specific language governing permissions and
! limitations under the License.
-->
<project name="JSocksProxy" default="usage">
<property file="build.properties" />
<description>JSocksProxy build file</description>
<!-- Set global properties for this build -->
<property name="src" location="src/main/java" />
<property name="binDir" location="bin" />
<property name="libDir" location="lib" />
<property name="docDir" location="doc" />
<property name="sarDir" location="sar" />
<property name="javadocDir" location="javadoc" />
<property name="distDir" location="dist" />
<property name="distConfDir" location="${distDir}/conf" />
<property name="distLibDir" location="${distDir}/lib" />
<property name="distOutput" location="${distDir}/jsocksproxy.zip" />
<property name="distSarOutput" location="${distDir}/jsocksproxy.sar" />
<property name="confDir" location="conf" />
<property name="jsocksproxyXml" location="${confDir}/jsocksproxy.xml" />
<property name="jarFile" location="${libDir}/jsocksproxy.jar" />
<!-- BUILD ALL TARGET -->
<target name="buildAll" depends="compile,jar" description="Compiles and builds the application" />
<!-- CLEAN TARGET -->
<target name="clean" description="Remove all compiled and dist files">
<delete dir="${binDir}" failonerror="false" />
<delete dir="${distDir}" failonerror="false" />
<delete dir="${javadocDir}" failonerror="false" />
<delete dir="${distSarOutput}" failonerror="false" />
<delete file="${sarDir}/jsocksproxy.jar" failonerror="false"/>
</target>
<!-- COMPILE TARGET-->
<target name="compile" description="Compile the source">
<mkdir dir="${binDir}" />
<!-- Setup classpath -->
<path id="class.path">
<pathelement path="${java.class.path}/" />
</path>
<!-- Compile the java code -->
<javac srcdir="${src}" destdir="${binDir}" debug="${app.debug}" target="1.6" source="1.6" includeantruntime="true">
<classpath refid="class.path" />
</javac>
</target>
<!-- JAR TARGET -->
<target name="jar" description="Make jar file from compiled binaries">
<mkdir dir="${libDir}" />
<!-- Create the time stamp -->
<tstamp>
<format property="jarTime" pattern="yyyy-MM-dd HH:mm" />
</tstamp>
<!-- Make .jar and place in dist lib. This is to enable the use of the methods in
java.lang.Package, such as getImplementationVersion() -->
<jar jarfile="${jarFile}" excludes="**/CVS/**">
<fileset dir="${binDir}" />
<fileset dir="${src}" includes="**/*.properties" />
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Compiled-With" value="${java.version}" />
<attribute name="Build-Date" value="${jarTime}" />
<attribute name="Implementation-Title" value="JSocksProxy" />
<attribute name="Implementation-Version" value="${app.version}-${DSTAMP}${TSTAMP}" />
<attribute name="Implementation-Vendor" value="Kenny Colliander Nordin, kecon.najt.nu" />
<attribute name="Implementation-URL" value="http://kecon.najt.nu/jsocksproxy/" />
<attribute name="Main-Class" value="nu.najt.kecon.jsocksproxy.admin.JSocksProxyAdmin" />
</manifest>
</jar>
</target>
<!-- MAKE DIST TARGET -->
<target name="dist" depends="compile,jar" description="Builds a zip package">
<mkdir dir="${distDir}" />
<mkdir dir="${distLibDir}" />
<mkdir dir="${distConfDir}" />
<mkdir dir="${distConfDir}/example" />
<delete file="${distOutput}" failonerror="false" />
<delete file="${distSarOutput}" failonerror="false" />
<copy tofile="${distConfDir}/example/jsocksproxy.xml" file="${jsocksproxyXml}" overwrite="true" preservelastmodified="true" />
<copy tofile="${distDir}/run.bat" file="${confDir}/run.bat" overwrite="true" preservelastmodified="true" />
<copy tofile="${distDir}/LICENSE-2.0.txt" file="${docDir}/LICENSE-2.0.txt" overwrite="true" preservelastmodified="true" />
<copy tofile="${distLibDir}/jsocksproxy.jar" file="${jarFile}" overwrite="true" preservelastmodified="true" />
<zip destfile="${distOutput}" basedir="${distDir}" />
<!-- Create .sar -->
<copy tofile="${sarDir}/jsocksproxy.jar" file="${jarFile}" overwrite="true" preservelastmodified="true" />
<!-- Make .sar and place in dist. This is to enable the use of the methods in
java.lang.Package, such as getImplementationVersion() -->
<jar jarfile="${distSarOutput}" excludes="**/CVS/**">
<fileset dir="${sarDir}" />
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Compiled-With" value="${java.version}" />
<attribute name="Build-Date" value="${jarTime}" />
<attribute name="Implementation-Title" value="JSocksProxy" />
<attribute name="Implementation-Version" value="${app.version}-${DSTAMP}${TSTAMP}" />
<attribute name="Implementation-Vendor" value="Kenny Colliander Nordin, kecon.najt.nu" />
<attribute name="Implementation-URL" value="http://kecon.najt.nu/jsocksproxy/" />
</manifest>
</jar>
</target>
<target name="javadoc" description="Make javadoc" depends="compile">
<javadoc destdir="${javadocDir}" sourcepath="${src}" doctitle="JSocksProxy ${app.version}" windowtitle="JSocksProxy ${app.version}">
<classpath refid="class.path" />
<package name="nu.najt.kecon.jsocksproxy" />
<package name="nu.najt.kecon.jsocksproxy.configuration" />
<package name="nu.najt.kecon.jsocksproxy.admin" />
<package name="nu.najt.kecon.jsocksproxy.socks4" />
<package name="nu.najt.kecon.jsocksproxy.socks5" />
</javadoc>
</target>
<!-- PRINT USAGE TARGET -->
<target name="usage">
<echo message="" />
<echo message="JSocksProxy build file" />
<echo message="-----------------------------------" />
<echo message="" />
<echo message="Available targets are:" />
<echo message="" />
<echo message="buildAll --> Compiles and make jar" />
<echo message="compile --> Compiles" />
<echo message="jar --> Make jar" />
<echo message="dist --> Compiles, make jar, zip and sar" />
<echo message="javadoc --> Compiles make javadoc" />
<echo message="clean --> Remove all compiled an dist files" />
<echo message="" />
</target>
</project>