-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.xml
40 lines (32 loc) · 1.88 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="zipMoney Merchant Api PHP" default="build" basedir=".">
<property name="vendor-dir" value="${project.basedir}/vendor/"/>
<property name="global-vendor-dir" value="~/.composer/vendor/"/>
<property name="composer" value="${global-vendor-dir}bin/composer --working-dir=${project.basedir}"/>
<property name="phpunit" value="${global-vendor-dir}bin/phpunit" />
<property environment="env"/>
<target name="install" depends="install-deps" description="Install Wordpress and Woocommerce" />
<target name="clean" description="Remove composer install dependencies">
<delete dir="${vendor-dir}" />
</target>
<target name="install-deps" description="Install all required dependencies">
<exec command="${composer} install" passthru="true" checkreturn="true" />
</target>
<target name="test" depends="clean,install-deps">
<exec command="php -v && ${phpunit}" passthru="true" checkreturn="true" />
</target>
<target name="tag" description="Create">
<propertyregex property="tagname" subject="${env.branch}" pattern="^(\*|\d+(\.\d+){0,2}(\.\*)?)$" match="$1" casesensitive="false" defaultvalue="false"/>
<echo msg="${tagname}" />
<if>
<ispropertytrue property="tagname" />
<then>
<echo msg="Is a tag ${tagname}" />
<exec command="curl -XPOST -H'content-type:application/json' 'https://packagist.org/api/update-package?username=${UserName}&apiToken=${ApiToken}' -d'{"repository":{"url":"https://github.com/zipMoney/merchantapi-php"}}'" passthru="true" checkreturn="true" />
</then>
<else>
<echo msg="Is not a tag, so not tagging" />
</else>
</if>
</target>
</project>