-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.xml
153 lines (129 loc) · 4.87 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
<project name="Flapjack" default="compile" basedir=".">
<property file="build.properties"/>
<property name="src" location="src"/>
<property name="res" location="res"/>
<property name="lib" location="lib"/>
<property name="tmp" location="tmp"/>
<property name="cfg" location="config"/>
<property name="cls" location="classes"/>
<property name="jar" value="${lib}/flapjack.jar"/>
<property name="war" value="${tomcat.manager.app}.war"/>
<!-- Development classpath -->
<path id="project.classpath">
<pathelement path="${cls}"/>
<fileset dir="${lib}"/>
</path>
<!-- Runtime classpath (manifest formatted) -->
<manifestclasspath property="jar.classpath" jarfile="${jar}">
<classpath>
<fileset dir="${lib}">
<exclude name="**/lib-devel/**"/>
<exclude name="**/lib-servlet/**"/>
</fileset>
</classpath>
</manifestclasspath>
<target name="init">
<mkdir dir="${cls}"/>
</target>
<target name="clean">
<delete includeemptydirs="true">
<fileset dir="${cls}" includes="**/*"/>
<fileset file="${jar}"/>
<fileset file="${war}"/>
</delete>
</target>
<target name="compile" depends="init">
<javac srcdir="${src}" destdir="${cls}" source="11" target="11" debug="true" includeantruntime="false">
<classpath refid="project.classpath"/>
<!--<compilerarg line="-Xlint:deprecation"/>-->
</javac>
</target>
<target name="jar" depends="clean, compile">
<condition property="i4j.version" value="x.xx.xx.xx">
<equals arg1="${i4j.version}" arg2="${i4j.version}"/>
</condition>
<jar jarfile="${jar}">
<fileset dir="${cls}">
<exclude name="**/*Test.class"/>
</fileset>
<zipfileset dir="${src}/arrr" prefix="src/arrr"/>
<zipfileset dir="${cfg}" prefix="config"/>
<zipfileset dir="${res}" prefix="res"/>
<zipfileset dir="installer/licence" prefix="installer/licence"/>
<!-- castor.properties must be top level otherwise it's not seen -->
<fileset file="config/castor.properties"/>
<manifest>
<attribute name="Main-Class" value="jhi.flapjack.gui.Flapjack"/>
<attribute name="Class-Path" value="${jar.classpath}"/>
<attribute name="Implementation-Version" value="${i4j.version}"/>
<attribute name="Application-Name" value="Flapjack"/>
</manifest>
</jar>
</target>
<target name="getversion">
<input message="Enter the version number:" addproperty="i4j.version"/>
</target>
<target name="install4j" depends="getversion, jar">
<echo message="${install4j.antpath}"/>
<taskdef name="install4j"
classname="com.install4j.Install4JTask"
classpath="${install4j.antpath}"/>
<delete>
<fileset dir="installer" includes="**/*.rpm"/>
<fileset dir="installer" includes="**/*.deb"/>
<fileset dir="installer" includes="**/*.exe"/>
<fileset dir="installer" includes="**/*.sh"/>
<fileset dir="installer" includes="**/*.dmg"/>
</delete>
<install4j projectfile="installer/flapjack.install4j"
release="${i4j.version}"
buildselected="true"
winKeystorePassword="${keystore.password}"
macKeystorePassword="${keystore.password}"/>
</target>
<target name="war" depends="jar">
<copy todir="${tmp}" flatten="true">
<fileset dir="${lib}">
<exclude name="**/lib-devel/**"/>
</fileset>
</copy>
<war destfile="${war}" update="false">
<webinf dir="www/servlets/WEB-INF"/>
<metainf dir="www/servlets/META-INF"/>
<lib dir="${tmp}"/>
</war>
<delete dir="${tmp}"/>
<taskdef name="undeploy" classpathref="project.classpath"
classname="org.apache.catalina.ant.UndeployTask"/>
<taskdef name="deploy" classpathref="project.classpath"
classname="org.apache.catalina.ant.DeployTask"/>
<undeploy url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}"
path="/${tomcat.manager.app}" failOnError="false"/>
<deploy url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}"
path="/${tomcat.manager.app}" war="${war}"/>
</target>
<!-- Less frequently used tasks from this point onwards -->
<target name="run" depends="jar">
<java jar="${jar}" fork="true">
<jvmarg value="-Xmx1024m"/>
</java>
</target>
<target name="test" depends="clean, compile">
<junit printsummary="on" haltonerror="true" haltonfailure="true" dir="." fork="true">
<jvmarg value="-Xmx512m"/>
<classpath refid="project.classpath"/>
<formatter type="plain" usefile="false"/>
<batchtest>
<fileset dir="${cls}" includes="**/*Test.class"/>
</batchtest>
</junit>
</target>
<target name="javadoc">
<javadoc destdir="docs/api" author="true" version="true" use="true">
<fileset dir="${src}" defaultexcludes="yes">
<include name="**/*.java"/>
</fileset>
<classpath refid="project.classpath"/>
</javadoc>
</target>
</project>