<?xml version="1.0"?>
<project name="Simple" default="build" basedir=".">
<target name="-layout">
<property name="root.path" value="."/>
<property name="lib.path" value="libs"/>
<property name="dist.path" value="dist"/>
<property name="style.path" value="styles"/>
<property name="track.path" value="track"/>
<property name="tutorial.path" value="tutorial"/>
<property name="java.lib.path" value="download/stream/lib"/>
<property file="ssh.properties"/>
</target>
<target name="-setup" depends="-layout">
<taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask">
<classpath>
<fileset dir="${java.lib.path}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</taskdef>
</target>
<target name="-switch" depends="-layout">
<property file="${dist.path}/${dist.name}.properties"/>
<copy todir="${root.path}">
<fileset dir="${dist.path}">
<include name="**/*.php"/>
<include name="**/*.inc"/>
<exclude name="**/*.properties"/>
</fileset>
<filterset>
<filter token="home.path" value="${home.path}"/>
<filter token="database.host" value="${database.host}"/>
<filter token="database.login" value="${database.login}"/>
<filter token="database.password" value="${database.password}"/>
<filter token="database.name" value="${database.name}"/>
</filterset>
</copy>
</target>
<target name="-home" depends="-layout">
<property name="dist.name" value="home"/>
<antcall target="-switch"/>
</target>
<target name="-sourceforge" depends="-layout">
<property name="dist.name" value="sourceforge"/>
<antcall target="-switch"/>
</target>
<target name="deploy" depends="-setup" description="Deploy site to sourceforge">
<antcall target="-sourceforge"/>
<tar tarfile="deploy.tar">
<tarfileset dir="${root.path}">
<include name="**/*.php"/>
<include name="**/*.inc"/>
<include name="${image.path}/**/*"/>
<include name="${style.path}/**/*"/>
<include name="${tutorial.path}/**/*"/>
<include name="${track.path}/**/*"/>
<include name="${lib.path}/**/*"/>
</tarfileset>
</tar>
<gzip zipfile="deploy.tar.gz" src="deploy.tar"/>
<scp file="deploy.tar.gz" todir="${ssh.login}:${ssh.password}@simple.sourceforge.net:${ssh.home}" trust="yes"/>
<sshexec host="simple.sourceforge.net" username="${ssh.login}" password="${ssh.password}" command="tar -xzvf ${ssh.home}/deploy.tar.gz -C ${ssh.home}" trust="yes"/>
<delete file="deploy.tar.gz"/>
<delete file="deploy.tar"/>
<antcall target="-home"/>
<svn javahl="false">
<commit message="Update site" dir="${root.path}"/>
</svn>
</target>
</project>