-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
build.xml.dist
158 lines (143 loc) · 5.95 KB
/
build.xml.dist
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
<?xml version="1.0"?>
<project name="Contao Manager" default="list" basedir=".">
<exec executable="git" outputProperty="version" checkreturn="true">
<arg value="describe" />
<arg value="--tags" />
<arg value="--always" />
</exec>
<target name="list">
<echo message="Available commands:" />
<echo message=" phing prod - Builds production Phar (fresh clone of current Git commit)" />
<echo message=" phing dev - Builds development Phar (from current source files)" />
<echo message=" phing debug - Builds debug Phar (from current source files)" />
<echo message=" phing tx - Syncs language files with Transifex" />
</target>
<target name="prod" depends="clone, composer, cache, yarn, build-prod, box-prod, cleanup, version">
<echo message="Contao Manager ${version} build complete" />
</target>
<target name="dev" depends="build-dev, box-dev, version">
<echo message="Contao Manager ${version} build complete" />
</target>
<target name="debug" depends="build-dev, box-dev">
<move file="contao-manager.phar" tofile="contao-manager.phar.php" overwrite="true"/>
<delete file="contao-manager.version" />
<echo message="Contao Manager ${version} build complete" />
</target>
<target name="tx">
<echo message="Starting Transifex sync" />
<exec executable="tx" passthru="true">
<arg value="push" />
<arg value="--source" />
<arg value="--force" />
</exec>
<echo message="Waiting 10 seconds for sources to be parsed" />
<exec executable="sleep">
<arg value="10" />
</exec>
<exec executable="tx" passthru="true">
<arg value="pull" />
<arg value="--all" />
<arg value="--force" />
<arg value="--minimum-perc=50" />
</exec>
</target>
<target name="clone">
<echo message="Cloning into contao-manager-${version}" />
<exec executable="git">
<arg value="clone" />
<arg value="." />
<arg value="contao-manager-${version}" />
</exec>
<exec executable="git" dir="contao-manager-${version}">
<arg value="checkout" />
<arg value="--quiet" />
<arg value="${version}" />
</exec>
<exec executable="git" dir="contao-manager-${version}">
<arg value="reset" />
<arg value="--hard" />
</exec>
<exec executable="sed" dir="contao-manager-${version}" passthru="true">
<arg value="-i" />
<arg value="--" />
<arg value="s/@symfony_env@/prod/g" />
<arg value="api/console" />
</exec>
<exec executable="sed" dir="contao-manager-${version}" passthru="true">
<arg value="-i" />
<arg value="--" />
<arg value="s/@symfony_env@/prod/g" />
<arg value="public/api.php" />
</exec>
</target>
<target name="composer">
<echo message="Installing API dependencies" />
<exec escape="false" dir="contao-manager-${version}" executable="curl">
<arg line="-LSs https://getcomposer.org/installer | php" />
</exec>
<exec executable="php" dir="contao-manager-${version}" checkreturn="true">
<arg value="composer.phar" />
<arg value="install" />
<arg value="--prefer-dist" />
<arg value="--no-dev" />
<arg value="--optimize-autoloader" />
<arg value="--ignore-platform-reqs" />
<arg value="--no-interaction" />
</exec>
</target>
<target name="cache">
<echo message="Building cache for the API application" />
<exec executable="php" dir="contao-manager-${version}" checkreturn="true">
<arg value="api/console" />
<arg value="cache:warmup" />
</exec>
</target>
<target name="yarn">
<echo message="Installing UI dependencies" />
<exec executable="yarn" dir="contao-manager-${version}" checkreturn="true">
<arg value="install" />
</exec>
</target>
<target name="build-prod">
<echo message="Compiling UI files" />
<exec executable="yarn" dir="contao-manager-${version}" checkreturn="true">
<arg value="run" />
<arg value="build" />
</exec>
</target>
<target name="build-dev">
<echo message="Compiling UI files" />
<exec executable="yarn" passthru="true" checkreturn="true">
<arg value="run" />
<arg value="build" />
</exec>
</target>
<target name="box-prod">
<echo message="Creating the .phar file" />
<exec executable="php" dir="contao-manager-${version}/tools/phing" checkreturn="true">
<arg value="../../composer.phar" />
<arg value="install" />
</exec>
<exec executable="php" dir="contao-manager-${version}" checkreturn="true">
<arg value="tools/phing/vendor/bin/box" />
<arg value="compile" />
</exec>
</target>
<target name="box-dev">
<echo message="Creating the .phar file" />
<exec executable="php" checkreturn="true" passthru="true">
<arg value="tools/phing/vendor/bin/box" />
<arg value="compile" />
</exec>
</target>
<target name="cleanup">
<move file="contao-manager-${version}/contao-manager.phar" tofile="contao-manager.phar" overwrite="true"/>
<delete dir="contao-manager-${version}" />
</target>
<target name="version">
<exec executable="php" checkreturn="true">
<arg value="-r" />
<arg value="file_put_contents('contao-manager.version', json_encode(['version' => '${version}', 'build-date' => date('c'), 'sha1' => sha1_file('contao-manager.phar'), 'requires' => ['php' => '^7.2.5 || ^8.0']]));" />
</exec>
</target>
</project>