/
build.xml
106 lines (89 loc) · 3.34 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
<project default="compile">
<property file="build.properties" />
<property name="lib.dir" value="${basedir}/lib" />
<property name="web.dir" value="${basedir}/web" />
<property name="res.dir" value="${basedir}/res" />
<property name="war.dir" value="${basedir}/war" />
<import file="${sdk.dir}/config/user/ant-macros.xml" />
<path id="project.classpath">
<pathelement path="war/WEB-INF/classes" />
<fileset dir="war/WEB-INF/lib">
<include name="**/*.jar" />
</fileset>
<fileset dir="${sdk.dir}/lib">
<include name="shared/**/*.jar" />
</fileset>
</path>
<target name="copyFiles">
<copy todir="${war.dir}">
<fileset dir="${web.dir}">
<exclude name="**/*.svn" />
</fileset>
<fileset dir="${res.dir}">
<exclude name="**/*.svn" />
</fileset>
</copy>
</target>
<target name="copyjars" description="Copies the App Engine JARs to the WAR.">
<copy todir="${war.dir}/WEB-INF/lib" flatten="true" verbose="true">
<fileset dir="${sdk.dir}/lib/user">
<include name="**/*.jar" />
<exclude name="**/*.svn" />
</fileset>
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
<exclude name="**/*.svn" />
</fileset>
</copy>
</target>
<target name="compile" depends="copyFiles, copyjars, init_datastore" description="Compiles Java source and copies other source files to the WAR.">
<mkdir dir="${war.dir}/WEB-INF/classes" />
<copy todir="${war.dir}/WEB-INF/classes">
<fileset dir="src">
<exclude name="**/*.java" />
</fileset>
</copy>
<javac srcdir="src" destdir="${war.dir}/WEB-INF/classes" classpathref="project.classpath" debug="on" />
</target>
<target name="enhance" depends="compile" description="Performs JDO enhancement on compiled data classes.">
<enhance_war war="${war.dir}" />
</target>
<target name="debugserver" depends="enhance" description="Starts the development server.">
<dev_appserver war="${war.dir}" port="8888">
<options>
<arg value="--jvm_flag=-Xdebug" />
<arg value="--jvm_flag=-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9999" />
</options>
</dev_appserver>
</target>
<target name="runserver" depends="enhance">
<dev_appserver war="${war.dir}" port="8888" />
</target>
<target name="update" depends="clean, enhance" description="Uploads the application to App Engine.">
<appcfg action="update" war="${war.dir}" />
</target>
<target name="update_indexes" depends="enhance" description="Uploads just the datastore index configuration to App Engine.">
<appcfg action="update_indexes" war="${war.dir}" />
</target>
<target name="rollback" depends="enhance" description="Rolls back an interrupted application update.">
<appcfg action="rollback" war="${war.dir}" />
</target>
<target name="clean">
<delete dir="${war.dir}/WEB-INF/classes" verbose="false" />
</target>
<target name="cleanall">
<delete dir="${war.dir}" />
</target>
<target name="init_datastore">
<echo>
Hit these URLs in the browser
${deploy.base}admin?action=add&key=consumer_key&value=${consumer.key}
${deploy.base}admin?action=add&key=consumer_secret&value=${consumer.secret}
</echo>
</target>
<target name="launch" depends="compile, enhance, init_datastore">
<echo>
${deploy.base}pages/main
</echo>
</target>
</project>