<?xml version='1.0' encoding='UTF-8'?>
<project basedir="." default="main" name="notifier">

    <property name="widget.browser" value="ff"/>
    <property name="widget.version" value="1"/>
    <property name="widget.archive" value="${phing.project.name}_${widget.browser}_${widget.version}.zip"/>
    <property name="widget.version_dir" value="${widget.browser}_experimental"/>

    
    <property name="ssh.username" value="barupload"/>
    <property name="ssh.host" value="bar.qa.yandex.net"/>
    <property name="ssh.target_dir" value="/var/www/yndbar-buttons/native/${phing.project.name}/${widget.version_dir}/"/>

    
    <fileset dir="." id="files">
        <include name="**"/>
        <exclude name="build.xml"/>
        <exclude name=".package.json"/>
        <exclude name="${widget.archive}"/>
    </fileset>

    <target depends="archive, create_build_file" name="main">
        <exec command="scp ${widget.archive} ${ssh.username}@${ssh.host}:${ssh.target_dir}" dir="."/>
        <phingcall target="clear"/>
    </target>

    <target name="archive">
        <zip destfile="./${widget.archive}">
            <fileset refid="files"/>
        </zip>
    </target>

    
    <property name="build.filename" value="build.txt"/>

    <target name="create_build_file">
        <exec command="date &quote;+%Y%m%d%H%M%S&quote; > ${build.filename}" dir="."/>
    </target>

    <target name="clear">
        <delete file="${widget.archive}"/>
    </target>

</project>