<project>
    <target name="create-snapshot">
        <!-- remove old images folders from all demo packages-->
        <apply executable="rm">
            <arg value="-rf"/>
            <arg value="*"/>
            <dirset dir="import" includes="**/images"/>
        </apply>

        <!-- create new image folders in all demo packages -->
        <apply executable="mkdir">
            <arg value="-p"/>
            <srcfile suffix="/images" />
            <dirset dir="import" includes="*"/>
        </apply>

        <!-- download images for all demo packages -->
        <apply executable="${basedir}/vendor/oxygenna/oxygenna-ant-theme-build/inc/create-snapshot.sh">
            <dirset dir="import" includes="*"/>
        </apply>


        <antcall target="watermark"/>
    </target>

    <target name="watermark">
        <apply executable="${basedir}/vendor/oxygenna/oxygenna-ant-theme-build/inc/watermark.sh">
            <fileset dir="import">
                <include name="**/images/*-notinclude*"/>
            </fileset>
        </apply>
    </target>


    <target name="test">
        <echo message="Remove old images..." />
        <exec executable="bash" dir="import/images">
            <arg value="-c"/>
            <arg value="rm -rf *"/>
        </exec>

        <echo message="Downloading files from image-list.txt..." />
        <exec executable="bash" dir="import">
            <arg value="-c"/>
            <arg value="cat image-list.txt | xargs wget -P images/"/>
        </exec>
    </target>
</project>