| 1 | <project name="pluginmanager" default="dist" basedir=".">
|
|---|
| 2 |
|
|---|
| 3 | <!-- compilation properties -->
|
|---|
| 4 | <property name="josm.build.dir" value="../../core"/>
|
|---|
| 5 | <property name="josm.home.dir" value="${user.home}/.josm"/>
|
|---|
| 6 | <property name="josm" location="../../core/dist/josm-custom.jar" />
|
|---|
| 7 | <property name="plugin.build.dir" value="build"/>
|
|---|
| 8 | <property name="plugin.dist.dir" value="../../dist"/>
|
|---|
| 9 | <property name="plugin.name" value="${ant.project.name}"/>
|
|---|
| 10 | <property name="plugin.jar" value="../../dist/${plugin.name}.jar"/>
|
|---|
| 11 |
|
|---|
| 12 | <!-- compilation properties -->
|
|---|
| 13 | <property name="josm.build.dir" value="../../core"/>
|
|---|
| 14 | <property name="josm.home.dir" value="${user.home}/.josm"/>
|
|---|
| 15 | <property name="plugin.build.dir" value="bin"/>
|
|---|
| 16 | <property name="plugin.name" value="${ant.project.name}"/>
|
|---|
| 17 | <property name="plugin.jar" value="${plugin.name}.jar"/>
|
|---|
| 18 |
|
|---|
| 19 | <!-- plugin meta data (enter new version number if anything changed!) -->
|
|---|
| 20 | <property name="plugin.version" value="0.3.0"/>
|
|---|
| 21 | <property name="plugin.description" value="Manage plugins and provide update mechanism (V${plugin.version})."/>
|
|---|
| 22 | <property name="plugin.class" value="at.dallermassl.josm.plugin.pluginmanager.PluginManagerPlugin"/>
|
|---|
| 23 |
|
|---|
| 24 | <!-- update site meta data -->
|
|---|
| 25 | <property name="plugin.site.file" value="josm-site.xml"/>
|
|---|
| 26 | <property name="plugin.site.description" value="Josm's PluginManager Update Site"/>
|
|---|
| 27 | <property name="plugin.site.url" value="http://www.tegmento.org/~cdaller/josm/pluginmanager/"/>
|
|---|
| 28 | <property name="plugin.site.upload.target" value="cdaller@www.tegmento.org:public_html/josm/pluginmanager/"/>
|
|---|
| 29 |
|
|---|
| 30 | <property name="ant.build.javac.target" value="1.5"/>
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 | <target name="dist" depends="compile, site">
|
|---|
| 34 | <!-- images -->
|
|---|
| 35 | <!--
|
|---|
| 36 | <copy todir="${plugin.build.dir}/images">
|
|---|
| 37 | <fileset dir="src/images" />
|
|---|
| 38 | </copy>
|
|---|
| 39 | -->
|
|---|
| 40 | <!-- copy configuration xml files -->
|
|---|
| 41 | <copy todir="${plugin.build.dir}">
|
|---|
| 42 | <fileset dir="src">
|
|---|
| 43 | <include name="*.xml"/>
|
|---|
| 44 | </fileset>
|
|---|
| 45 | </copy>
|
|---|
| 46 |
|
|---|
| 47 | <!-- create jar file -->
|
|---|
| 48 | <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
|
|---|
| 49 | <manifest>
|
|---|
| 50 | <attribute name="Plugin-Class" value="${plugin.class}" />
|
|---|
| 51 | <attribute name="Plugin-Description" value="${plugin.description}" />
|
|---|
| 52 | <attribute name="Plugin-Version" value="${plugin.version}" />
|
|---|
| 53 | <!--attribute name="Plugin-Dependencies" value="org.eigenheimstrasse.josm" /-->
|
|---|
| 54 | </manifest>
|
|---|
| 55 | </jar>
|
|---|
| 56 | </target>
|
|---|
| 57 |
|
|---|
| 58 | <target name="compile" depends="init">
|
|---|
| 59 | <echo message="creating ${plugin.jar}"/>
|
|---|
| 60 | <mkdir dir="${plugin.build.dir}"/>
|
|---|
| 61 | <javac srcdir="src" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5">
|
|---|
| 62 | <classpath>
|
|---|
| 63 | <pathelement path="${josm.build.dir}/build"/>
|
|---|
| 64 | <fileset dir="${josm.build.dir}/lib">
|
|---|
| 65 | <include name="**/*.jar"/>
|
|---|
| 66 | </fileset>
|
|---|
| 67 | </classpath>
|
|---|
| 68 | </javac>
|
|---|
| 69 | </target>
|
|---|
| 70 |
|
|---|
| 71 | <target name="install" depends="dist">
|
|---|
| 72 | <copy file="${plugin.jar}" todir="${josm.home.dir}/plugins" />
|
|---|
| 73 | </target>
|
|---|
| 74 |
|
|---|
| 75 | <target name="init">
|
|---|
| 76 | <echo>java version: ${java.version}</echo>
|
|---|
| 77 | </target>
|
|---|
| 78 |
|
|---|
| 79 | <target name="clean">
|
|---|
| 80 | <delete dir="${plugin.build.dir}" />
|
|---|
| 81 | <delete dir="${plugin.site.file}" />
|
|---|
| 82 | <delete file="${plugin.jar}" />
|
|---|
| 83 | </target>
|
|---|
| 84 |
|
|---|
| 85 | <!-- write site description for the given plugin -->
|
|---|
| 86 | <target name="site">
|
|---|
| 87 | <echo message="creating site description in ${plugin.site.file}"/>
|
|---|
| 88 | <echo file="${plugin.site.file}"><?xml version="1.0"?>
|
|---|
| 89 | <site version="1.0">
|
|---|
| 90 | <!-- meta data of site -->
|
|---|
| 91 | <site-info>
|
|---|
| 92 | <site-name>${plugin.site.description}</site-name>
|
|---|
| 93 | <site-url>${plugin.site.url}</site-url>
|
|---|
| 94 | </site-info>
|
|---|
| 95 |
|
|---|
| 96 | <!-- plugins available on this site -->
|
|---|
| 97 | <plugins>
|
|---|
| 98 | <plugin id="${ant.project.name}" version="${plugin.version}">
|
|---|
| 99 | <name>${ant.project.name}</name>
|
|---|
| 100 | <description>${plugin.description}</description>
|
|---|
| 101 | <resources>
|
|---|
| 102 | <resource src="${plugin.site.url}/${plugin.jar}"
|
|---|
| 103 | target="$${josm.user.dir}/plugins/${plugin.jar}"/>
|
|---|
| 104 | </resources>
|
|---|
| 105 | </plugin>
|
|---|
| 106 | </plugins>
|
|---|
| 107 | </site>
|
|---|
| 108 | </echo>
|
|---|
| 109 | </target>
|
|---|
| 110 |
|
|---|
| 111 | <!-- upload the site description and the jar file via ssh -->
|
|---|
| 112 | <target name="upload" depends="dist,site">
|
|---|
| 113 | <echo message="uploading jar and site description to ${plugin.site.upload.target}"/>
|
|---|
| 114 | <exec executable="scp">
|
|---|
| 115 | <arg value="${plugin.jar}"/>
|
|---|
| 116 | <arg value="${plugin.site.file}"/>
|
|---|
| 117 | <arg value="${plugin.site.upload.target}"/>
|
|---|
| 118 | </exec>
|
|---|
| 119 | </target>
|
|---|
| 120 |
|
|---|
| 121 | </project>
|
|---|