-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
97 lines (83 loc) · 3.21 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
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Base idea from http://www.ibm.com/developerworks/library/os-ecant/ -->
<project name="openalive" basedir="." default="run">
<description>${ant.project.name} build file</description>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="antlib/ant-contrib-1.0b3.jar" />
</classpath>
</taskdef>
<typedef resource="pyAntTasks.properties">
<classpath>
<pathelement location="antlib/pyAntTasks-1.3.3.jar" />
</classpath>
</typedef>
<property file="build.properties" />
<property name="src.dir" location="." />
<property name="test.dir" location="test" />
<property name="pydoc.dir" value="pydoc" />
<target name="init">
<tstamp />
<xmlproperty file=".pydevproject" />
<property name="appengine.dir" location="${pydev_project.pydev_variables_property.value}" />
<propertyregex property="tmp.pythonpath" input="${pydev_project.pydev_pathproperty.path}" regexp="," replace=":" />
<propertyregex property="pythonpath" input="${tmp.pythonpath}" regexp="..GOOGLE_APP_ENGINE." replace="${appengine.dir}" />
<propertyregex property="pythonpath" input="${pythonpath}" regexp="\/${ant.project.name}" replace="${src.dir}" override="true" />
<property name="django-admin" location="${appengine.dir}/lib/django_1_2/django/bin/django-admin.py" />
</target>
<target name="run" depends="init">
<py-run script="${appengine.dir}/dev_appserver.py" pythonpath="${pythonpath}" optimize="0">
<arg value="${src.dir}" />
<arg value="--high_replication" />
<arg value="--port=${port}" />
<arg value="--debug" />
<arg value="--disable_static_caching" />
</py-run>
</target>
<target name="deploy" depends="init">
<py-run script="${appengine.dir}/appcfg.py">
<arg value="update" />
<arg value="${src.dir}" />
</py-run>
</target>
<target name="compile" depends="init">
<py-compile dir="${src.dir}" pythonpath="${pythonpath}" optimize="0" />
</target>
<target name="tests" depends="init">
<py-test pythonpath="${pythonpath}:${test.dir}" dir=".">
<fileset dir="${test.dir}">
<include name="**/*_test.py" />
</fileset>
</py-test>
</target>
<target name="i18n" depends="init">
<py-run script="${django-admin}" pythonpath="${pythonpath}" dir="${src.dir}" failonerror="no">
<arg value="makemessages" />
<arg value="-a" />
<arg value="--ignore=lib/*" />
</py-run>
<py-run script="${django-admin}" pythonpath="${pythonpath}" dir="${src.dir}" failonerror="no">
<arg value="makemessages" />
<arg value="-d" />
<arg value="djangojs" />
<arg value="-a" />
<arg value="--ignore=lib/*" />
</py-run>
<!-- <py-run script="${src.dir}/bin/auto_translate.py" pythonpath="${pythonpath}" dir="${src.dir}" /> -->
</target>
<target name="i18n_compile" depends="init">
<py-run script="${django-admin}" pythonpath="${pythonpath}" dir="${src.dir}">
<arg value="compilemessages" />
</py-run>
</target>
<target name="i18n_clean">
<delete>
<fileset dir="${src.dir}/conf/locale" includes="**/*/LC_MESSAGES/*" />
</delete>
</target>
<target name="deploy_static">
<exec executable="gsutil" dir=".">
<arg line="cp -R -a public-read static/* gs://${ant.project.name}" />
</exec>
</target>
</project>