<?xml version="1.0" encoding="utf-8"?>
<!--
** This is a template build file for a JOSM  plugin.
**
** Maintaining versions
** ====================
** see README.template
**
** Usage
** =====
** To build it run
**
**    > ant  dist
**
** To install the generated plugin locally (in you default plugin directory) run
**
**    > ant  install
**
** The generated plugin jar is not automatically available in JOSMs plugin configuration
** dialog. You have to check it in first.
**
** Use the ant target 'publish' to check in the plugin and make it available to other
** JOSM users:
**    set the properties commit.message and plugin.main.version
** and run
**    > ant  publish
**
**
-->
<project name="videomapping" default="dist" basedir=".">

    <!-- enter the SVN commit message -->
    <property name="commit.message" value="videomapping"/>
    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    <property name="plugin.main.version" value="4980"/>

    <!--
    **********************************************************
    ** include targets that all plugins have in common
    **********************************************************
    -->
    <import file="../build-common.xml"/>

    <property name="vlcj" value="${plugin.lib.dir}/vlcj-2.1.0.jar"/>
    <property name="jna" value="${plugin.lib.dir}/jna-3.4.0.jar"/>
    <property name="platform" value="${plugin.lib.dir}/platform-3.4.0.jar"/>
    <property name="log4j" value="${plugin.lib.dir}/log4j.jar"/>
    <!-- classpath -->
    <path id="classpath">
        <pathelement path="${josm}"/>
        <pathelement location="${vlcj}"/>
        <!--Add extra libraries -->
        <pathelement location="${jna}"/>
        <pathelement location="${platform}"/>
        <pathelement location="${log4j}"/>
    </path>
    <!--
    **********************************************************
    ** compile - complies the source tree
    ** Overrides the target from build-common.xml
    **********************************************************
    -->
    <target name="compile" depends="init">
        <echo message="compiling sources for ${plugin.jar} ..."/>
        <javac srcdir="src" classpathref="classpath" debug="true" destdir="${plugin.build.dir}">
            <compilerarg value="-Xlint:deprecation"/>
            <compilerarg value="-Xlint:unchecked"/>
        </javac>
    </target>

    <!--
    **********************************************************
    ** dist - creates the plugin jar
    **********************************************************
    -->
    <target name="dist" depends="compile,revision">
        <echo message="creating ${ant.project.name}.jar ... "/>
        <copy todir="${plugin.build.dir}/resources">
            <fileset dir="resources"/>
        </copy>
        <copy todir="${plugin.build.dir}/images">
            <fileset dir="images"/>
        </copy>
        <copy todir="${plugin.build.dir}/data">
            <fileset dir="data"/>
        </copy>
        <copy todir="${plugin.build.dir}">
            <fileset dir=".">
                <include name="README"/>
                <include name="LICENSE"/>
            </fileset>
        </copy>
        <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
        <!--
        ************************************************
        ** configure these properties. Most of them will be copied to the plugins
        ** manifest file. Property values will also show up in the list available
        ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
        **
        ************************************************
        -->
            <manifest>
                <attribute name="Author" value="Matthias Meißer"/>
                <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.videomapping.VideoPlugin"/>
                <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
                <attribute name="Plugin-Description" value="(This Plugin is currently work in progress!!!) Links and syncs a georeferenced video against a GPS track, to use it for identify visible objects."/>
                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/VideoMapping"/>
                <attribute name="Plugin-Icon" value="images/videomapping.png"/>
                <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
            </manifest>
            <!--added to bundle libs-->
            <zipfileset src="${jna}"/>
            <zipfileset src="${log4j}"/>
            <zipfileset src="${platform}"/>
            <zipfileset src="${vlcj}"/>
        </jar>
    </target>
</project>
