-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml~
193 lines (166 loc) · 7.32 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
183
184
185
186
187
188
189
190
191
192
193
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="pdmafweb" default="test">
<property environment="env"/>
<property name="ivy.install.version" value="2.0.0" />
<condition property="ivy.home" value="${env.IVY_HOME}">
<isset property="env.IVY_HOME" />
</condition>
<property name="ivy.home" value="${user.home}/.ant" />
<property name="ivy.jar.dir" value="${ivy.home}/lib" />
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy-${ivy.install.version}.jar" />
<target name="download-ivy" unless="offline">
<available file="${ivy.jar.file}" property="ivy.available"/>
<antcall target="-download-ivy" />
</target>
<target name="-download-ivy" unless="ivy.available">
<mkdir dir="${ivy.jar.dir}"/>
<!-- download Ivy from web site so that it can be used even without any special installation -->
<get src="http://www.apache.org/dist/ant/ivy/${ivy.install.version}/apache-ivy-${ivy.install.version}-bin.zip"
dest="${ivy.home}/ivy.zip" usetimestamp="true" verbose="true"/>
<unzip src="${ivy.home}/ivy.zip" dest="${ivy.jar.dir}">
<patternset>
<include name="**/*.jar"/>
</patternset>
<mapper type="flatten"/>
</unzip>
</target>
<target name="init-ivy" depends="download-ivy" unless="ivy.lib.path">
<!-- try to load ivy here from ivy home, in case the user has not already dropped
it into ant's lib dir (note that the latter copy will always take precedence).
We will not fail as long as local lib dir exists (it may be empty) and
ivy is in at least one of ant's lib dir or the local lib dir. -->
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>
<property name="lib.dir" value="${basedir}/lib"/>
<macrodef name="grails">
<attribute name="script"/>
<attribute name="args" default="" />
<sequential>
<grailsTask script="@{script}" args="@{args}" classpathref="grails.classpath">
<compileClasspath refid="compile.classpath"/>
<testClasspath refid="test.classpath"/>
<runtimeClasspath refid="app.classpath"/>
</grailsTask>
</sequential>
</macrodef>
<!-- =================================
target: resolve
================================= -->
<target name="-resolve" description="--> Retrieve dependencies with ivy" depends="init-ivy">
<ivy:retrieve pattern="${lib.dir}/[conf]/[artifact]-[revision].[ext]"/>
</target>
<target name="-init-grails" depends="-resolve">
<path id="grails.classpath">
<fileset dir="${lib.dir}/build"/>
</path>
<path id="compile.classpath">
<fileset dir="${lib.dir}/compile"/>
</path>
<path id="test.classpath">
<fileset dir="${lib.dir}/test"/>
</path>
<path id="app.classpath">
<fileset dir="${lib.dir}/runtime"/>
</path>
<taskdef name="grailsTask"
classname="grails.ant.GrailsTask"
classpathref="grails.classpath"/>
</target>
<target name="deps-report" depends="-resolve" description="--> Generate report of module dependencies.">
<ivy:report conf="*"/>
</target>
<!-- =================================
target: clean
================================= -->
<target name="clean" depends="-init-grails" description="--> Cleans a Grails application">
<grails script="Clean"/>
<delete dir="${lib.dir}" includes="**/*"/>
</target>
<!-- =================================
target: compile
================================= -->
<target name="compile" depends="-init-grails" description="--> Compiles a Grails application">
<grails script="Compile"/>
</target>
<!-- =================================
target: war
================================= -->
<target name="war" depends="-init-grails" description="--> Creates a WAR of a Grails application">
<grails script="War"/>
</target>
<!-- =================================
target: test
================================= -->
<target name="test" depends="-init-grails" description="--> Run a Grails applications unit tests">
<grails script="TestApp"/>
</target>
<!-- =================================
target: run
================================= -->
<target name="run" depends="-init-grails" description="--> Runs a Grails application using embedded Jetty">
<grails script="RunApp"/>
</target>
<!-- =================================
target: deploy
================================= -->
<target name="deploy" depends="war" description="--> The deploy target (initially empty)">
<!-- TODO -->
</target>
<!-- =================================
target : gwt
================================= -->
<property name="gwt.sdk" location="/opt/gwt" />
<path id="project.class.path">
<pathelement location="./web-app/WEB-INF/classes"/>
<pathelement location="${gwt.sdk}/gwt-user.jar"/>
<fileset dir="${gwt.sdk}" includes="gwt-dev*.jar"/>
<!-- Add any additional non-server libs (such as JUnit) -->
<fileset dir="./lib" includes="**/*.jar"/>
</path>
<target name="libs" description="Copy libs to WEB-INF/lib">
<mkdir dir="./web-app/WEB-INF/lib" />
<copy todir=".web-app/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet.jar" />
<!-- Add any additional server libs that need to be copied -->
</target>
<target name="javac" depends="libs" description="Compile java source">
<mkdir dir="war/WEB-INF/classes"/>
<javac srcdir="src" includes="**" encoding="utf-8"
destdir="war/WEB-INF/classes"
source="1.5" target="1.5" nowarn="true"
debug="true" debuglevel="lines,vars,source">
<classpath refid="project.class.path"/>
</javac>
<copy todir="war/WEB-INF/classes">
<fileset dir="src" excludes="**/*.java"/>
</copy>
</target>
<target name="gwtc" depends="javac" description="GWT compile to JavaScript">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<pathelement location="src"/>
<path refid="project.class.path"/>
</classpath>
<!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
<jvmarg value="-Xmx256M"/>
<!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
<arg value="com.pdmaf.ui.gwt.client.PDMAFWeb"/>
</java>
</target>
<target name="hosted" depends="javac" description="Run hosted mode">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.HostedMode">
<classpath>
<pathelement location="src"/>
<path refid="project.class.path"/>
</classpath>
<jvmarg value="-Xmx256M"/>
<arg value="-startupUrl"/>
<arg value="PDMAFWeb.html"/>
<!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
<arg value="com.pdmaf.ui.gwt.client.PDMAFWeb"/>
</java>
</target>
<target name="build" depends="gwtc" description="Build this project" />
</project>