Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

162 lines (146 sloc) 6.961 kB
<project name="phpcas-devel" default="dist" basedir=".">
<property file="version.properties"/>
<property file="build.properties"/>
<property name="upload.host" value="jasig01.managed.contegix.com" />
<property name="upload.remotedir" value="/var/www/domains/jasig.org/downloads/htdocs/cas-clients/php" />
<taskdef name="doxygen"
classname="org.doxygen.tools.DoxygenTask"
classpath="utils/ant_doxygen.jar"/>
<!-- compute current date -->
<tstamp>
<format property="date" pattern="d-MMMM-yyyy HH:mma" locale="en"/>
</tstamp>
<!-- ==========================================================
Create pear installable package
-->
<target name="dist" description="Create pear installable and docs packages">
<mkdir dir="dist"/>
<delete dir="tmp" />
<mkdir dir="tmp/cas-${phpcas.version}"/>
<!-- copy source files to tmp directory -->
<copy todir="tmp/cas-${phpcas.version}">
<fileset dir="source" includes="**/*.php" />
<filterchain>
<expandproperties/>
</filterchain>
</copy>
<mkdir dir="tmp/cas-${phpcas.version}/docs"/>
<!-- copy docs files to tmp directory -->
<copy todir="tmp/cas-${phpcas.version}/docs">
<fileset dir="docs" excludes="images/*" />
<filterchain>
<expandproperties/>
</filterchain>
</copy>
<!-- copy images to tmp directory -->
<copy todir="tmp/cas-${phpcas.version}/docs">
<fileset dir="docs" includes="images/*" />
</copy>
<!-- check for the doxygen program, and fail is not found -->
<echo message="checking for doxygen..."/>
<fail message="please set ${doxygen.path} in build.properties" unless="doxygen.path"/>
<available file="${doxygen.path}" type="file" property="doxygen.present"/>
<fail message="doxygen program not found (${doxygen.path})" unless="doxygen.present"/>
<!-- write Doxygen configuration file from template -->
<echo message="write Doxygen configuration file..."/>
<copy file="utils/Doxyfile"
tofile="tmp/Doxyfile">
<filterchain>
<expandproperties/>
<tokenfilter>
<replaceregex pattern="\\" replace="/" flags="g"/>
</tokenfilter>
</filterchain>
</copy>
<!-- call Doxygen -->
<echo message="writing API documentation..."/>
<doxygen doxygenPath="${doxygen.path}" configFilename="${basedir}/tmp/Doxyfile"/>
<!-- write makepackage.php file from template -->
<echo message="write makepackage.php file..."/>
<copy file="utils/makepackage.php"
tofile="tmp/makepackage.php">
<filterchain>
<expandproperties/>
</filterchain>
</copy>
<!-- generate package.xml -->
<echo message="checking for php..."/>
<fail message="please set ${php.path} in build.properties" unless="php.path"/>
<available file="${php.path}" type="file" property="php.present"/>
<fail message="php program not found (${php.path})" unless="php.present"/>
<echo message="building the PEAR package.xml file..."/>
<exec dir="${basedir}" executable="${php.path}" >
<arg line="-f tmp/makepackage.php"/>
</exec>
<copy file="tmp/package.xml"
tofile="tmp/cas-${phpcas.version}/package.xml">
</copy>
<!-- generate PEAR package .tgz -->
<echo message="building the PEAR package..."/>
<exec dir="${basedir}/tmp/cas-${phpcas.version}" executable="${pear.path}" >
<arg line="package package.xml"/>
</exec>
<copy file="tmp/cas-${phpcas.version}/CAS-${phpcas.version}.tgz"
tofile="dist/CAS-${phpcas.version}.tgz">
</copy>
<tar
destfile="dist/docs-${phpcas.version}.tgz"
compression="gzip"
basedir="tmp/cas-${phpcas.version}"
includes="docs/**/*" />
<!--delete dir="tmp" /-->
</target>
<!-- ==========================================================
Upload the distribution files to the download area
-->
<target name="upload"
description="Upload the distribution files to JA-SIG">
<!-- Check that all the properties used for archives upload are set -->
<fail message="please set ${upload.username} in build.properties" unless="upload.username"/>
<fail message="please set ${upload.password} in build.properties" unless="upload.password"/>
<scp
trust="true"
localFile="${basedir}/dist/CAS-${phpcas.version}.tgz"
remoteTodir="${upload.username}:${upload.password}@${upload.host}:${upload.remotedir}" />
<scp
trust="true"
localFile="${basedir}/dist/docs-${phpcas.version}.tgz"
remoteTodir="${upload.username}:${upload.password}@${upload.host}:${upload.remotedir}" />
<sshexec
host="${upload.host}"
username="${upload.username}"
command="cd ${upload.remotedir} &amp;&amp; rm -rf ${phpcas.version} docs &amp;&amp; mkdir ${phpcas.version} &amp;&amp; mv CAS-${phpcas.version}.tgz ${phpcas.version} &amp;&amp; gunzip docs-${phpcas.version}.tgz &amp;&amp; tar xf docs-${phpcas.version}.tar &amp;&amp; mv docs ${phpcas.version} &amp;&amp; rm docs-${phpcas.version}.tar &amp;&amp; echo 'done (you can kill the ant task)'"
password="${upload.password}"
trust="true" />
</target>
<!-- ==========================================================
Make a 'current' symlink to the current version
-->
<target name="makeCurrentSymlink"
description="Make a 'stable' symlink to the current version">
<!-- Check that all the properties used for archives upload are set -->
<fail message="please set ${upload.username} in build.properties" unless="upload.username"/>
<fail message="please set ${upload.password} in build.properties" unless="upload.password"/>
<sshexec
host="${upload.host}"
username="${upload.username}"
command="cd ${upload.remotedir} &amp;&amp; rm -f current &amp;&amp; ln -s ${phpcas.version} current &amp;&amp; echo 'done (you can kill the ant task)'"
password="${upload.password}"
trust="true" />
<sshexec
host="${upload.host}"
username="${upload.username}"
command="cd ${upload.remotedir} &amp;&amp; rm -f current.tgz &amp;&amp; ln -s ${phpcas.version}/CAS-${phpcas.version}.tgz current.tgz &amp;&amp; echo 'done (you can kill the ant task)'"
password="${upload.password}"
trust="true" />
</target>
<!-- ==========================================================
Clean up everything but distribution file
-->
<target name="clean" description="Clean up everything but distribution files">
<delete dir="tmp"/>
</target>
<target name="cleanall" description="Clean up everything including distribution files" depends="clean">
<delete dir="dist"/>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.