forked from symbiote/silverstripe-base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
49 lines (45 loc) · 1.54 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
<?xml version="1.0" encoding="UTF-8"?>
<!-- Rename this project to something relevant! -->
<project name="rename-me" default="build">
<if>
<isset property="ni_build" />
<then>
<property name="composer.dev" value="--no-dev" />
</then>
<else>
<property name="composer.dev" value="" />
</else>
</if>
<if>
<not>
<available file="${project.basedir}/build/buildfile.xml" />
</not>
<then>
<!-- unfortunately we can't abstract this behind anything; we can't do a phingcall here
because we have no parent target as the context. We can't make this bit a target
because we can't <import> a file from within a target, it has to be at the root-->
<if>
<not><available file="composer.phar" /></not>
<then>
<exec command="curl -s https://getcomposer.org/installer | php" passthru="true" />
</then>
</if>
<exec command="php composer.phar install ${composer.dev} --prefer-source" passthru="true" />
</then>
</if>
<import file="${project.basedir}/build/buildfile.xml"/>
<target name="get-composer">
<if>
<not><available file="composer.phar" /></not>
<then>
<exec command="curl -s https://getcomposer.org/installer | php" passthru="true" />
</then>
</if>
</target>
<target name="composer-install" depends="get-composer">
<exec command="php composer.phar install ${composer.dev} --prefer-source" passthru="true" />
</target>
<target name="composer-update" depends="get-composer">
<exec command="php composer.phar update ${composer.dev} --prefer-source" passthru="true" />
</target>
</project>