forked from acquia/blt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproperties.xml
84 lines (72 loc) · 4.24 KB
/
properties.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
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
<project name="properties" default="build">
<!-- Define the repo root as a property, and resolve to an absolute file path. -->
<!-- We assume that Phing is running in vendor/acquia/blt/phing of a parent project. -->
<property name="repo.root.relative" value="${phing.dir}/../../../.." logoutput="false"/>
<resolvepath propertyName="repo.root" file="${repo.root.relative}"/>
<property name="blt.root.relative" value="${phing.dir}/.." logoutput="false"/>
<resolvepath propertyName="blt.root" file="${blt.root.relative}"/>
<!-- Load file directory and binary locations. -->
<property file="${phing.dir}/build.yml" override="true" logoutput="false"/>
<!-- Load the root project.yml file for this project. -->
<property file="${blt.config-files.project}" override="true" logoutput="false"/>
<!-- Load the local project.local.yml file for this project. -->
<!--@todo Change this so that it is only loaded for local:* targets. -->
<if>
<available file="${blt.config-files.local}" type="file" property="local.properties"/>
<then>
<property file="${blt.config-files.local}" override="true" logoutput="${blt.verbose}"/>
</then>
</if>
<!--Get version information. -->
<if>
<not><available file="${blt.config-files.schema-version}"/></not>
<then>
<!-- If no schema version exists, assume 8.5.2, which is last release before this file was introduced. -->
<exec dir="${repo.root}" command="mkdir -p blt" checkreturn="true" logoutput="true" passthru="false" level="${blt.exec_level}"/>
<exec dir="${repo.root}" command="echo '8.5.2' >> ${blt.config-files.schema-version}" checkreturn="true" logoutput="true" passthru="false" level="${blt.exec_level}"/>
</then>
</if>
<exec dir="${repo.root}" command="cat ${blt.config-files.schema-version}" outputProperty="blt.schema-version" checkreturn="true" logoutput="false" level="${blt.exec_level}"/>
<!-- Send errors to /dev/null, for environments like ACE without composer. -->
<exec dir="${repo.root}" command="composer info acquia/blt 2> /dev/null | grep versions | awk '{print $4}'" outputProperty="blt.version" logoutput="false" checkreturn="true" level="${blt.exec_level}" />
<!--verbosityTask is used to set the verbosity level of Phing via a property. It is necessary because the -verbose, -debug, -silent, and -quiet command line options are not available as properties and cannot be utilized in task conditionals. -->
<verbosityTask level="${blt.level}"/>
<!-- Think of blt.level as a maximum verbosity level. Anything above the default level of info (e.g., verbose and debug) are hidden unless the maximum verbosity is raised to the "verbose" or "debug" level. Raising blt.level increases the visibility of otherwise hidden output. -->
<!-- When blt.level is above "warn", then increase verbosity of common project tasks. -->
<if>
<or>
<equals arg1="${blt.level}" arg2="debug"/>
<equals arg1="${blt.level}" arg2="verbose"/>
<equals arg1="${blt.level}" arg2="info"/>
</or>
<then>
<!--blt.exec_level is used for most <exec> tasks.-->
<property name="blt.exec_level" value="info"/>
<!--blt.verbose is used to toggle the verbosity on other tasks, such as Drush and Behat-->
<property name="blt.verbose" value="true"/>
</then>
</if>
<echo level="verbose">Executing commands against multisite "${multisite.name}"</echo>
<!-- Default drush alias. -->
<property name="drush.alias" value="${drush.default_alias}" override="false" logoutput="false"/>
<if>
<equals arg1="${env.USER}" arg2="vagrant"/>
<then>
<echo level="verbose">You are running commands inside of a vagrant machine. Setting drush alias to @self.</echo>
<property name="drush.alias" value="self" override="true"/>
</then>
</if>
<target name="echo-property" description="Echoes the value of a Phing property." hidden="true">
<fail unless="property.name" message="property.name must be set!"/>
<echo>${property.name}</echo>
<if>
<isset property="${property.name}"/>
<then>
<echo level="warning">${${property.name}}</echo>
</then>
</if>
</target>
<target name="echo-properties" description="Echoes the value of all Phing properties." hidden="true">
<echoproperties/>
</target>
</project>