[3335] | 1 | <project name="pluginmanager" default="dist" basedir=".">
|
---|
| 2 |
|
---|
[5147] | 3 | <!-- compilation properties -->
|
---|
[5153] | 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"/>
|
---|
[6100] | 8 | <property name="plugin.dist.dir" value="../../dist"/>
|
---|
[5153] | 9 | <property name="plugin.name" value="${ant.project.name}"/>
|
---|
[6100] | 10 | <property name="plugin.jar" value="../../dist/${plugin.name}.jar"/>
|
---|
[5153] | 11 |
|
---|
| 12 | <!-- compilation properties -->
|
---|
[5147] | 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"/>
|
---|
[3454] | 16 | <property name="plugin.name" value="${ant.project.name}"/>
|
---|
[5147] | 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})."/>
|
---|
[3454] | 22 | <property name="plugin.class" value="at.dallermassl.josm.plugin.pluginmanager.PluginManagerPlugin"/>
|
---|
[3335] | 23 |
|
---|
[5147] | 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"/>
|
---|
[3454] | 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/"/>
|
---|
[5197] | 29 |
|
---|
| 30 | <property name="ant.build.javac.target" value="1.5"/>
|
---|
[5147] | 31 |
|
---|
[3335] | 32 |
|
---|
[5147] | 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>
|
---|
[3454] | 50 | <attribute name="Plugin-Class" value="${plugin.class}" />
|
---|
| 51 | <attribute name="Plugin-Description" value="${plugin.description}" />
|
---|
| 52 | <attribute name="Plugin-Version" value="${plugin.version}" />
|
---|
[3335] | 53 | <!--attribute name="Plugin-Dependencies" value="org.eigenheimstrasse.josm" /-->
|
---|
[5147] | 54 | </manifest>
|
---|
| 55 | </jar>
|
---|
| 56 | </target>
|
---|
[3335] | 57 |
|
---|
[5147] | 58 | <target name="compile" depends="init">
|
---|
[7287] | 59 | <echo message="creating ${plugin.jar}"/>
|
---|
[5147] | 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>
|
---|
[3335] | 70 |
|
---|
[5147] | 71 | <target name="install" depends="dist">
|
---|
| 72 | <copy file="${plugin.jar}" todir="${josm.home.dir}/plugins" />
|
---|
| 73 | </target>
|
---|
[3335] | 74 |
|
---|
| 75 | <target name="init">
|
---|
[5147] | 76 | <echo>java version: ${java.version}</echo>
|
---|
| 77 | </target>
|
---|
[3335] | 78 |
|
---|
[5147] | 79 | <target name="clean">
|
---|
| 80 | <delete dir="${plugin.build.dir}" />
|
---|
[3454] | 81 | <delete dir="${plugin.site.file}" />
|
---|
[5153] | 82 | <delete file="${plugin.jar}" />
|
---|
[5147] | 83 | </target>
|
---|
[3335] | 84 |
|
---|
[5147] | 85 | <!-- write site description for the given plugin -->
|
---|
[3454] | 86 | <target name="site">
|
---|
[5147] | 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 -->
|
---|
[3454] | 91 | <site-info>
|
---|
[5147] | 92 | <site-name>${plugin.site.description}</site-name>
|
---|
| 93 | <site-url>${plugin.site.url}</site-url>
|
---|
[3454] | 94 | </site-info>
|
---|
| 95 |
|
---|
| 96 | <!-- plugins available on this site -->
|
---|
| 97 | <plugins>
|
---|
[5147] | 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>
|
---|
[3454] | 106 | </plugins>
|
---|
[5147] | 107 | </site>
|
---|
| 108 | </echo>
|
---|
| 109 | </target>
|
---|
[3454] | 110 |
|
---|
[5147] | 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>
|
---|
[3454] | 120 |
|
---|
[3335] | 121 | </project>
|
---|