-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
195 lines (157 loc) · 7.86 KB
/
build.xml
File metadata and controls
195 lines (157 loc) · 7.86 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<?xml version='1.0' encoding='UTF-8'?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="migrate" default="local.dist" basedir=".">
<property file="build.properties"/>
<property file="src/jdbc.properties"/>
<property file="build.properties"/>
<property name="migrate" value="migrate"/>
<property name="migrate.path" value="/${migrate}"/>
<property name="migrate.version" value="1.0"/>
<property name="build" value="${basedir}/build"/>
<property name="build.web-inf" value="${build}/WEB-INF"/>
<property name="build.web-inf.classes" value="${build.web-inf}/classes"/>
<property name="build.web-inf.lib" value="${build.web-inf}/lib"/>
<property name="src.home" value="${basedir}/src"/>
<property name="web.home" value="WebContent"/>
<property name="dist.home" value="${basedir}/dist"/>
<property name="compile.debug" value="true"/>
<property name="compile.deprecation" value="false"/>
<property name="compile.optimize" value="true"/>
<property name="ivy.install.version" value="2.3.0-rc1"/>
<property name="ivy.jar.dir" value="${basedir}/ivy"/>
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
<property name="compile.debug" value="true"/>
<property name="compile.deprecation" value="false"/>
<property name="compile.optimize" value="true"/>
<property name="tools.eclipse" value="${basedir}/tools/ide/eclipse" />
<fail message="Property "sdk.dir" needs to be set, please edit the build.properties file to set App Engine SDK directory "
unless="sdk.dir"/>
<import file="${sdk.dir}/config/user/ant-macros.xml" />
<target name="download-ivy" unless="skip.download">
<mkdir dir="${ivy.jar.dir}"/>
<!--
download Ivy from web site so that it can be used even without any special installation
-->
<echo message="installing ivy..."/>
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="install-ivy" depends="download-ivy" description="--> install ivy">
<!--
try to load ivy here from local ivy dir, 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>
<!-- ==================== Copy app engine jars ================================== -->
<target name="copy-appengine-jars" depends="resolve"
description="Copies the App Engine JARs to the WAR.">
<mkdir dir="${build.web-inf.lib}" />
<copy todir="${build.web-inf.lib}" flatten="true">
<fileset dir="${sdk.dir}/lib/user">
<include name="**/appengine-api-1.0-sdk*.jar" />
</fileset>
<fileset dir="${sdk.dir}/lib/opt/user">
<include name="appengine-api-labs/v1/*.jar" />
<include name="jsr107/v1/*.jar" />
<include name="datanucleus/v2/*.jar" />
<include name="appengine-endpoints/v1/appengine-endpoints.jar" />
</fileset>
</copy>
</target>
<!-- ==================== resolve ivy dependencies Target ================================== -->
<target name="resolve" description="--> resolve ivy dependencies">
<property name="ivy.dep.file" value="${basedir}/ivy.xml" />
<property name="ivy.lib.dir" value="${build.web-inf.lib}" />
<ivy:retrieve />
</target>
<!-- ==================== Prepare Target ================================== -->
<target name="prepareLocal">
<copy file="${src.home}/spring/localStorageConfig.xml" tofile="${src.home}/spring/storageConfig.xml" overwrite="true"/>
</target>
<target name="prepareGoogle">
<copy file="${src.home}/spring/googleStorageConfig.xml" tofile="${src.home}/spring/storageConfig.xml" overwrite="true"/>
</target>
<target name="prepare" depends="install-ivy">
<!-- Create build directories as needed -->
<mkdir dir="${build}"/>
<mkdir dir="${build.web-inf}"/>
<mkdir dir="${build.web-inf.classes}"/>
<copy todir="${build}">
<fileset dir="${web.home}"/>
</copy>
<mkdir dir="${build.web-inf.lib}"/>
<copy todir="${build.web-inf}" >
<fileset dir="${web.home}/WEB-INF" excludes="**/*.classes"/>
</copy>
</target>
<path id="compile.classpath">
<fileset dir="${build.web-inf.lib}">
<include name="*.jar"/>
</fileset>
<pathelement location="src"/>
</path>
<target name="clean"
description="Delete old build and dist directories">
<delete dir="${build}"/>
<delete dir="${dist.home}"/>
</target>
<target name="compile" depends="prepare, resolve">
<mkdir dir="${build.web-inf.classes}"/>
<javac srcdir="${src.home}"
destdir="${build.web-inf.classes}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}"
includeantruntime="false">
<classpath refid="compile.classpath"/>
<compilerarg value="-Xlint:unchecked" />
</javac>
<!-- Copy application resources -->
<copy todir="${build.web-inf.classes}">
<fileset dir="src" excludes="**/*.java"/>
</copy>
</target>
<target name="-dist" depends="compile">
<mkdir dir="${dist.home}"/>
<jar jarfile="${dist.home}/${migrate}.war" basedir="${build}" excludes="**/servlet-api-2.5.jar"/>
<jar jarfile="${dist.home}/${migrate}-model.jar">
<fileset dir="${build.web-inf.classes}" includes="**/model/*.class"/>
<fileset dir="${build.web-inf.classes}" includes="com/migrate/storage/impl/JsonHelper.class"/>
</jar>
</target>
<target name="local.dist" depends="prepareLocal, -dist"/>
<target name="appengine.datanucleusenhance" depends="copy-appengine-jars"
description="Performs enhancement on compiled data classes.">
<enhance_war war="${build}">
<args>
<arg value="-enhancerVersion"/>
<arg value="v2"/>
</args>
</enhance_war>
</target>
<target name="appengine.runlocal" depends="appengine.datanucleusenhance"
description="Starts the development server.">
<dev_appserver war="${build}" />
</target>
<target name="appengine.deploy" description="Uploads and deploys the application to App Engine." depends="prepareGoogle, -dist, appengine.datanucleusenhance">
<!--<input message="Enter email" addproperty="gae-email"/>-->
<!--<input message="Enter password :- " addproperty="gae-password">-->
<!--<handler type="secure"/>-->
<!--</input>-->
<property name="gae-email" value="gybedev@gmail.com"/>
<property name="gae-password" value="itbjxxmfzwvdgybz"/>
<!-- Call dependencies here rather than with 'depends' attribute to get input first -->
<antcall target="appengine.datanucleusenhance" />
<java classname="com.google.appengine.tools.admin.AppCfg" inputstring="${gae-password}"
classpath="${sdk.dir}/lib/appengine-tools-api.jar" fork="true" failonerror="true">
<arg value="--email=${gae-email}" />
<arg value="--passin" />
<arg value="update" />
<arg value="${build}" />
</java>
</target>
</project>