Changeset 23263 in osm for applications/editors/josm/plugins/00_plugin_dir_template
- Timestamp:
- 2010-09-19T13:27:11+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/00_plugin_dir_template
- Files:
-
- 6 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/00_plugin_dir_template/README
r23139 r23263 1 ImportImagePlugin: 1 README 2 ====== 2 3 3 This Plugin makes use of the Geotools library to provide a method to 4 import spatial referenced images into JOSM. 4 Readme for your plugin 5 5 6 Basically, the plugin import function needs: 7 - the image file (Supported formats: GeoTiff, Tiff, jpg, bmp, png, gif) 8 - a world file (<image_name>.wld (or other extensions like ".bpw" for BMP files, ".tfw" for Tiffs)) 9 - a projection file (<image_name>.prj) with a WKT-representation of the source projection for this image 10 11 If no world file can be found, the plugin cannot continue. 12 If no projection file can be found, the plugin asks to use the DEFAULT reference system, 13 which can be set either in "<APP_DATA_DIR>/JOSM/plugins/ImportImagePlugin/pluginProperties.properties" file 14 or in the layer-properties dialog after a layer is created. 15 16 For a more detailed documentation you may visit the WIKI-entry for the plugin. 17 6 * Plugin author and contact email address. 7 8 * The license for your plugin source code. If you have no special preferences, 9 you can pick the license that is used for JOSM ("GPL v2 or later"). 10 11 * Notes for future developers, if needed. -
applications/editors/josm/plugins/00_plugin_dir_template/build.xml
r23139 r23263 28 28 ** 29 29 --> 30 <project name=" ImportImagePlugin" default="dist" basedir=".">31 32 33 34 35 36 37 38 30 <project name="myPluginName" default="dist" basedir="."> 31 32 <!-- enter the SVN commit message --> 33 <property name="commit.message" value="Commit message" /> 34 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 35 <property name="plugin.main.version" value="" /> 36 37 38 <!-- 39 39 ************************************************ 40 40 ** should not be necessary to change the following properties 41 41 --> 42 43 44 45 46 47 48 49 50 51 42 <property name="josm" location="../../core/dist/josm-custom.jar"/> 43 <property name="plugin.build.dir" value="build"/> 44 <property name="plugin.src.dir" value="src"/> 45 <!-- this is the directory where the plugin jar is copied to --> 46 <property name="plugin.dist.dir" value="../../dist"/> 47 <property name="ant.build.javac.target" value="1.5"/> 48 <property name="plugin.dist.dir" value="../../dist"/> 49 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/> 50 51 <!-- 52 52 ********************************************************** 53 53 ** init - initializes the build 54 54 ********************************************************** 55 55 --> 56 57 58 59 60 56 <target name="init"> 57 <mkdir dir="${plugin.build.dir}"/> 58 </target> 59 60 <!-- 61 61 ********************************************************** 62 62 ** compile - complies the source tree 63 63 ********************************************************** 64 64 --> 65 <target name="compile" depends="init"> 66 <echo message="compiling sources for ${plugin.jar} ... "/> 67 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 68 <classpath> 69 <pathelement location="${josm}"/> 70 <fileset dir="lib"> 71 <include name="**/*.jar"/> 72 </fileset> 73 </classpath> 74 <compilerarg value="-Xlint:deprecation"/> 75 <compilerarg value="-Xlint:unchecked"/> 76 </javac> 77 </target> 78 79 <!-- 65 <target name="compile" depends="init"> 66 <echo message="compiling sources for ${plugin.jar} ... "/> 67 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 68 <compilerarg value="-Xlint:deprecation"/> 69 <compilerarg value="-Xlint:unchecked"/> 70 </javac> 71 </target> 72 73 <!-- 80 74 ********************************************************** 81 75 ** dist - creates the plugin jar 82 76 ********************************************************** 83 77 --> 84 <target name="dist" depends="compile,revision"> 85 <echo message="creating ${ant.project.name}.jar ... "/> 86 87 <copy todir="${plugin.build.dir}/lib"> 88 <fileset dir="lib"> 89 <not> 90 <filename name="log4j-1.2.12.jar"/> 91 </not> 92 </fileset> 93 </copy> 94 <unjar src="lib/log4j-1.2.12.jar" dest="${plugin.build.dir}"/> 95 <copy todir="${plugin.build.dir}/images"> 96 <fileset dir="images"/> 97 </copy> 98 <copy todir="${plugin.build.dir}/resources"> 99 <fileset dir="resources"/> 100 </copy> 101 <copy todir="${plugin.build.dir}"> 102 <fileset dir="."> 103 <include name="README" /> 104 <include name="LICENSE" /> 105 </fileset> 106 </copy> 107 108 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}"> 109 <!-- 78 <target name="dist" depends="compile,revision"> 79 <echo message="creating ${ant.project.name}.jar ... "/> 80 <copy todir="${plugin.build.dir}/resources"> 81 <fileset dir="resources"/> 82 </copy> 83 <copy todir="${plugin.build.dir}/images"> 84 <fileset dir="images"/> 85 </copy> 86 <copy todir="${plugin.build.dir}"> 87 <fileset dir="."> 88 <include name="README" /> 89 <include name="LICENSE" /> 90 </fileset> 91 </copy> 92 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}"> 93 <!-- 110 94 ************************************************ 111 95 ** configure these properties. Most of them will be copied to the plugins … … 115 99 ************************************************ 116 100 --> 117 118 <manifest> 119 <attribute name="Author" value="Christoph Beekmans, Fabian Kowitz, Anna Robaszkiewicz, Oliver Kuhn, Martin Ulitzny"/> 120 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.ImageImportPlugin.ImageImportPlugin"/> 101 <manifest> 102 <attribute name="Author" value="..."/> 103 <attribute name="Plugin-Class" value="..."/> 121 104 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 122 <attribute name="Plugin-Description" value="Plugin for importing spatial referenced images"/> 123 <attribute name="Plugin-Link" value=" -- will soon be added -- "/> 124 <attribute name="Plugin-Mainversion" value="1.0"/> 105 <attribute name="Plugin-Description" value="..."/> 106 <attribute name="Plugin-Icon" value="..."/> 107 <attribute name="Plugin-Link" value="..."/> 108 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/> 125 109 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 126 <attribute name="Class-Path" value="."/> 127 </manifest> 128 </jar> 129 </target> 130 131 <!-- 110 </manifest> 111 </jar> 112 </target> 113 114 <!-- 132 115 ********************************************************** 133 116 ** revision - extracts the current revision number for the … … 136 119 ********************************************************** 137 120 --> 138 139 140 141 142 143 144 145 146 147 148 149 150 121 <target name="revision"> 122 123 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false"> 124 <env key="LANG" value="C"/> 125 <arg value="info"/> 126 <arg value="--xml"/> 127 <arg value="."/> 128 </exec> 129 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/> 130 <delete file="REVISION"/> 131 </target> 132 133 <!-- 151 134 ********************************************************** 152 135 ** clean - clean up the build environment 153 136 ********************************************************** 154 137 --> 155 156 157 158 159 160 138 <target name="clean"> 139 <delete dir="${plugin.build.dir}"/> 140 <delete file="${plugin.jar}"/> 141 </target> 142 143 <!-- 161 144 ********************************************************** 162 145 ** install - install the plugin in your local JOSM installation 163 146 ********************************************************** 164 147 --> 165 <target name="install" depends="dist"> 166 <property environment="env"/> 167 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins"> 168 <and> 169 <os family="windows"/> 170 </and> 171 </condition> 172 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/> 173 </target> 174 175 176 <!-- 177 ************************** Publishing the plugin *********************************** 178 --> 179 <!-- 180 ** extracts the JOSM release for the JOSM version in ../core and saves it in the 181 ** property ${coreversion.info.entry.revision} 182 ** 183 --> 184 <target name="core-info"> 185 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false"> 186 <env key="LANG" value="C"/> 187 <arg value="info"/> 188 <arg value="--xml"/> 189 <arg value="../../core"/> 190 </exec> 191 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/> 192 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo> 193 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo> 194 <delete file="core.info.xml" /> 195 </target> 196 197 <!-- 198 ** commits the source tree for this plugin 199 --> 200 <target name="commit-current"> 201 <echo>Commiting the plugin source with message '${commit.message}' ...</echo> 202 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 203 <env key="LANG" value="C"/> 204 <arg value="commit"/> 205 <arg value="-m '${commit.message}'"/> 206 <arg value="."/> 207 </exec> 208 </target> 209 210 <!-- 211 ** updates (svn up) the source tree for this plugin 212 --> 213 <target name="update-current"> 214 <echo>Updating plugin source ...</echo> 215 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 216 <env key="LANG" value="C"/> 217 <arg value="up"/> 218 <arg value="."/> 219 </exec> 220 <echo>Updating ${plugin.jar} ...</echo> 221 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 222 <env key="LANG" value="C"/> 223 <arg value="up"/> 224 <arg value="../dist/${plugin.jar}"/> 225 </exec> 226 </target> 227 228 <!-- 229 ** commits the plugin.jar 230 --> 231 <target name="commit-dist"> 232 <echo> 233 ***** Properties of published ${plugin.jar} ***** 234 Commit message : '${commit.message}' 235 Plugin-Mainversion: ${plugin.main.version} 236 JOSM build version: ${coreversion.info.entry.revision} 237 Plugin-Version : ${version.entry.commit.revision} 238 ***** / Properties of published ${plugin.jar} ***** 239 240 Now commiting ${plugin.jar} ... 241 </echo> 242 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 243 <env key="LANG" value="C"/> 244 <arg value="-m '${commit.message}'"/> 245 <arg value="commit"/> 246 <arg value="${plugin.jar}"/> 247 </exec> 248 </target> 249 250 <!-- ** make sure svn is present as a command line tool ** --> 251 <target name="ensure-svn-present"> 252 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code"> 253 <env key="LANG" value="C" /> 254 <arg value="--version" /> 255 </exec> 256 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system."> 257 <!-- return code not set at all? Most likely svn isn't installed --> 258 <condition> 259 <not> 260 <isset property="svn.exit.code" /> 261 </not> 262 </condition> 263 </fail> 264 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system."> 265 <!-- error code from SVN? Most likely svn is not what we are looking on this system --> 266 <condition> 267 <isfailure code="${svn.exit.code}" /> 268 </condition> 269 </fail> 270 </target> 271 272 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist"> 273 </target> 274 275 <target name="unjar-test" > 276 <!--unjar dest="C:/Workspace_2/geotoolstest/lib/unjartest"> 277 <fileset dir="lib"/> 278 </unjar--> 279 280 <jar destfile="C:/Workspace_2/geotoolstest/lib/unjartest/${ant.project.name}.jar" basedir="C:/Workspace_2/geotoolstest/lib/unjartest"> 281 282 <manifest> 283 <attribute name="Author" value="Christoph Beekmans, Fabian Kowitz, Anna Robaszkiewicz, Oliver Kuhn, Martin Ulitzny"/> 284 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.CoveragePlugin.CoveragePlugin"/> 285 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 286 <attribute name="Plugin-Description" value="Plugin for importing spatial referenced images"/> 287 <attribute name="Plugin-Link" value="..."/> 288 <attribute name="Plugin-Mainversion" value=".."/> 289 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 290 <attribute name="Class-path" value=" . CoveragePlugin/lib/commons-beanutils-1.7.0.jar CoveragePlugin/lib/commons-pool-1.5.3.jar CoveragePlugin/lib/geoapi-2.3-M1.jar CoveragePlugin/lib/geoapi-pending-2.3-M1.jar CoveragePlugin/lib/geoapi.jar CoveragePlugin/lib/gt-api-2.6.0.jar CoveragePlugin/lib/gt-coverage-2.6.0.jar CoveragePlugin/lib/gt-epsg-extension-2.6.0.jar CoveragePlugin/lib/gt-epsg-hsql-2.6.0.jar CoveragePlugin/lib/gt-geotiff-2.6.0.jar CoveragePlugin/lib/gt-main-2.6.0.jar CoveragePlugin/lib/gt-metadata-2.6.0.jar CoveragePlugin/lib/gt-referencing-2.6.0.jar CoveragePlugin/lib/hsqldb-1.8.0.7.jar CoveragePlugin/lib/imageio-ext-tiff-1.0.4.jar CoveragePlugin/lib/imageio-ext-utilities-1.0.4.jar CoveragePlugin/lib/jai_codec-1.1.3.jar CoveragePlugin/lib/jai_core.jar CoveragePlugin/lib/jai_imageio-1.1.jar CoveragePlugin/lib/jdom-1.0.jar CoveragePlugin/lib/jsr-275-1.0-beta-2.jar CoveragePlugin/lib/jts-1.10.jar CoveragePlugin/lib/log4j-1.2.12.jar CoveragePlugin/lib/vecmath-1.3.2.jar" /> 291 </manifest> 292 </jar> 293 </target> 294 148 <target name="install" depends="dist"> 149 <property environment="env"/> 150 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins"> 151 <and> 152 <os family="windows"/> 153 </and> 154 </condition> 155 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/> 156 </target> 157 158 159 <!-- 160 ************************** Publishing the plugin *********************************** 161 --> 162 <!-- 163 ** extracts the JOSM release for the JOSM version in ../core and saves it in the 164 ** property ${coreversion.info.entry.revision} 165 ** 166 --> 167 <target name="core-info"> 168 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false"> 169 <env key="LANG" value="C"/> 170 <arg value="info"/> 171 <arg value="--xml"/> 172 <arg value="../../core"/> 173 </exec> 174 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/> 175 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo> 176 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo> 177 <delete file="core.info.xml" /> 178 </target> 179 180 <!-- 181 ** commits the source tree for this plugin 182 --> 183 <target name="commit-current"> 184 <echo>Commiting the plugin source with message '${commit.message}' ...</echo> 185 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 186 <env key="LANG" value="C"/> 187 <arg value="commit"/> 188 <arg value="-m '${commit.message}'"/> 189 <arg value="."/> 190 </exec> 191 </target> 192 193 <!-- 194 ** updates (svn up) the source tree for this plugin 195 --> 196 <target name="update-current"> 197 <echo>Updating plugin source ...</echo> 198 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 199 <env key="LANG" value="C"/> 200 <arg value="up"/> 201 <arg value="."/> 202 </exec> 203 <echo>Updating ${plugin.jar} ...</echo> 204 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 205 <env key="LANG" value="C"/> 206 <arg value="up"/> 207 <arg value="../dist/${plugin.jar}"/> 208 </exec> 209 </target> 210 211 <!-- 212 ** commits the plugin.jar 213 --> 214 <target name="commit-dist"> 215 <echo> 216 ***** Properties of published ${plugin.jar} ***** 217 Commit message : '${commit.message}' 218 Plugin-Mainversion: ${plugin.main.version} 219 JOSM build version: ${coreversion.info.entry.revision} 220 Plugin-Version : ${version.entry.commit.revision} 221 ***** / Properties of published ${plugin.jar} ***** 222 223 Now commiting ${plugin.jar} ... 224 </echo> 225 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 226 <env key="LANG" value="C"/> 227 <arg value="-m '${commit.message}'"/> 228 <arg value="commit"/> 229 <arg value="${plugin.jar}"/> 230 </exec> 231 </target> 232 233 <!-- ** make sure svn is present as a command line tool ** --> 234 <target name="ensure-svn-present"> 235 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code"> 236 <env key="LANG" value="C" /> 237 <arg value="--version" /> 238 </exec> 239 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system."> 240 <!-- return code not set at all? Most likely svn isn't installed --> 241 <condition> 242 <not> 243 <isset property="svn.exit.code" /> 244 </not> 245 </condition> 246 </fail> 247 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system."> 248 <!-- error code from SVN? Most likely svn is not what we are looking on this system --> 249 <condition> 250 <isfailure code="${svn.exit.code}" /> 251 </condition> 252 </fail> 253 </target> 254 255 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist"> 256 </target> 295 257 </project>
Note:
See TracChangeset
for help on using the changeset viewer.