| 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
<!-- <![CDATA[
|
| 3 |
$Id: site-fetch.xml,v 1.7 2007/09/29 06:07:34 allisterbeharry Exp $
|
| 4 |
-->
|
| 5 |
<project name="site-fetch" default="main">
|
| 6 |
<!-- ============================================================================================================== -->
|
| 7 |
<!-- @file This is the base site-fetch buld script in DAST. It will fetch a given revision of Drupal core and -->
|
| 8 |
<!-- contrib- modules from CVS, or from a local dir cache or from a .tar.gz. -->
|
| 9 |
<!-- @author Allister Beharry -->
|
| 10 |
<!-- @package org.drupal.dast.base -->
|
| 11 |
<!-- @todo Fetch profiles too -->
|
| 12 |
<!-- @todo Use CVS revision as part of dir or tar.gz name when fetching from local -->
|
| 13 |
<!-- @todo Add option to enforce CVS revision by checking CHANGELOG.txt after fetch -->
|
| 14 |
<!-- @todo Add option to removed files specified in fileset (like *.txt) after fetch -->
|
| 15 |
<!-- ============================================================================================================== -->
|
| 16 |
|
| 17 |
<taskdef name="CreoleSQLExec" classname="phing.tasks.ext.CreoleSQLExecTask"/>
|
| 18 |
<taskdef name="CVS" classname="phing.tasks.system.CVSTask"/>
|
| 19 |
<taskdef name="warn" classname="phing.tasks.system.WarnTask"/>
|
| 20 |
<taskdef name="UnTar" classname="phing.tasks.ext.UnTarTask" />
|
| 21 |
<taskdef name="SimpleTest" classname="phing.Tasks.ext.SimpleTestTask"/>
|
| 22 |
<taskdef name="DumpProperties" classname="DumpPropertiesTask" />
|
| 23 |
<typedef name="SimpleTestFormatter" classname="phing.Tasks.exe.SimpleTestTask" />
|
| 24 |
|
| 25 |
<property name="dast.test" value="${dast.home}${php.directory_separator}src${php.directory_separator}tests"/>
|
| 26 |
<property name="dast.test.site_fetch" value="${dast.test}${php.directory_separator}SiteFetchTest.php"/>
|
| 27 |
|
| 28 |
<!-- =================================
|
| 29 |
target: clean
|
| 30 |
================================= -->
|
| 31 |
<target name="clean" depends="configure" description="--> Deletes and recreates the Drupal site directory, database, and database user.">
|
| 32 |
<echo>-------------------------------------------------</echo>
|
| 33 |
<echo> +++++ Running site-fetch.xml clean +++++ </echo>
|
| 34 |
<echo>-------------------------------------------------</echo>
|
| 35 |
<!--(Re)create drupal.dir-->
|
| 36 |
<available file="${drupal.dir}" type="dir" property="drupal.dir.DirectoryExists"/>
|
| 37 |
<!-- <available file="${drupal.dir}${php.directory_separator}files${php.directory_separator}.htaccess" type="file" property="drupal.dir.htaccess.Exists"/>
|
| 38 |
<if><isset property="drupal.dir.DirectoryExists"/><then>
|
| 39 |
<delete file="${drupal.dir}${php.directory_separator}files${php.directory_separator}.htaccess" /></then>
|
| 40 |
</if> -->
|
| 41 |
|
| 42 |
<if><isset property="drupal.dir.DirectoryExists"/><then>
|
| 43 |
<!--Make all files in dir writeable -->
|
| 44 |
<!-- <if><not><equals arg1="${host.fstype}" arg2="WINNT" /></not><then>
|
| 45 |
<warn>Chmoding permissions on the ${drupal.dir} directory only works under UNIX-type filesystems; you will have to change permissions on ${drupal.dir} manually if necessary.</warn>
|
| 46 |
</then>
|
| 47 |
<else>
|
| 48 |
<Chmod Mode="0777">
|
| 49 |
<fileset dir="${drupal.filesDirPath}/">
|
| 50 |
<include name="**" />
|
| 51 |
</fileset>
|
| 52 |
</Chmod>
|
| 53 |
</else>
|
| 54 |
</if> -->
|
| 55 |
<available file="${drupal.dir}${php.directory_separator}${drupal.settings.location}" type="file" property="drupal.settings.locationExists"/>
|
| 56 |
<if><isset property="drupal.settings.locationExists"/><then>
|
| 57 |
<Chmod Mode="0777" file="${drupal.dir}${php.directory_separator}${drupal.settings.location}" /></then>
|
| 58 |
</if>
|
| 59 |
<delete dir="${drupal.dir}" includeemptydirs="true" verbose="false" failonerror="true"/>
|
| 60 |
<echo>${drupal.dir} deleted </echo>
|
| 61 |
</then>
|
| 62 |
</if>
|
| 63 |
<mkdir dir="${drupal.dir}"/>
|
| 64 |
</target>
|
| 65 |
|
| 66 |
<!-- =================================
|
| 67 |
target: main
|
| 68 |
================================= -->
|
| 69 |
<target name="main" depends="configure" description="-->Runs the clean, fetchCore, fetchModules tasks in sequence. ">
|
| 70 |
<echo>-------------------------------------------------</echo>
|
| 71 |
<echo> +++++ Running site-fetch.xml main +++++ </echo>
|
| 72 |
<echo>-------------------------------------------------</echo>
|
| 73 |
<if> <not><equals arg1="${build.run.clean}" arg2="no"/></not> <then>
|
| 74 |
<phingcall target="clean" /> </then>
|
| 75 |
</if>
|
| 76 |
<phingcall target="fetchCore" />
|
| 77 |
<phingcall target="fetchModules" />
|
| 78 |
</target>
|
| 79 |
|
| 80 |
<!-- =================================
|
| 81 |
target: fetchCore
|
| 82 |
================================= -->
|
| 83 |
<target name="fetchCore" depends="configure" description="--> Fetches Drupal core from CVS or local directory or tarball.">
|
| 84 |
<echo>-------------------------------------------------</echo>
|
| 85 |
<echo> +++++ Running site-fetch.xml fetchCore +++++ </echo>
|
| 86 |
<echo>-------------------------------------------------</echo>
|
| 87 |
<!--Fetch core from CVS-->
|
| 88 |
<if><equals arg1="${drupal.core.method}" arg2="CVS" />
|
| 89 |
<then>
|
| 90 |
<!--Check for required CVS properties-->
|
| 91 |
<if><not><isset property="drupal.core.Cvs.CvsRoot"/></not>
|
| 92 |
<then>
|
| 93 |
<fail>drupal.core.Cvs.CvsRoot property not set, check the properties files files for omissions or bad syntax</fail>
|
| 94 |
</then>
|
| 95 |
</if>
|
| 96 |
<if><not><isset property="drupal.core.Cvs.Command"/></not>
|
| 97 |
<then>
|
| 98 |
<fail>drupal.core.Cvs.Command property not set, check the properties files files for omissions or bad syntax</fail>
|
| 99 |
</then>
|
| 100 |
</if>
|
| 101 |
<if><not><isset property="drupal.core.Cvs.Revision"/></not>
|
| 102 |
<then>
|
| 103 |
<fail>drupal.core.Cvs.Revision property not set, check the properties files files for omissions or bad syntax</fail>
|
| 104 |
</then>
|
| 105 |
</if>
|
| 106 |
|
| 107 |
<!--Set optional CVS properties with defaults if they aren't set-->
|
| 108 |
<if><not><isset property="drupal.core.Cvs.Port"/></not>
|
| 109 |
<then>
|
| 110 |
<property name="drupal.core.Cvs.Port" value="2401"/>
|
| 111 |
<echo>drupal.core.Cvs.Port property not set, using default value 2401.</echo>
|
| 112 |
</then>
|
| 113 |
</if>
|
| 114 |
<if><not><isset property="drupal.core.Cvs.CompressionLevel"/></not>
|
| 115 |
<then>
|
| 116 |
<property name="drupal.core.Cvs.CompressionLevel" value="6"/>
|
| 117 |
<echo>drupal.core.Cvs.CompressionLevel property not set, using default value 6.</echo>
|
| 118 |
</then>
|
| 119 |
</if>
|
| 120 |
<if><not><isset property="drupal.core.Cvs.Quiet"/></not>
|
| 121 |
<then>
|
| 122 |
<property name="drupal.core.Cvs.Quiet" value="false"/>
|
| 123 |
<echo>drupal.core.Cvs.Quiet property not set, using default value false.</echo>
|
| 124 |
</then>
|
| 125 |
</if>
|
| 126 |
<if><not><isset property="drupal.core.Cvs.FailOnError"/></not>
|
| 127 |
<then>
|
| 128 |
<property name="drupal.core.Cvs.FailOnError" value="true"/>
|
| 129 |
<echo>drupal.core.Cvs.FailOnError property not set, using default value true.</echo>
|
| 130 |
</then>
|
| 131 |
</if>
|
| 132 |
<if><not><isset property="drupal.core.Cvs.Output"/></not>
|
| 133 |
<then>
|
| 134 |
<property name="drupal.core.Cvs.Output" value="${build.log.defaultdir}${php.directory_separator}site-fetch-cvs-core-output.log"/>
|
| 135 |
<echo>drupal.core.Cvs.Output property not set, using default value ${build.log.defaultdir}${php.directory_separator}site-fetch-cvs-core-output.log .</echo>
|
| 136 |
</then>
|
| 137 |
</if>
|
| 138 |
<if><not><isset property="drupal.core.Cvs.Error"/></not>
|
| 139 |
<then>
|
| 140 |
<property name="drupal.core.Cvs.Error" value="${build.log.defaultdir}${php.directory_separator}site-fetch-cvs-core-error.log"/>
|
| 141 |
<echo>drupal.core.Cvs.Error property not set, using default value ${build.log.defaultdir}${php.directory_separator}site-fetch-cvs-core-error.log .</echo>
|
| 142 |
</then>
|
| 143 |
</if>
|
| 144 |
|
| 145 |
<!--Create drupal.dir if it doesn't exist-->
|
| 146 |
<available file="${drupal.dir}" type="dir" property="drupal.dir.dirExists" />
|
| 147 |
<if> <not><isset property="drupal.dir.dirExists" /></not> <then>
|
| 148 |
<echo> ${drupal.dir} does not exist, attempting to create...</echo>
|
| 149 |
<mkdir dir="${drupal.dir}"/>
|
| 150 |
</then>
|
| 151 |
</if>
|
| 152 |
<!--Run CVS operation-->
|
| 153 |
|
| 154 |
<echo>Executing CVS command to fetch core...this may take a few minutes...see ${drupal.core.Cvs.Output} and ${drupal.core.Cvs.Error} for details when completed.</echo>
|
| 155 |
<CVS CvsRoot="${drupal.core.Cvs.CvsRoot}" Port="${drupal.core.Cvs.Port}" Command="${drupal.core.Cvs.Command}" CompressionLevel="${drupal.core.Cvs.CompressionLevel}"
|
| 156 |
Quiet="${drupal.core.Cvs.Quiet}" FailOnError="${drupal.core.Cvs.FailOnError}"
|
| 157 |
Module="drupal" ModulePath="${drupal.dir.basename}" Tag="${drupal.core.Cvs.Revision}" Dest="${drupal.dir.root}"
|
| 158 |
Output="${drupal.core.Cvs.Output}" Error="${drupal.core.Cvs.Error}"/>
|
| 159 |
|
| 160 |
</then>
|
| 161 |
</if> <!-- if ${drupal.core.method} =="CVS" -->
|
| 162 |
|
| 163 |
<if><equals arg1="${drupal.core.method}" arg2="directory"/><!--Fetch core from local directory-->
|
| 164 |
<then>
|
| 165 |
<available file="${drupal.core.sourcedir}" property="drupal.core.sourcedirExists"/>
|
| 166 |
<if><not><isset property="drupal.core.sourcedirExists"/></not>
|
| 167 |
<then>
|
| 168 |
<fail>The directory ${drupal.core.sourcedir} could not be found. Stopping. </fail>
|
| 169 |
</then>
|
| 170 |
</if>
|
| 171 |
<available file="${drupal.core.sourcedir}${php.directory_separator}index.php" property="drupal.core.sourcedir.index_phpExists"/>
|
| 172 |
<if><not><isset property="drupal.core.sourcedir.index_phpExists"/></not>
|
| 173 |
<then>
|
| 174 |
<fail>Could not find index.php in ${drupal.core.sourcedir} - verify that this directory is the parent directory containing the Drupal 6 source. Stopping.</fail>
|
| 175 |
</then>
|
| 176 |
</if>
|
| 177 |
<echo>Preparing to copy core files from ${drupal.core.sourcedir}...this may take a few secs...</echo>
|
| 178 |
<copy todir="${drupal.dir}" includeemptydirs="true" overwrite="true">
|
| 179 |
<fileset dir="${drupal.core.sourcedir}/">
|
| 180 |
<include name="**" />
|
| 181 |
</fileset>
|
| 182 |
</copy>
|
| 183 |
</then>
|
| 184 |
</if> <!-- if ${drupal.core.method} == directory -->
|
| 185 |
|
| 186 |
<!-- if ${drupal.core.method} == tarball -->
|
| 187 |
<if> <or><equals arg1="${drupal.core.method}" arg2="tarball"/><equals arg1="${drupal.core.method}" arg2="tar"/></or><then>
|
| 188 |
<available file="${drupal.core.sourcetar}" property="drupal.core.sourcetarExists"/>
|
| 189 |
<if><not><isset property="drupal.core.sourcetarExists"/></not> <then>
|
| 190 |
<fail>The file ${drupal.core.sourcetar} could not be found. Stopping. </fail>
|
| 191 |
</then>
|
| 192 |
</if>
|
| 193 |
<UnTar file="${drupal.core.sourcetar}" todir="${drupal.dir}" />
|
| 194 |
<!--The files will be in a folder called basename(${drupal.core.sourcetar}, tar.gz) under drupal.dir so move them up one level -->
|
| 195 |
<php expression = "basename('${drupal.core.sourcetar}', '.tar.gz')" returnProperty="drupal.dir.tar" />
|
| 196 |
<echo>Moving contents of ${drupal.dir}${php.directory_separator}${drupal.dir.tar} to parent ${drupal.dir}</echo>
|
| 197 |
<move todir="${drupal.dir}" includeemptydirs="true">
|
| 198 |
<fileset dir="${drupal.dir}${php.directory_separator}${drupal.dir.tar}">
|
| 199 |
<include name="**" />
|
| 200 |
</fileset>
|
| 201 |
</move>
|
| 202 |
<!--Then delete the subfolder-->
|
| 203 |
<delete dir="${drupal.dir}${php.directory_separator}${drupal.dir.tar}" includeemptydirs="true" verbose="false" failonerror="true" />
|
| 204 |
</then>
|
| 205 |
|
| 206 |
|
| 207 |
</if> <!-- if ${drupal.core.method} == tarball -->
|
| 208 |
|
| 209 |
</target>
|
| 210 |
|
| 211 |
<!-- =================================
|
| 212 |
target: fetchModules
|
| 213 |
================================= -->
|
| 214 |
<target name="fetchModules" depends="configure" description="--> Fetches Drupal modules from CVS or local directory.">
|
| 215 |
<echo>-------------------------------------------------</echo>
|
| 216 |
<echo> +++++ Running site-fetch.xml fetchModules +++++ </echo>
|
| 217 |
<echo>-------------------------------------------------</echo>
|
| 218 |
|
| 219 |
<!--Create drupal.modules.dir if it doesn't exist-->
|
| 220 |
<available file="${drupal.dir}${php.directory_separator}${drupal.modules.dir}" type="dir" property="drupal.modules.dir.dirExists" />
|
| 221 |
<if> <not><isset property="drupal.modules.dir.dirExists" /></not> <then>
|
| 222 |
<echo> ${drupal.dir}${php.directory_separator}${drupal.modules.dir} does not exist, attempting to create...</echo>
|
| 223 |
<mkdir dir="${drupal.dir}${php.directory_separator}${drupal.modules.dir}"/>
|
| 224 |
</then>
|
| 225 |
</if>
|
| 226 |
<property name="modules.dest" value="${drupal.dir}${php.directory_separator}${drupal.modules.dir}" />
|
| 227 |
|
| 228 |
<!--Fetch modules from CVS-->
|
| 229 |
<if><equals arg1="${drupal.modules.method}" arg2="CVS" />
|
| 230 |
<then>
|
| 231 |
<!--Check for required CVS properties-->
|
| 232 |
<if><not><isset property="drupal.modules.Cvs.CvsRoot"/></not>
|
| 233 |
<then>
|
| 234 |
<fail>drupal.modules.Cvs.CvsRoot property not set, check the properties files files for omissions or bad syntax</fail>
|
| 235 |
</then>
|
| 236 |
</if>
|
| 237 |
<if><not><isset property="drupal.modules.Cvs.Path"/></not>
|
| 238 |
<then>
|
| 239 |
<fail>drupal.modules.Cvs.Path property not set, check the properties files files for omissions or bad syntax</fail>
|
| 240 |
</then>
|
| 241 |
</if>
|
| 242 |
<if><not><isset property="drupal.modules.Cvs.Command"/></not>
|
| 243 |
<then>
|
| 244 |
<fail>drupal.modules.Cvs.Command property not set, check the properties files files for omissions or bad syntax</fail>
|
| 245 |
</then>
|
| 246 |
</if>
|
| 247 |
<if><not><isset property="drupal.modules.Cvs.Revision"/></not>
|
| 248 |
<then>
|
| 249 |
<fail>drupal.modules.Cvs.Revision property not set, check the properties files files for omissions or bad syntax</fail>
|
| 250 |
</then>
|
| 251 |
</if>
|
| 252 |
|
| 253 |
<!--Set optional CVS properties with defaults if they aren't set-->
|
| 254 |
<if><not><isset property="drupal.modules.Cvs.Port"/></not>
|
| 255 |
<then>
|
| 256 |
<property name="drupal.modules.Cvs.Port" value="2401"/>
|
| 257 |
<echo>drupal.modules.Cvs.Port property not set, using default value 2401.</echo>
|
| 258 |
</then>
|
| 259 |
</if>
|
| 260 |
<if><not><isset property="drupal.modules.Cvs.CompressionLevel"/></not>
|
| 261 |
<then>
|
| 262 |
<property name="drupal.modules.Cvs.CompressionLevel" value="6"/>
|
| 263 |
<echo>drupal.modules.Cvs.CompressionLevel property not set, using default value 6.</echo>
|
| 264 |
</then>
|
| 265 |
</if>
|
| 266 |
<if><not><isset property="drupal.modules.Cvs.Quiet"/></not>
|
| 267 |
<then>
|
| 268 |
<property name="drupal.modules.Cvs.Quiet" value="false"/>
|
| 269 |
<echo>drupal.modules.Cvs.Quiet property not set, using default value false.</echo>
|
| 270 |
</then>
|
| 271 |
</if>
|
| 272 |
<if><not><isset property="drupal.modules.Cvs.FailOnError"/></not>
|
| 273 |
<then>
|
| 274 |
<property name="drupal.modules.Cvs.FailOnError" value="true"/>
|
| 275 |
<echo>drupal.modules.Cvs.FailOnError property not set, using default value true.</echo>
|
| 276 |
</then>
|
| 277 |
</if>
|
| 278 |
<if><not><isset property="drupal.modules.Cvs.Output"/></not>
|
| 279 |
<then>
|
| 280 |
<property name="drupal.modules.Cvs.Output" value="${build.log.defaultdir}${php.directory_separator}site-fetch-cvs-modules-output.log"/>
|
| 281 |
<echo>drupal.modules.Cvs.Output property not set, using default value ${build.log.defaultdir}${php.directory_separator}site-fetch-cvs-modules-output.log .</echo>
|
| 282 |
</then>
|
| 283 |
</if>
|
| 284 |
<if><not><isset property="drupal.modules.Cvs.Error"/></not>
|
| 285 |
<then>
|
| 286 |
<property name="drupal.modules.Cvs.Error" value="${build.log.defaultdir}${php.directory_separator}site-fetch-cvs-modules-error.log"/>
|
| 287 |
<echo>drupal.core.Cvs.Error property not set, using default value ${build.log.defaultdir}${php.directory_separator}site-fetch-cvs-modules-error.log .</echo>
|
| 288 |
</then>
|
| 289 |
</if>
|
| 290 |
|
| 291 |
<!--Run CVS task on each module-->
|
| 292 |
<echo>Executing CVS commands to fetch modules...</echo>
|
| 293 |
<foreach list="${drupal.modules.list}" param="module.name" target="fetchModulefromCVS"/>
|
| 294 |
</then>
|
| 295 |
</if> <!-- if ${drupal.modules.method} =="CVS" -->
|
| 296 |
|
| 297 |
<!--Fetch modules from source dir-->
|
| 298 |
<if><equals arg1="${drupal.modules.method}" arg2="directory"/>
|
| 299 |
<then>
|
| 300 |
<available file="${drupal.modules.sourcedir}" property="drupal.modules.sourcedirExists"/>
|
| 301 |
<if> <not><isset property="drupal.modules.sourcedirExists"/></not> <!--Directory doesn't exist-->
|
| 302 |
<then>
|
| 303 |
<fail>The directory ${drupal.modules.sourcedir} could not be found. Stopping. </fail>
|
| 304 |
</then>
|
| 305 |
</if>
|
| 306 |
<foreach list="${drupal.modules.list}" param="module.name" target="fetchModulefromSourceDirectory"/>
|
| 307 |
</then>
|
| 308 |
</if>
|
| 309 |
</target>
|
| 310 |
|
| 311 |
<!-- - - - - - - - - - - - - - - - - -
|
| 312 |
target: fetchModulefromSourceDirectory
|
| 313 |
- - - - - - - - - - - - - - - - - -->
|
| 314 |
<target name="fetchModulefromSourceDirectory" description="--> Private task used internally to retrieve a module from a local source directory given the module name.">
|
| 315 |
<property name="module.sourcedir" value="${drupal.modules.sourcedir}${php.directory_separator}${module.name}" />
|
| 316 |
<available file="${module.sourcedir}" property="$modulesourcedirectoryExists"/>
|
| 317 |
<if><not><isset property="$modulesourcedirectoryExists"/></not>
|
| 318 |
<then>
|
| 319 |
<warn>Did not find ${module.sourcedir} directory, skipping...</warn>
|
| 320 |
</then>
|
| 321 |
<else>
|
| 322 |
<if><not><isset property="drupal.modules.sourcedir.overwrite"/></not>
|
| 323 |
<then>
|
| 324 |
<property name="drupal.modules.sourcedir.overwrite" value="false"/>
|
| 325 |
<echo>drupal.modules.sourcedir.overwrite property not set, using default value false.</echo>
|
| 326 |
</then>
|
| 327 |
</if>
|
| 328 |
<echo>Preparing to copy ${module.name} from ${module.sourcedir}...this may take a few secs...</echo>
|
| 329 |
<copy todir="${moudules.dest}" includeemptydirs="true" overwrite="${drupal.modules.sourcedir.overwrite}">
|
| 330 |
<fileset dir="${drupal.modules.sourcedir}">
|
| 331 |
<include name="**${module.name}"/>
|
| 332 |
</fileset>
|
| 333 |
</copy>
|
| 334 |
|
| 335 |
</else>
|
| 336 |
</if>
|
| 337 |
</target>
|
| 338 |
|
| 339 |
<!-- =================================
|
| 340 |
target: fetchModulefromCVS
|
| 341 |
================================= -->
|
| 342 |
<target name="fetchModulefromCVS" description="--> Private task used internally to retrieve a module from CVS given the module name">
|
| 343 |
<echo>Executing CVS command to fetch module ${module.name} revision ${drupal.modules.Cvs.Revision}...see ${drupal.modules.Cvs.Output} and ${drupal.modules.Cvs.Error} for details when completed.</echo>
|
| 344 |
<CVS CvsRoot="${drupal.modules.Cvs.CvsRoot}" Port="${drupal.modules.Cvs.Port}" Command="${drupal.modules.Cvs.Command}" CompressionLevel="${drupal.core.Cvs.CompressionLevel}"
|
| 345 |
Quiet="${drupal.modules.Cvs.Quiet}" FailOnError="${drupal.modules.Cvs.FailOnError}"
|
| 346 |
Module="${module.name}" ModulePath="${drupal.modules.Cvs.Path}" Tag="${drupal.modules.Cvs.Revision}" Dest="${modules.dest}"
|
| 347 |
Output="${drupal.modules.Cvs.Output}-${module.name}.log" Error="${drupal.modules.Cvs.Error}-${module.name}.log"/>
|
| 348 |
|
| 349 |
</target>
|
| 350 |
|
| 351 |
<!-- =============================================================
|
| 352 |
target: configure
|
| 353 |
Configures the build with properties from the properties file
|
| 354 |
============================================================= -->
|
| 355 |
<target name="configure" description="--> Configures the build with properties from properties file.">
|
| 356 |
<if><isset property="basePropertiesFile"/><then>
|
| 357 |
<available file="${project.basedir}${php.directory_separator}${basePropertiesFile}" property="basePropertiesFileExists"/>
|
| 358 |
<if><not><isset property="basePropertiesFileExists"/></not><then>
|
| 359 |
<fail>Could not find the specified base properties file ${project.basedir}${php.directory_separator}${basePropertiesFile}. Stopping.</fail>
|
| 360 |
</then>
|
| 361 |
<else>
|
| 362 |
<property name="build.basePropertiesFile" value="${project.basedir}${php.directory_separator}${basePropertiesFile}" />
|
| 363 |
<echo>Using ${build.basePropertiesFile} as base properties file.</echo>
|
| 364 |
</else>
|
| 365 |
</if>
|
| 366 |
</then>
|
| 367 |
|
| 368 |
<else> <!--Use default base properties file -->
|
| 369 |
<available file="${project.basedir}${php.directory_separator}drupalorg_testing-site-base.properties" property="basePropertiesFileExists"/>
|
| 370 |
<if><not><isset property="basePropertiesFileExists"/></not><then>
|
| 371 |
<warn>Could not find the default base properties file ${project.basedir}${php.directory_separator}drupalorg_testing-site-base.properties. Only the user properties file can be used.</warn>
|
| 372 |
</then>
|
| 373 |
<else>
|
| 374 |
<property name="build.basePropertiesFile" value="${project.basedir}${php.directory_separator}drupalorg_testing-site-base.properties" />
|
| 375 |
<echo>Using default base properties file ${build.basePropertiesFile}.</echo>
|
| 376 |
</else>
|
| 377 |
</if>
|
| 378 |
</else>
|
| 379 |
</if>
|
| 380 |
|
| 381 |
<if><isset property="propertiesFile"/><then>
|
| 382 |
<!--Use user properties from specified file -->
|
| 383 |
<available file="${project.basedir}${php.directory_separator}${propertiesFile}" property="propertiesFileExists"/>
|
| 384 |
<if><not><isset property="propertiesFileExists"/></not><then>
|
| 385 |
<fail>Could not find the specified user properties file ${project.basedir}${php.directory_separator}${propertiesFile}. Stopping.</fail>
|
| 386 |
</then>
|
| 387 |
<else>
|
| 388 |
<property name="build.propertiesFile" value="${project.basedir}${php.directory_separator}${propertiesFile}" />
|
| 389 |
<echo>Using ${build.propertiesFile} as user properties file.</echo>
|
| 390 |
</else>
|
| 391 |
</if>
|
| 392 |
</then>
|
| 393 |
|
| 394 |
<else> <!--Use default user properties file -->
|
| 395 |
<available file="${project.basedir}${php.directory_separator}drupalorg_testing-site.properties" property="propertiesFileExists"/>
|
| 396 |
<if><not><isset property="propertiesFileExists"/></not><then>
|
| 397 |
<warn>Could not find the default user properties file ${project.basedir}${php.directory_separator}drupalorg_testing-site.properties. Only the base properties file will be used.</warn>
|
| 398 |
</then>
|
| 399 |
<else>
|
| 400 |
<property name="build.propertiesFile" value="${project.basedir}${php.directory_separator}drupalorg_testing-site.properties" />
|
| 401 |
<echo>Using ${build.propertiesFile} as default user properties file.</echo>
|
| 402 |
</else>
|
| 403 |
</if>
|
| 404 |
</else>
|
| 405 |
</if>
|
| 406 |
|
| 407 |
|
| 408 |
<if><and><not><isset property="build.basePropertiesFile" /></not><not><isset property="build.propertiesFile" /></not></and><then>
|
| 409 |
<fail>Cannot use either the user or base properties files. Stopping </fail>
|
| 410 |
</then>
|
| 411 |
</if>
|
| 412 |
|
| 413 |
<if><isset property="build.basePropertiesFile" /><then>
|
| 414 |
<property file="${build.basePropertiesFile}" override="true"/>
|
| 415 |
</then>
|
| 416 |
<else><echo>No base properties file used.</echo></else>
|
| 417 |
</if>
|
| 418 |
|
| 419 |
<if><isset property="build.propertiesFile" /><then>
|
| 420 |
<if><equals arg1="${build.propertiesFile}" arg2="${dast.home}${php.directory_separator}drupalorg_testing-site.properties" /><then>
|
| 421 |
<if><and><isset property="build.basePropertiesFile" /><not><equals arg1="${build.basePropertiesFile}" arg2="${dast.home}${php.directory_separator}drupalorg_testing-site-base.properties" /></not></and><then>
|
| 422 |
<echo>The base properties file ${build.basePropertiesFile} is not the default so the default user properties file will not be loaded.</echo>
|
| 423 |
</then>
|
| 424 |
<else>
|
| 425 |
<property file="${build.propertiesFile}" override="true"/>
|
| 426 |
<echo>Using default user properties file ${dast.home}${php.directory_separator}drupalorg_testing-site.properties.</echo>
|
| 427 |
</else>
|
| 428 |
</if>
|
| 429 |
</then>
|
| 430 |
<else><property file="${build.propertiesFile}" override="true"/></else>
|
| 431 |
</if>
|
| 432 |
</then>
|
| 433 |
<else><echo>No user properties file used.</echo></else>
|
| 434 |
</if>
|
| 435 |
|
| 436 |
<if><not><isset property="build.log.defaultdir"/></not><then>
|
| 437 |
<fail>build.log.defaultdir property not set, check the ${propertiesFile} file for omissions or bad syntax</fail>
|
| 438 |
</then>
|
| 439 |
</if>
|
| 440 |
<available file="${build.log.defaultdir}" property="build.log.defaultdirExists"/>
|
| 441 |
<if><not><isset property="build.log.defaultdirExists"/></not><then>
|
| 442 |
<echo>${build.log.defaultdir} doesn't exist, attempting to create...</echo>
|
| 443 |
<mkdir dir="${build.log.defaultdir}"/>
|
| 444 |
</then>
|
| 445 |
</if>
|
| 446 |
|
| 447 |
|
| 448 |
<if>
|
| 449 |
<not><isset property="drupal.dir"/></not>
|
| 450 |
<then>
|
| 451 |
<fail>drupal.dir property not set, check the properties files files for omissions or bad syntax</fail>
|
| 452 |
</then>
|
| 453 |
</if>
|
| 454 |
|
| 455 |
<if>
|
| 456 |
<not><isset property="drupal.core.method"/></not>
|
| 457 |
<then>
|
| 458 |
<fail>drupal.core.method property not set, check the properties files files for omissions or bad syntax</fail>
|
| 459 |
</then>
|
| 460 |
</if>
|
| 461 |
|
| 462 |
<if>
|
| 463 |
<not><isset property="drupal.modules.method"/></not>
|
| 464 |
<then>
|
| 465 |
<fail>drupal.modules.method property not set, check the properties files files for omissions or bad syntax</fail>
|
| 466 |
</then>
|
| 467 |
</if>
|
| 468 |
<!--Get the root of the dir specified - this will be used as the working directory for the drupal module -->
|
| 469 |
<php expression = "realpath('${drupal.dir}/../')" returnProperty="drupal.dir.root" />
|
| 470 |
<!--local dir passed as -d option to CVS -->
|
| 471 |
<php expression = "basename('${drupal.dir}')" returnProperty="drupal.dir.basename" />
|
| 472 |
</target>
|
| 473 |
|
| 474 |
<!-- =================================
|
| 475 |
target: dump-config
|
| 476 |
================================= -->
|
| 477 |
<target name="dump-config" depends="configure" description="--> Prints out all the values of the properties that are currently configuring the build">
|
| 478 |
<!-- <echo> build.testing: ${build.testing}</echo>
|
| 479 |
<echo> build.basePropertiesFile: ${build.basePropertiesFile}</echo>
|
| 480 |
<echo> build.propertiesFile: ${build.propertiesFile}</echo>
|
| 481 |
<echo> build.run.clean: ${build.run.clean}</echo>
|
| 482 |
<echo> drupal.dir: ${drupal.dir}</echo>
|
| 483 |
<echo> drupal.core.method: ${drupal.core.method}</echo>
|
| 484 |
<echo> drupal.core.Cvs.Command: ${drupal.core.Cvs.Command}</echo>-->
|
| 485 |
<!--More will be added as needed -->
|
| 486 |
<!-- <phing phingfile="${dast.home}${php.directory_separator}src${php.directory_separator}dast-project-configure.xml" target="pingback" />
|
| 487 |
<echo>${build.clean}</echo> -->
|
| 488 |
<!--
|
| 489 |
<php expression = "realpath('${drupal.dir}/../')" returnProperty="sum" />
|
| 490 |
<echo>${sum}</echo>
|
| 491 |
<php expression = "basename(realpath('${drupal.dir}'))" returnProperty="sum" />
|
| 492 |
<echo>${sum}</echo>
|
| 493 |
<php expression = "basename('drupal-5.2.tar.gz', '.tar.gz')" returnProperty="sum" />
|
| 494 |
<echo>${sum}</echo> -->
|
| 495 |
<DumpProperties />
|
| 496 |
</target>
|
| 497 |
|
| 498 |
|
| 499 |
<!-- =================================
|
| 500 |
target: test
|
| 501 |
================================= -->
|
| 502 |
<target name="test" description="--> Runs the Simpletest unit test suite for this build file">
|
| 503 |
<echo>-------------------------------------------------</echo>
|
| 504 |
<echo> +++++ Running site-fetch.xml test +++++ </echo>
|
| 505 |
<echo>-------------------------------------------------</echo>
|
| 506 |
<adhoc><![CDATA[
|
| 507 |
//echo php_uname();
|
| 508 |
//echo PHP_OS;
|
| 509 |
// Cannot use __FILE__ because that is the AdhocTask not this build.xml file
|
| 510 |
define('PHING_TEST_BASE', realpath(dirname($this->getProject()->getProperty('phing.file'))));
|
| 511 |
//echo (PHING_TEST_BASE);
|
| 512 |
define('DAST_HOME', '${dast.home}'); define('DAST_TEST', '${dast.test}');
|
| 513 |
//echo (DAST_HOME); echo(DAST_TEST);
|
| 514 |
//echo(PHING_TEST_BASE.DIRECTORY_SEPARATOR.'site-fetch.xml');
|
| 515 |
//echo(DAST_TEST.DIRECTORY_SEPARATOR.'site-fetch-test.properties');
|
| 516 |
define(BASE_PROPERTIES_FILE, '${build.basePropertiesFile}');
|
| 517 |
define(CUSTOM_PROPERTIES_FILE, '${build.PropertiesFile}');
|
| 518 |
]]></adhoc>
|
| 519 |
|
| 520 |
<fileset dir="${dast.test}" id="site_fetch_tests">
|
| 521 |
<include name="SiteFetchTest.php"/>
|
| 522 |
</fileset>
|
| 523 |
|
| 524 |
<SimpleTest haltonerror="true" haltonfailure="false" printsummary="false">
|
| 525 |
<!-- <formatter type="xml" usefile="true" todir="${dast.test}${php.directory_separator}reports" outfile="site-fetch-test-results.xml" /> -->
|
| 526 |
<formatter type="plain" usefile="false" />
|
| 527 |
<fileset refid="site_fetch_tests"/>
|
| 528 |
</SimpleTest>
|
| 529 |
|
| 530 |
</target>
|
| 531 |
|
| 532 |
</project>
|