Source

mrt-fixity / fixity-demo / make-fixity-home.xml

Full commit
<?xml version="1.0" encoding="UTF-8"?>
<!-- Builds the fixity home -->
<project basedir="." default="create" name="buildstore">
    <target name="-init">
        <echo message="-init entered"/>
        <available file="../fixity-conf/properties/Fixity.properties" property="fixitydemo.properties.present"/>
    </target>
    
    <target name="-initProp">
        <echo message="-initProp entered"/>
        <property file="make-repository.properties"/>
    </target>

    <target name="create" depends="-init">
        <antcall target="-if-repository"/>
    </target>

    <target name="-if-repository" if="fixitydemo.properties.present">
        <property file="../fixity-conf/properties/Fixity.properties"/>
        <echo message="fixitydemo.properties - FixityService=${FixityService}"/>
        <echo message="fixitydemo.properties - db.url=${db.url}"/>
        <echo message="fixitydemo.properties - db.user=${db.user}"/>
        <echo message="fixitydemo.properties - db.password=${db.password}"/>
        <antcall target="handle-repository"/>
    </target>

    <target name="handle-repository"
        depends="-set-conditions, -delete-fixity-home, -test-available, -build-fixity-home">
        <echo message="handle-repository entered"/>
    </target>

    <target name="-set-conditions">
        <echo message="exists.FixityService=${exists.FixityService}"/>
        <condition property="delete.FixityService">
            <equals arg1="${exists.FixityService}" arg2="delete" />
        </condition>
        <echo message="delete.FixityService=${delete.FixityService}"/>
    </target>

    <target name="-delete-fixity-home" if="delete.FixityService">
        <echo message="delete.FixityService entered"/>
        <delete dir="${FixityService}"/>
    </target>

    <target name="-test-available">
        <available file="${FixityService}" property="FixityService.present"/>
        <echo message="test-available entered"/>
        <echo message="FixityService.present=${FixityService.present}"/>
    </target>

    <target name="-build-fixity-home" unless="FixityService.present">
        <echo message="build-fixity-home entered"/>
        <mkdir dir="${FixityService}"/>
        <copy todir="${FixityService}">
            <fileset dir="make/fixity"/>
        </copy>
        <mkdir dir="${FixityService}/log"/>
    </target>
</project>