-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmacros.xml
43 lines (40 loc) · 1.57 KB
/
macros.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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Common Macros" xmlns:unless="ant:unless">
<macrodef name="tool-exists">
<attribute name="executable"
description="Name of the tool to look for" />
<attribute name="error"
default="Tool @{executable} could not be found in the $PATH"
description="Error message, which is issued, if the tool could not be found." />
<sequential>
<property environment="env" />
<fail message="@{error}">
<condition>
<and>
<not>
<available file="@{executable}" />
</not>
<not>
<available file="@{executable}" filepath="${env.PATH}" />
</not>
</and>
</condition>
</fail>
</sequential>
</macrodef>
<macrodef name="php-tool-installed">
<attribute name="executable"
description="Name of the tool to look for" />
<attribute name="package"
description="Name of the package in which the executable can be found" />
<sequential>
<fail message="Install @{executable} using `php composer.phar require --dev @{package}`.">
<condition>
<not>
<available file="@{executable}" filepath="${bindir}" />
</not>
</condition>
</fail>
</sequential>
</macrodef>
</project>