[5137] | 1 | <project name="openvisible" default="dist" basedir=".">
|
---|
[12780] | 2 | <!-- josm "user home" directory depends on the platform used (windows has a different place than unix/linux) -->
|
---|
| 3 | <property environment="env"/>
|
---|
| 4 | <condition property="josm.home.dir" value="${env.APPDATA}/JOSM" else="${user.home}/.josm">
|
---|
| 5 | <and>
|
---|
| 6 | <os family="windows"/>
|
---|
| 7 | </and>
|
---|
| 8 | </condition>
|
---|
| 9 | <!-- compilation properties -->
|
---|
| 10 | <property name="josm.build.dir" value="../../core"/>
|
---|
| 11 | <property name="josm.plugins.dir" value="${josm.home.dir}/plugins"/>
|
---|
| 12 | <property name="plugin.build.dir" value="build"/>
|
---|
| 13 | <property name="plugin.dist.dir" value="../../dist"/>
|
---|
| 14 | <property name="plugin.name" value="${ant.project.name}"/>
|
---|
| 15 | <property name="plugin.jar" value="${plugin.name}.jar"/>
|
---|
| 16 | <property name="plugin.description" value="Allows opening gpx/osm files that intersect the currently visible screen area (V${plugin.version})."/>
|
---|
| 17 | <property name="plugin.stage" value="50"/>
|
---|
| 18 | <property name="plugin.class" value="at.dallermassl.josm.plugin.openvisible.OpenVisiblePlugin"/>
|
---|
| 19 | <!-- update site meta data -->
|
---|
| 20 | <property name="plugin.site.file" value="josm-site.xml"/>
|
---|
| 21 | <property name="plugin.site.description" value="Josm's OpenVisible Update Site"/>
|
---|
| 22 | <property name="plugin.site.url" value="http://www.tegmento.org/~cdaller/josm/${ant.project.name}/"/>
|
---|
| 23 | <property name="plugin.site.upload.target" value="cdaller@www.tegmento.org:public_html/josm/${ant.project.name}/"/>
|
---|
| 24 | <property name="ant.build.javac.target" value="1.5"/>
|
---|
| 25 | <target name="dist" depends="compile,site">
|
---|
| 26 | <!-- images -->
|
---|
| 27 | <copy todir="${plugin.build.dir}/images">
|
---|
| 28 | <fileset dir="images" />
|
---|
| 29 | </copy>
|
---|
| 30 | <!-- copy configuration xml files
|
---|
| 31 | <copy todir="${plugin.build.dir}">
|
---|
| 32 | <fileset dir="src">
|
---|
| 33 | <include name="*.xml"/>
|
---|
| 34 | </fileset>
|
---|
| 35 | </copy>
|
---|
| 36 | -->
|
---|
| 37 | <mkdir dir="${plugin.dist.dir}"/>
|
---|
| 38 | <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
|
---|
| 39 | <env key="LANG" value="C"/>
|
---|
| 40 | <arg value="info"/>
|
---|
| 41 | <arg value="--xml"/>
|
---|
| 42 | <arg value="."/>
|
---|
| 43 | </exec>
|
---|
| 44 | <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
| 45 | <delete file="REVISION"/>
|
---|
| 46 | <!-- create jar file -->
|
---|
| 47 | <jar destfile="${plugin.dist.dir}/${plugin.jar}" basedir="${plugin.build.dir}">
|
---|
| 48 | <manifest>
|
---|
| 49 | <attribute name="Plugin-Class" value="${plugin.class}" />
|
---|
| 50 | <attribute name="Plugin-Description" value="${plugin.description}" />
|
---|
| 51 | <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
|
---|
| 52 | <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
|
---|
| 53 | <attribute name="Plugin-Mainversion" value="1180" />
|
---|
| 54 | <attribute name="Plugin-Dependencies" value="jgrapht-jdk1.5" />
|
---|
| 55 | <attribute name="Plugin-Stage" value="${plugin.stage}" />
|
---|
| 56 | </manifest>
|
---|
| 57 | </jar>
|
---|
| 58 | </target>
|
---|
| 59 | <target name="compile" depends="init">
|
---|
| 60 | <echo message="creating ${plugin.jar}"/>
|
---|
| 61 | <mkdir dir="${plugin.build.dir}"/>
|
---|
| 62 | <javac srcdir="src" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5">
|
---|
| 63 | <classpath>
|
---|
| 64 | <pathelement path="${josm.build.dir}/build"/>
|
---|
| 65 | <fileset dir="${josm.build.dir}/lib">
|
---|
| 66 | <include name="**/*.jar"/>
|
---|
| 67 | </fileset>
|
---|
| 68 | <!--
|
---|
[5147] | 69 | <fileset dir="lib">
|
---|
| 70 | <include name="**/*.jar"/>
|
---|
| 71 | </fileset>
|
---|
| 72 | -->
|
---|
[12780] | 73 | </classpath>
|
---|
| 74 | </javac>
|
---|
| 75 | </target>
|
---|
| 76 | <target name="install" depends="dist">
|
---|
| 77 | <copy file="${plugin.dist.dir}/${plugin.jar}" todir="${josm.plugins.dir}"/>
|
---|
| 78 | <!--
|
---|
| 79 | <copy todir="${josm.home.dir}/plugins">
|
---|
| 80 | <fileset dir="lib">
|
---|
[5147] | 81 | <include name="**/*.jar"/>
|
---|
[12780] | 82 | </fileset>
|
---|
| 83 | </copy>
|
---|
| 84 | -->
|
---|
| 85 | </target>
|
---|
| 86 | <target name="init">
|
---|
| 87 | <echo>java version: ${java.version}</echo>
|
---|
| 88 | </target>
|
---|
| 89 | <!-- write site description for the given plugin so josm will accept it -->
|
---|
| 90 | <target name="site">
|
---|
| 91 | <echo message="creating site description in ${plugin.site.file}"/>
|
---|
| 92 | <echo file="${plugin.site.file}"><!-- plugins available on this site -->
|
---|
[5137] | 93 | <plugins>
|
---|
[5147] | 94 | <plugin id="${ant.project.name}" version="${plugin.version}">
|
---|
| 95 | <name>${ant.project.name}</name>
|
---|
| 96 | <description>${plugin.description}</description>
|
---|
| 97 | <resource>${plugin.site.url}${plugin.jar}</resource>
|
---|
| 98 | </plugin>
|
---|
[5137] | 99 | </plugins>
|
---|
[5147] | 100 | </echo>
|
---|
[12780] | 101 | </target>
|
---|
[5147] | 102 | <!-- write site description for the given plugin (not implemented in JOSM as full version yet!) -->
|
---|
[12780] | 103 | <target name="site-full-donotuse">
|
---|
| 104 | <echo message="creating site description in ${plugin.site.file}"/>
|
---|
| 105 | <echo file="${plugin.site.file}"><?xml version="1.0"?>
|
---|
[5147] | 106 | <site version="1.0">
|
---|
| 107 | <!-- meta data of site -->
|
---|
| 108 | <site-info>
|
---|
| 109 | <site-name>${plugin.site.description}</site-name>
|
---|
| 110 | <site-url>${plugin.site.url}</site-url>
|
---|
| 111 | </site-info>
|
---|
[5137] | 112 |
|
---|
[5147] | 113 | <!-- plugins available on this site -->
|
---|
| 114 | <plugins>
|
---|
| 115 | <plugin id="${ant.project.name}" version="${plugin.version}">
|
---|
| 116 | <name>${ant.project.name}</name>
|
---|
| 117 | <description>${plugin.description}</description>
|
---|
| 118 | <resources>
|
---|
| 119 | <resource src="${plugin.site.url}${plugin.jar}"
|
---|
| 120 | target="${josm.home.dir}/plugins/${plugin.jar}"/>
|
---|
| 121 | </resources>
|
---|
| 122 | </plugin>
|
---|
| 123 | </plugins>
|
---|
[5137] | 124 | </site>
|
---|
[5147] | 125 | </echo>
|
---|
[12780] | 126 | </target>
|
---|
[5147] | 127 | <!-- upload the site description and the jar file via ssh -->
|
---|
[12780] | 128 | <target name="upload" depends="dist,site">
|
---|
| 129 | <echo message="uploading jar and site description to ${plugin.site.upload.target}"/>
|
---|
| 130 | <exec executable="scp">
|
---|
| 131 | <arg value="${plugin.dist.dir}/${plugin.jar}"/>
|
---|
| 132 | <arg value="${plugin.site.file}"/>
|
---|
| 133 | <arg value="${plugin.site.upload.target}"/>
|
---|
| 134 | </exec>
|
---|
| 135 | </target>
|
---|
| 136 | <target name="clean">
|
---|
| 137 | <delete dir="${plugin.build.dir}" />
|
---|
| 138 | <delete dir="${plugin.site.file}" />
|
---|
| 139 | <delete file="${plugin.dist.dir}/${plugin.jar}" />
|
---|
| 140 | </target>
|
---|
[5137] | 141 | </project>
|
---|