To automatically “build” my extension, I use Ant to do this job for me, because it’s a boring every-time-the-same-steps-to-do job, that a technical automation can do better, faster and more reliable than me. In this case it’s a clean-up/delete-and-copy job. Here is the build.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project name="csevents" default="deployFromDev" basedir=".">
    <description>
        Buildfile to deploy the development version of the Typo3
        extension csevents to the local testing system.
    </description>
    <property name="ExtensionName" value="csevents"/>
    <property name="SourceDirectory" location="${basedir}/${ExtensionName}"/>
    <property name="TargetDirectory" location="${basedir}/../.sandbox/${ExtensionName}"/>

    <target name="deployFromDev" depends="clean">
        <copy todir="${TargetDirectory}">
            <fileset dir="${SourceDirectory}"/>
        </copy>
    </target>

    <target name="clean" description="Clean up the local testing directory">
        <delete dir="${TargetDirectory}"/>
    </target>
</project>

Lines 7-9 just define all properties, i.e. folders and files to handle.

In line 11 you find the copy-job which calls “clean” first. “clean” is located in line 17 simply deleting the complete target directory.

The only thing you have to consider: The developer has to have write-access to the ${TargetDirectory}’s parent directory in order to delete and re-create (copy) the target directory. If you use a ‘.sandbox’ directory (or something similar) in your on ‘home’ or ‘workspace’ directory (like I described in “I am lazy (The Server Architecture)“), this is obviously done out of the box.

If you want to learn more about how to add this to the Eclipse IDE and make it run as comfortable as possible, please refer to the next post auto-ant-ing.

Leave a Reply