Changeset 19422 in osm for applications/editors/josm
- Timestamp:
- 2010-01-13T14:13:59+01:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/addrinterpolation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/addrinterpolation/build.xml
r18874 r19422 22 22 --> 23 23 <project name="AddrInterpolation" default="dist" basedir="."> 24 <!-- 24 25 26 <property name="commit.message" value="Changed constructor for Plugin" /> 27 <property name="plugin.main.version" value="2830" /> 28 29 <!-- 25 30 ************************************************ 26 31 ** should not be necessary to change the following properties 27 32 --> 28 29 30 31 32 33 34 35 36 37 33 <property name="josm" location="../../core/dist/josm-custom.jar"/> 34 <property name="plugin.build.dir" value="build"/> 35 <property name="plugin.src.dir" value="src"/> 36 <!-- this is the directory where the plugin jar is copied to --> 37 <property name="plugin.dist.dir" value="../../dist"/> 38 <property name="ant.build.javac.target" value="1.5"/> 39 <property name="plugin.dist.dir" value="../../dist"/> 40 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/> 41 42 <!-- 38 43 ********************************************************** 39 44 ** init - initializes the build 40 45 ********************************************************** 41 46 --> 42 43 44 45 46 47 <target name="init"> 48 <mkdir dir="${plugin.build.dir}"/> 49 </target> 50 51 <!-- 47 52 ********************************************************** 48 53 ** compile - complies the source tree 49 54 ********************************************************** 50 55 --> 51 52 53 54 55 56 57 58 59 56 <target name="compile" depends="init"> 57 <echo message="compiling sources for ${plugin.jar} ... "/> 58 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 59 <compilerarg value="-Xlint:deprecation"/> 60 <compilerarg value="-Xlint:unchecked"/> 61 </javac> 62 </target> 63 64 <!-- 60 65 ********************************************************** 61 66 ** dist - creates the plugin jar 62 67 ********************************************************** 63 68 --> 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 69 <target name="dist" depends="compile,revision"> 70 <echo message="creating ${plugin.jar.name} ... "/> 71 <copy todir="${plugin.build.dir}/resources"> 72 <fileset dir="resources"/> 73 </copy> 74 <copy todir="${plugin.build.dir}/images"> 75 <fileset dir="images"/> 76 </copy> 77 <copy todir="${plugin.build.dir}"> 78 <fileset dir="."> 79 <include name="README" /> 80 <include name="LICENSE" /> 81 </fileset> 82 </copy> 83 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}"> 84 <!-- 80 85 ************************************************ 81 86 ** configure these properties. Most of them will be copied to the plugins … … 85 90 ************************************************ 86 91 --> 87 88 89 90 91 92 93 <attribute name="Plugin-Mainversion" value="2552"/>94 95 96 97 98 99 92 <manifest> 93 <attribute name="Author" value="Mike Nice"/> 94 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.AddrInterpolation.AddrInterpolationPlugin"/> 95 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 96 <attribute name="Plugin-Description" value="Group common Address Interpolation inputs in a single dialog, as well as an option to automatically generate individual house number nodes from a Way."/> 97 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/AddrInterpolation"/> 98 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/> 99 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 100 </manifest> 101 </jar> 102 </target> 103 104 <!-- 100 105 ********************************************************** 101 106 ** revision - extracts the current revision number for the … … 104 109 ********************************************************** 105 110 --> 106 107 108 109 110 111 112 113 114 115 116 117 111 <target name="revision"> 112 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false"> 113 <env key="LANG" value="C"/> 114 <arg value="info"/> 115 <arg value="--xml"/> 116 <arg value="."/> 117 </exec> 118 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/> 119 <delete file="REVISION"/> 120 </target> 121 122 <!-- 118 123 ********************************************************** 119 124 ** clean - clean up the build environment 120 125 ********************************************************** 121 126 --> 122 123 124 125 126 127 127 <target name="clean"> 128 <delete dir="${plugin.build.dir}"/> 129 <delete file="${plugin.jar}"/> 130 </target> 131 132 <!-- 128 133 ********************************************************** 129 134 ** install - install the plugin in your local JOSM installation 130 135 ********************************************************** 131 136 --> 132 <target name="install" depends="dist"> 133 <property environment="env"/> 134 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins"> 135 <and> 136 <os family="windows"/> 137 </and> 138 </condition> 139 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/> 140 </target> 137 <target name="install" depends="dist"> 138 <property environment="env"/> 139 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins"> 140 <and> 141 <os family="windows"/> 142 </and> 143 </condition> 144 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/> 145 </target> 146 147 <!-- 148 ************************** Publishing the plugin *********************************** 149 --> 150 <!-- 151 ** extracts the JOSM release for the JOSM version in ../core and saves it in the 152 ** property ${coreversion.info.entry.revision} 153 ** 154 --> 155 <target name="core-info"> 156 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false"> 157 <env key="LANG" value="C"/> 158 <arg value="info"/> 159 <arg value="--xml"/> 160 <arg value="../../core"/> 161 </exec> 162 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/> 163 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo> 164 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo> 165 <delete file="core.info.xml" /> 166 </target> 167 168 <!-- 169 ** commits the source tree for this plugin 170 --> 171 <target name="commit-current"> 172 <echo>Commiting the plugin source with message '${commit.message}' ...</echo> 173 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 174 <env key="LANG" value="C"/> 175 <arg value="commit"/> 176 <arg value="-m '${commit.message}'"/> 177 <arg value="."/> 178 </exec> 179 </target> 180 181 <!-- 182 ** updates (svn up) the source tree for this plugin 183 --> 184 <target name="update-current"> 185 <echo>Updating plugin source ...</echo> 186 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 187 <env key="LANG" value="C"/> 188 <arg value="up"/> 189 <arg value="."/> 190 </exec> 191 <echo>Updating ${plugin.jar} ...</echo> 192 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 193 <env key="LANG" value="C"/> 194 <arg value="up"/> 195 <arg value="../dist/${plugin.jar}"/> 196 </exec> 197 </target> 198 199 <!-- 200 ** commits the plugin.jar 201 --> 202 <target name="commit-dist"> 203 <echo> 204 ***** Properties of published ${plugin.jar} ***** 205 Commit message : '${commit.message}' 206 Plugin-Mainversion: ${plugin.main.version} 207 JOSM build version: ${coreversion.info.entry.revision} 208 Plugin-Version : ${version.entry.commit.revision} 209 ***** / Properties of published ${plugin.jar} ***** 210 211 Now commiting ${plugin.jar} ... 212 </echo> 213 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 214 <env key="LANG" value="C"/> 215 <arg value="-m '${commit.message}'"/> 216 <arg value="commit"/> 217 <arg value="${plugin.jar}"/> 218 </exec> 219 </target> 220 221 <!-- ** make sure svn is present as a command line tool ** --> 222 <target name="ensure-svn-present"> 223 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code"> 224 <env key="LANG" value="C" /> 225 <arg value="--version" /> 226 </exec> 227 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system."> 228 <!-- return code not set at all? Most likely svn isn't installed --> 229 <condition> 230 <not> 231 <isset property="svn.exit.code" /> 232 </not> 233 </condition> 234 </fail> 235 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system."> 236 <!-- error code from SVN? Most likely svn is not what we are looking on this system --> 237 <condition> 238 <isfailure code="${svn.exit.code}" /> 239 </condition> 240 </fail> 241 </target> 242 243 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist"> 244 </target> 141 245 </project> -
applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/AddrInterpolationPlugin.java
r17721 r19422 5 5 import org.openstreetmap.josm.Main; 6 6 import org.openstreetmap.josm.plugins.Plugin; 7 import org.openstreetmap.josm.plugins.PluginInformation; 7 8 8 9 public class AddrInterpolationPlugin extends Plugin { … … 13 14 * constructor 14 15 */ 15 public AddrInterpolationPlugin() { 16 public AddrInterpolationPlugin(PluginInformation info) { 17 super(info); 16 18 action = new AddrInterpolationAction(); 17 19 Main.main.menu.toolsMenu.add(action); 18 20 } 19 20 21 21 }
Note:
See TracChangeset
for help on using the changeset viewer.