forked from hogi/kunagi
-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathbuild.xml
183 lines (159 loc) · 6.49 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<?xml version="1.0"?>
<project name="kunagi" default="package" basedir=".">
<property name="build.dir" value="build" />
<property name="homepage.output.dir" value="/var/www/kunagi.org/website/" />
<property name="test.output.dir" value="test-output" />
<property name="ilarkesto.dir" value="../ilarkesto" />
<property name="classes.output.dir" value="${build.dir}/webapp/WEB-INF/classes" />
<target name="init">
<tstamp>
<format property="build.tstamp" pattern="yyyy-MM-dd HH:mm"
locale="de,DE" />
</tstamp>
</target>
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${test.output.dir}" />
</target>
<target name="compile-java" depends="init">
<mkdir dir="${classes.output.dir}" />
<copy todir="${classes.output.dir}" preservelastmodified="true">
<fileset dir="src/main/java" />
<fileset dir="src/generated/java" />
<fileset dir="${ilarkesto.dir}/src/main/java" excludes="**/devmode.txt" />
</copy>
<javac source="1.6" target="1.6" srcdir="${classes.output.dir}"
destdir="${classes.output.dir}" encoding="UTF-8" nowarn="true"
debug="true" debuglevel="lines,vars,source" includeantruntime="false">
<classpath>
<fileset dir="${ilarkesto.dir}/lib" />
</classpath>
</javac>
<mkdir dir="${build.dir}/test-classes" />
<javac srcdir="src/test/java" destdir="${build.dir}/test-classes"
encoding="UTF-8" nowarn="true" debug="true" debuglevel="lines,vars,source"
includeantruntime="false">
<classpath>
<path location="${classes.output.dir}" />
<fileset dir="${ilarkesto.dir}/lib" />
</classpath>
</javac>
<replace file="${classes.output.dir}/scrum/server/build.properties"
token="@build-date@" value="${build.tstamp}" />
</target>
<target name="compile-gwt" depends="compile-java">
<java classname="com.google.gwt.dev.Compiler" failonerror="true"
fork="true">
<!-- <arg value="-strict" /> -->
<arg value="-logLevel" />
<arg value="INFO" />
<arg value="-style" />
<arg value="DETAILED" />
<arg value="-war" />
<arg value="${build.dir}/webapp" />
<arg value="scrum.ScrumGwtApplication" />
<classpath location="src/main/java" />
<classpath location="src/generated/java" />
<classpath location="${ilarkesto.dir}/src/main/java" />
<classpath>
<fileset dir="${ilarkesto.dir}/lib"
includes="gwt-dev-*.jar,gwt*.jar,asm-*.jar,validation-*.jar" />
</classpath>
</java>
</target>
<target name="test" depends="compile-java">
<delete dir="${test.output.dir}" />
<taskdef name="testng"
classpath="${ilarkesto.dir}/lib/testng-6.9.4.jar;${ilarkesto.dir}/lib/jcommander-1.48.jar"
classname="org.testng.TestNGAntTask" />
<testng outputDir="${test.output.dir}" haltonfailure="true">
<classfileset dir="${build.dir}/test-classes"
includes="**/*.class" />
<classpath>
<path location="${classes.output.dir}" />
<path location="${build.dir}/test-classes" />
<fileset dir="${ilarkesto.dir}/lib" />
</classpath>
</testng>
</target>
<target name="webapp" depends="compile-java, compile-gwt">
<copy todir="${build.dir}/webapp" preservelastmodified="true">
<fileset dir="src/main/webapp" />
<fileset file="README" />
<fileset dir="." includes="license.*" />
</copy>
<copy todir="${build.dir}/webapp/WEB-INF/lib"
preservelastmodified="true">
<fileset dir="${ilarkesto.dir}/lib">
<exclude name="**/src/**" />
<exclude name="**/javadoc/**" />
<exclude name="**/asm-*.jar" />
<exclude name="**/gwt-dev-*.jar" />
<exclude name="**/gwt-user-*.jar" />
<exclude name="**/javax.servlet-api-*.jar" />
<exclude name="**/google-collect-*.jar" />
<exclude name="**/junit-*.jar" />
<exclude name="**/testng-*.jar" />
<exclude name="**/httpunit-*.jar" />
<exclude name="**/tidy*.jar" />
<exclude name="**/oacurl-*.jar" />
<exclude name="**/bsh-*.jar" />
<exclude name="**/gdata-*.jar" />
<exclude name="**/jaudiotagger-*.jar" />
<exclude name="**/jcip-annotations-*.jar" />
<exclude name="**/mysql-*.jar" />
<exclude name="**/android*.jar" />
</fileset>
</copy>
<war destfile="${build.dir}/kunagi.war" basedir="${build.dir}/webapp" />
</target>
<target name="package" depends="webapp">
<mkdir dir="${build.dir}/package-content/kunagi" />
<copy file="${build.dir}/kunagi.war" tofile="${build.dir}/package-content/kunagi/kunagi.war" />
<copy todir="${build.dir}/package-content/kunagi"
preservelastmodified="true">
<fileset file="README" />
<fileset dir="." includes="license.*" />
</copy>
<zip destfile="${build.dir}/kunagi.zip" basedir="${build.dir}/package-content" />
<exec executable="tar" failonerror="true"
dir="${build.dir}/package-content">
<arg line="cjf ../kunagi.tar.bz2 kunagi" />
</exec>
</target>
<target name="publishPackages">
<copy todir="${homepage.output.dir}/latest"
preservelastmodified="true">
<fileset file="${build.dir}/kunagi.war" />
<fileset file="${build.dir}/kunagi.zip" />
<fileset file="${build.dir}/kunagi.tar.bz2" />
</copy>
</target>
<target name="releaseHomepage">
<copy todir="${homepage.output.dir}" preservelastmodified="true">
<fileset dir="src/projectHomepage/html" />
</copy>
<mkdir dir="${homepage.output.dir}/velocity" />
<copy todir="${homepage.output.dir}/velocity"
preservelastmodified="true">
<fileset dir="src/projectHomepage/velocity" />
</copy>
</target>
<target name="deployAsHead">
<copy file="${build.dir}/kunagi.war" tofile="/home/kunagi-head/tomcat/webapps/kunagi.war"
preservelastmodified="true" />
<exec executable="touch" failonerror="true">
<arg value="/home/kunagi-head/tomcat/restart-request/trigger" />
</exec>
</target>
<target name="deployToLocalTomcat" depends="package">
<copy file="${build.dir}/kunagi.war" tofile="/var/lib/tomcat7/webapps/kunagi.war"
preservelastmodified="true" />
</target>
<target name="installScripts">
<copy file="etc/kunagi-release.py" tofile="/home/kunagi/bin/kunagi-release"
preservelastmodified="true" failonerror="true" />
</target>
<target name="continousIntegrationBuild"
depends="clean,test,package,publishPackages,releaseHomepage,installScripts,deployAsHead" />
</project>