-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_django.xml
More file actions
116 lines (105 loc) · 3.21 KB
/
Copy pathbuild_django.xml
File metadata and controls
116 lines (105 loc) · 3.21 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
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<project name="django">
<import file="${BUILD_FARM_HOME}/build_python.xml" />
<macrodef name="django_configure">
<attribute name="target" default="."/>
<sequential>
<echo message="Create directories..." />
<mkdir dir="@{target}/django" />
<mkdir dir="@{target}/logs" />
<echo message="Create files from templates..." />
<copy_with_replace target="@{target}" params="tmp/properties/active.properties">
<source>
<fileset dir="${BUILD_FARM_HOME}/template">
<include name="django/**/**"/>
</fileset>
</source>
</copy_with_replace>
<copy_with_replace target="@{target}" params="tmp/properties/active.properties">
<source>
<fileset dir="template">
<include name="django/**/**"/>
</fileset>
</source>
</copy_with_replace>
<copy_with_replace target="@{target}" params="tmp/properties/active.properties">
<source>
<fileset dir="template">
<include name="src/**/*.py"/>
</fileset>
</source>
</copy_with_replace>
</sequential>
</macrodef>
<macrodef name="django_clean">
<attribute name="target" default="."/>
<sequential>
<delete dir="@{target}/static"/>
<delete dir="@{target}/django"/>
</sequential>
</macrodef>
<macrodef name="django_build">
<attribute name="target" default="build"/>
<element name="src" optional="true" />
<element name="static" optional="true" />
<sequential>
<echo message="Install project into target directory" />
<mkdir dir="@{target}" />
<copy todir="@{target}" encoding="utf-8">
<src />
<fileset dir=".">
<include name="src/**" />
<exclude name="src/**/static/**" />
<exclude name="src/media/" />
<exclude name="src/**/*.sh" />
<exclude name="src/**/*.bat" />
<exclude name="src/**/*.cmd" />
<exclude name="src/**/*.po" />
<exclude name="src/**/*.pyc" />
<exclude name="src/*/media/uploads/**"/>
<include name="deps.txt" />
</fileset>
</copy>
<!--
<echo message="Compile i18n resources"/>
<exec executable="django-admin.py" dir="${basedir}/src" failonerror="true">
<arg value="compilemessages"/>
</exec>
//-->
<!-- Collect static -->
<django_manage>
<DjangoManageArgs>
<arg value="collectstatic"/>
<arg value="--noinput"/>
</DjangoManageArgs>
</django_manage>
<mkdir dir="@{target}/static" />
<echo message="Move collected static files into static directory" />
<copy todir="@{target}/static" encoding="utf-8">
<static />
</copy>
<python_compile target="@{target}/src" />
<delete>
<fileset dir="@{target}">
<include name="src/**/*.py" />
<exclude name="src/**/settings.py" />
<exclude name="src/**/manage.py" />
<exclude name="src/**/migrations/*.py" />
<exclude name="src/**/commands/*.py" />
</fileset>
</delete>
</sequential>
</macrodef>
<macrodef name="django_manage">
<attribute name="path" default="src"/>
<element name="DjangoManageArgs"/>
<sequential>
<python dir="@{path}">
<args>
<arg value="manage.py"/>
<DjangoManageArgs/>
</args>
</python>
</sequential>
</macrodef>
</project>