forked from nijikokun/General
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
180 lines (166 loc) · 7.42 KB
/
Copy pathbuild.xml
File metadata and controls
180 lines (166 loc) · 7.42 KB
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
169
170
171
172
173
174
175
176
177
178
179
180
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="General" default="build" basedir=".">
<property name="src" location="src"/>
<property name="rsrc" location="resources"/>
<property name="allpay" location="dep/allpay/src"/>
<property name="lib" location="../lib"/>
<property name="target" location="target"/>
<property name="classes" location="${target}/classes"/>
<property name="artifacts" location="${target}/artifacts"/>
<property name="dist" location="${target}/dist"/>
<property name="reports" location="junit"/>
<property name="junit-home" location="/usr/share/java/junit-4.10/"/>
<property name="tests" value="**/*Test.java"/>
<property name="CraftBukkit" value="craftbukkit.jar"/>
<property name="iConomy4" value="economy/iConomy4.jar"/>
<property name="iConomy5" value="economy/iConomy5.jar"/>
<property name="iConomy6" value="economy/iConomy6.jar"/>
<property name="BOSEconomy" value="economy/BOSEconomy.jar"/>
<property name="EssentialsEco" value="economy/Essentials.jar"/>
<property name="RealShop" value="economy/RealShop.jar"/>
<property name="MultiCurrency" value="economy/MultiCurrency.jar"/>
<property name="EconXP" value="economy/EconXP.jar"/>
<property name="BookWorm" value="BookWorm.jar"/>
<property name="CraftIRC" value="irc/CraftIRC.jar"/>
<loadfile srcFile="${rsrc}/plugin.yml" property="version">
<filterchain>
<linecontainsregexp>
<regexp pattern="^version:\s*.*$"/>
</linecontainsregexp>
<tokenfilter>
<replaceregex pattern="^version:\s*(.*)$" replace="\1"/>
</tokenfilter>
<striplinebreaks/>
</filterchain>
</loadfile>
<loadfile srcFile="${allpay}/../pom.xml" property="allpay.version">
<filterchain>
<linecontains>
<contains value="version"/>
</linecontains>
<tokenfilter>
<replaceregex pattern="\s+<version>([0-9.]+)</version>" replace="\1"/>
</tokenfilter>
<headfilter lines="1"/>
<striplinebreaks/>
</filterchain>
</loadfile>
<target name="info">
<echo message="Building ${ant.project.name} version ${version}..."/>
</target>
<target name="init" depends="info">
<mkdir dir="${lib}"/>
<mkdir dir="${target}"/>
<mkdir dir="${classes}"/>
</target>
<target name="update" depends="init">
<echo message="Downloading dependencies to ${lib}..."/>
<!-- Economies for AllPay -->
<get src="http://repo.onarandombox.com/content/repositories/bukkit-econ/ca/agnate/EconXP/1.0.0/EconXP-1.0.0.jar"
dest="${lib}/economy/EconXP.jar" usetimestamp="true"/>
<get src="http://repo.onarandombox.com/content/repositories/bukkit-econ/cosine/boseconomy/BOSEconomy/0.6.2/BOSEconomy-0.6.2.jar"
dest="${lib}/economy/BOSEconomy.jar" usetimestamp="true"/>
<get src="http://repo.onarandombox.com/content/repositories/bukkit-econ/com/earth2me/essentials/Essentials/2.4.2/Essentials-2.4.2.jar"
dest="${lib}/economy/Essentials.jar" usetimestamp="true"/>
<get src="http://repo.onarandombox.com/content/repositories/bukkit-econ/com/iCo6/iConomy/6.0/iConomy-6.0.jar"
dest="${lib}/economy/iConomy6.jar" usetimestamp="true"/>
<get src="http://repo.onarandombox.com/content/repositories/bukkit-econ/com/iConomy/iConomy/5.0/iConomy-5.0.jar"
dest="${lib}/economy/iConomy5.jar" usetimestamp="true"/>
<get src="http://repo.onarandombox.com/content/repositories/bukkit-econ/com/nijiko/coelho/iConomy/iConomy/4.65/iConomy-4.65.jar"
dest="${lib}/economy/iConomy4.jar" usetimestamp="true"/>
<get src="http://repo.onarandombox.com/content/repositories/bukkit-econ/fr/crafter/tickleman/RealShop/RealShop/0.63/RealShop-0.63.jar"
dest="${lib}/economy/RealShop.jar" usetimestamp="true"/>
<get src="http://repo.onarandombox.com/content/repositories/bukkit-econ/me/ashtheking/currency/MultiCurrency/0.09/MultiCurrency-0.09.jar"
dest="${lib}/economy/MultiCurrency.jar" usetimestamp="true"/>
<!-- Other dependencies -->
<get src="http://dl.phozop.net/CraftIRC/v3/CraftIRC.jar" dest="${lib}/irc/CraftIRC.jar" usetimestamp="true"/>
<get src="http://cfapi.lukegb.com/dl/bookworm/" dest="${lib}/BookWorm.jar" usetimestamp="true"/>
<get src="http://dl.bukkit.org/latest-dev/craftbukkit.jar" dest="${lib}" usetimestamp="true"/>
</target>
<target name="allpay" depends="init">
<echo message="Building AllPay version ${allpay.version}..."/>
<javac srcdir="${allpay}" destdir="${classes}" includeantruntime="false" debug="on" deprecation="on">
<classpath>
<pathelement location="${lib}/${CraftBukkit}"/>
<pathelement location="${lib}/${iConomy4}"/>
<pathelement location="${lib}/${iConomy5}"/>
<pathelement location="${lib}/${iConomy6}"/>
<pathelement location="${lib}/${BOSEconomy}"/>
<pathelement location="${lib}/${EssentialsEco}"/>
<pathelement location="${lib}/${RealShop}"/>
<pathelement location="${lib}/${MultiCurrency}"/>
<pathelement location="${lib}/${EconXP}"/>
</classpath>
</javac>
<concat destfile="${rsrc}/allpay.properties">version=${allpay.version}</concat>
</target>
<target name="compile" depends="allpay">
<javac srcdir="${src}" excludes="${tests}" destdir="${classes}"
includeantruntime="false" debug="on" deprecation="on">
<classpath>
<pathelement location="${lib}/${CraftBukkit}"/>
<pathelement location="${lib}/${BookWorm}"/>
<pathelement location="${lib}/${CraftIRC}"/>
</classpath>
</javac>
</target>
<target name="build" depends="compile">
<mkdir dir="${artifacts}"/>
<jar jarfile="${artifacts}/${ant.project.name}.jar" update="false">
<fileset dir="${classes}/" excludes="${tests}"/>
<fileset dir="${rsrc}/"/>
</jar>
</target>
<target name="clean" depends="info">
<delete dir="${artifacts}"/>
<delete dir="${classes}"/>
</target>
<target name="dist" depends="clean,junit,build">
<property name="zip" value="${dist}/zip.tmp"/>
<mkdir dir="${dist}"/>
<mkdir dir="${zip}"/>
<copy file="${artifacts}/${ant.project.name}.jar" todir="${zip}"/>
<copy file="installation.txt" tofile="${zip}/README.txt"/>
<mkdir dir="${zip}/default configs"/>
<copy todir="${zip}/default configs">
<fileset dir="${rsrc}" excludes="plugin.yml,allpay.properties"/>
</copy>
<zip destfile="${dist}/${ant.project.name}-${version}.zip" basedir="${zip}" update="false"/>
<delete dir="${zip}"/>
</target>
<target name="junit" depends="build">
<javac srcdir="${src}" includes="${tests}" destdir="${classes}"
includeantruntime="false" debug="on" deprecation="on">
<classpath>
<pathelement location="${lib}/${CraftBukkit}"/>
<pathelement location="${junit-home}/junit.jar"/>
<pathelement path="${src}"/>
</classpath>
</javac>
<delete dir="${reports}"/>
<mkdir dir="${reports}"/>
<junit printsummary="yes" showoutput="yes">
<formatter type="brief" usefile="false"/>
<classpath>
<pathelement path="${classes}"/>
<pathelement location="${lib}/${CraftBukkit}"/>
<pathelement location="${junit-home}/junit.jar"/>
</classpath>
<batchtest fork="no" haltonfailure="yes" todir="${reports}">
<fileset dir="${src}">
<include name="${tests}"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="test" depends="build" if="deploy">
<copy file="${artifacts}/${ant.project.name}.jar" tofile="${deploy}/${ant.project.name}.jar"/>
</target>
<target name="checkstyle">
<echo message="Checking style..."/>
<checkstyle config="${lib}/checkstyle/checks.xml" failOnViolation="false">
<formatter type="xml" toFile="${artifacts}/checkstyle.xml"/>
<fileset dir="${src}" includes="**/*.java"/>
</checkstyle>
</target>
</project>