This repository has been archived by the owner on Jan 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
52 lines (51 loc) · 1.98 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
<project name="Lessnichy" default="build" basedir=".">
<property name="phar.output" value="build/lessnichy.phar"/>
<target name="setup" depends="clean-build">
<property name="composer.installed" value="false"/>
<available property="composer.installed" file="composer.phar"/>
<if>
<isfalse value="${composer.installed}"/>
<then>
<echo>Installing composer.phar</echo>
<exec command="curl -sS https://getcomposer.org/installer | php"/>
</then>
<else>
<echo>Composer already downloaded</echo>
</else>
</if>
<property name="composer.dependencies.installed" value="false"/>
<available property="composer.dependencies.installed" file="vendor/autoload.php"/>
<if>
<isfalse value="${composer.dependencies.installed}"/>
<then>
<phingcall target="composer-dependencies-install" />
</then>
<else>
<echo>Composer dependencies already installed</echo>
</else>
</if>
</target>
<target name="composer-dependencies-install">
<echo>Installing composer.phar dependencies</echo>
<exec command="php composer.phar install"/>
</target>
<target name="clean-build">
<delete file="${phar.output}" failonerror="false"/>
</target>
<target name="build" depends="setup">
<echo>Starting phar build</echo>
<exec command="php ${project.basedir}/build/build-phar.php" passthru="true"/>
<delete dir="build/phar"/>
<property name="lessnichy.built" value="false"/>
<available property="lessnichy.built" file="${phar.output}"/>
<if>
<isfalse value="${lessnichy.built}"/>
<then>
<fail message="phar build failed"/>
</then>
<else>
<echo>Build successful</echo>
</else>
</if>
</target>
</project>