Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Commit

Permalink
Derive project base directory based on phing file location
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperg committed Sep 12, 2011
1 parent afed81c commit d95cf18
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ This documentation has been generated by
[phrocco](https://github.com/oneblackbear/phrocco)
- a PHP port of the literate documentation generator Docco. -->

<project name="phing-drupal" default="build" basedir=".">
<project name="phing-drupal" default="build">

<!-- ## Main targets -->

Expand Down Expand Up @@ -752,6 +752,12 @@ You can create your own properties file by copying the
`build.default.properties` file to the root directory, rename it
`build.properties` and modify it according to your project. -->
<target name="load-properties">
<php function="dirname" returnProperty="phing.dir">
<param value="${phing.file}"/>
</php>

<property name="project.basedir" value="${phing.dir}" />

<!-- Use condition instead of unless property as we cannot unset properties in Phing -->
<if>
<or>
Expand All @@ -771,10 +777,8 @@ root directory. -->
project root directory -->
<available file="${project.basedir}/../build.properties"/>
<then>
<property name="project.basedir" value="${project.basedir}/../"
override="true"/>
<resolvepath propertyName="project.basedir"
file="${project.basedir}"/>
file="${project.basedir}/../"/>
</then>
</if>

Expand All @@ -784,9 +788,6 @@ root directory. -->
value="${phing.dir}/build.default.properties" />
<!-- Allow override using `build.properties` in build file
directory -->
<php function="dirname" returnProperty="phing.dir">
<param value="${phing.file}"/>
</php>
<available file="${phing.dir}/build.properties"
property="project.properties.file"
value="${phing.dir}/build.properties" />
Expand Down

0 comments on commit d95cf18

Please sign in to comment.