Changeset 28992 in osm for applications/editors


Ignore:
Timestamp:
2012-11-27T17:04:26+01:00 (12 years ago)
Author:
simon04
Message:

JOSM/OsmInspectorPlugin: fix/update build file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/OsmInspectorPlugin/build.xml

    r28937 r28992  
    11<?xml version="1.0" encoding="utf-8"?>
    2 <project name="OsmInspectorPlugin" default="dist" basedir=".">
    3         <!-- enter the SVN commit message -->
    4         <property name="commit.message" value="Commit message" />
    5         <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    6         <property name="plugin.main.version" value="4394" />
    7         <!-- should not be necessary to change the following properties -->
    8         <property name="josm" location="lib/josm-custom.jar" />
    9         <property name="plugin.build.dir" value="build" />
    10         <property name="plugin.src.dir" value="src" />
    11         <property name="plugin.lib.dir" value="lib" />
    12         <property name="plugin.jar" value="OsmInspectorPlugin.jar" />
    13         <property name="api" value="lib/gt-api-8.0.jar" />
    14         <property name="coverage" value="lib/gt-coverage-8.0.jar" />
    15         <property name="data" value="lib/gt-data-8.0.jar" />
    16         <property name="espg" value="lib/gt-epsg-extension-8.0.jar" />
    17         <property name="hsql" value="lib/gt-epsg-hsql-8.0.jar" />
    18         <property name="main" value="lib/gt-main-8.0.jar" />
    19         <property name="metadata" value="lib/gt-metadata-8.0.jar" />
    20         <property name="opengis" value="lib/gt-opengis-8.0.jar" />
    21         <property name="referencing" value="lib/gt-referencing-8.0.jar" />
    22         <property name="referencing3D" value="lib/gt-referencing3D-8.0.jar" />
    23         <property name="render" value="lib/gt-render-8.0.jar" />
    24         <property name="wfs" value="lib/gt-wfs-8.0.jar" />
    25         <property name="jts" value="lib/jts-1.12.jar" />
    26         <property name="collections" value="lib/commons-collections-3.1.jar" />
    27         <property name="jxpath" value="lib/commons-jxpath-1.3.jar" />
    28         <property name="schema" value="lib/gt-app-schema-resolver-8.0.jar" />
    29         <property name="cql" value="lib/gt-cql-8.0.jar" />
    30         <property name="xml" value="lib/gt-xml-8.0.jar" />
    31         <property name="xsdcore" value="lib/gt-xsd-core-8.0.jar" />
    32         <property name="xsdwfs" value="lib/gt-xsd-wfs-8.0.jar" />
    33         <property name="hsqldb" value="lib/hsqldb-1.8.0.7.jar" />
    34         <property name="jsr" value="lib/jsr-275-1.0-beta-2.jar" />
    35         <property name="utils" value="lib/jt-utils-1.2.0.jar" />
    36         <property name="zonalstats" value="lib/jt-zonalstats-1.2.0.jar" />
     2<!--
     3** This is a template build file for a JOSM  plugin.
     4**
     5** Maintaining versions
     6** ====================
     7** see README.template
     8**
     9** Usage
     10** =====
     11** To build it run
     12**
     13**    > ant  dist
     14**
     15** To install the generated plugin locally (in you default plugin directory) run
     16**
     17**    > ant  install
     18**
     19** The generated plugin jar is not automatically available in JOSMs plugin configuration
     20** dialog. You have to check it in first.
     21**
     22** Use the ant target 'publish' to check in the plugin and make it available to other
     23** JOSM users:
     24**    set the properties commit.message and plugin.main.version
     25** and run
     26**    > ant  publish
     27**
     28**
     29-->
     30<project name="OsmInspector" default="dist" basedir=".">
    3731
    38         <!-- this is the directory where the plugin jar is copied to -->
     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="4394"/>
    3936
    40         <!--
    41     **********************************************************
    42     ** init - initializes the build
    43     **********************************************************
     37    <!-- Configure these properties (replace "..." accordingly).
     38         See http://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins
    4439    -->
    45         <path id="classpath">
    46                 <pathelement path="${josm}" />
    47                 <pathelement path="${plugin.build.dir}" />
    48                 <pathelement path="${api}" />
    49                 <pathelement path="${coverage}" />
    50                 <pathelement path="${data}" />
    51                 <pathelement path="${espg}" />
    52                 <pathelement path="${hsql}" />
    53                 <pathelement path="${main}" />
    54                 <pathelement path="${metadata}" />
    55                 <pathelement path="${opengis}" />
    56                 <pathelement path="${referencing}" />
    57                 <pathelement path="${referencing3D}" />
    58                 <pathelement path="${render}" />
    59                 <pathelement path="${wfs}" />
    60                 <pathelement path="${jts}" />
    61                 <pathelement path="${collections}" />
    62                 <pathelement path="${jxpath}" />
    63                 <pathelement path="${cql}" />
    64                 <pathelement path="${xml}" />
    65                 <pathelement path="${xsdcore}" />
    66                 <pathelement path="${xsdwfs}" />
    67                 <pathelement path="${hsqldb}" />
    68                 <pathelement path="${jsr}" />
    69                 <pathelement path="${utils}" />
    70                 <pathelement path="${zonalstats}" />
    71         </path>
    72         <!-- clean the build -->
    73         <target name="clean">
    74                 <delete dir="${plugin.build.dir}" />
    75                 <delete file="${plugin.jar}" />
    76         </target>
     40    <property name="plugin.author" value="Nikhil Shirahatti"/>
     41    <property name="plugin.class" value="org.openstreetmap.josm.plugins.osminspector.OsmInspectorPlugin"/>
     42    <property name="plugin.description" value="Bring in errors from Osm Inspector and display it on the current JOSM bounding box"/>
     43    <property name="plugin.icon" value="images/osmInspector.jpg"/>
     44    <property name="plugin.link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/MapDust"/>
    7745
    78         <target name="init" depends="clean">
    79                 <mkdir dir="${plugin.build.dir}" />
    80         </target>
     46    <!-- ** include targets that all plugins have in common ** -->
     47    <import file="../build-common.xml"/>
    8148
    82 
    83         <!--
    84     **********************************************************
    85     ** compile - complies the source tree
    86     **********************************************************
    87     -->
    88         <target name="compile" depends="init">
    89                 <echo message="compiling sources for  ${plugin.jar} ... " />
    90                 <javac srcdir="src" debug="true" destdir="${plugin.build.dir}">
    91                         <classpath refid="classpath" />
    92                         <compilerarg value="-Xlint:deprecation" />
    93                         <compilerarg value="-Xlint:unchecked" />
    94                 </javac>
    95         </target>
    96         <!--
    97     **********************************************************
    98     ** dist - creates the plugin jar
    99     **********************************************************
    100     -->
    101         <target name="dist" depends="compile">
    102                 <echo message="creating ${plugin.jar} ... " />
    103                 <copy todir="${plugin.build.dir}/lib">
    104                         <fileset dir="lib" />
    105                 </copy>
    106                 <copy todir="${plugin.build.dir}/images">
    107                         <fileset dir="images" />
    108                 </copy>
    109                 <copy todir="${plugin.build.dir}/dialogs">
    110                         <fileset dir="images" />
    111                 </copy>
    112                 <copy todir="${plugin.build.dir}/data">
    113                         <fileset dir="data" />
    114                 </copy>
    115                 <copy todir="${plugin.build.dir}">
    116                         <fileset dir=".">
    117                                 <include name="README" />
    118                                 <include name="LICENSE" />
    119                         </fileset>
    120                 </copy>
    121                 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
    122                         <!--
    123             ************************************************
    124             ** configure these properties. Most of them will be copied to the plugins
    125             ** manifest file. Property values will also show up in the list available
    126             ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
    127             **
    128             ************************************************
    129             -->
    130                         <manifest>
    131                                 <attribute name="Author" value="Nikhil Shirahatti" />
    132                                 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.osminspector.OsmInspectorPlugin" />
    133                                 <attribute name="Plugin-Date" value="${version.entry.commit.date}" />
    134                                 <attribute name="Plugin-Description" value="Bring in errors from Osm Inspector and display it on the current Josm bounding box" />
    135                                 <attribute name="Plugin-Icon" value="images/osmInspector.jpg" />
    136                                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/MapDust" />
    137                                 <attribute name="Plugin-Mainversion" value="1.0" />
    138                                 <attribute name="Plugin-Version" value="0.0" />
    139                                 <attribute name="Class-Path" value="lib/commons-collections-3.1.jar lib/commons-jxpath-1.3.jar lib/gt-api-8.0.jar lib/gt-app-schema-resolver-8.0.jar lib/gt-coverage-8.0.jar lib/gt-cql-8.0.jar lib/gt-data-8.0.jar lib/gt-epsg-extension-8.0.jar lib/gt-epsg-hsql-8.0.jar lib/gt-main-8.0.jar lib/gt-metadata-8.0.jar lib/gt-opengis-8.0.jar lib/gt-referencing-8.0.jar lib/gt-referencing3D-8.0.jar lib/gt-render-8.0.jar lib/gt-wfs-8.0.jar lib/gt-xml-8.0.jar lib/gt-xsd-core-8.0.jar lib/gt-xsd-wfs-8.0.jar lib/hsqldb-1.8.0.7.jar lib/jsr-275-1.0-beta-2.jar lib/jt-utils-1.2.0.jar lib/jt-zonalstats-1.2.0.jar lib/jts-1.12.jar" />
    140                         </manifest>
    141                  <!--added to bundle libs-->
    142                 <zipfileset src="${api}" />
    143                 <zipfileset src="${coverage}" />
    144                 <zipfileset src="${data}" />
    145                 <zipfileset src="${espg}" />
    146                 <zipfileset src="${hsql}" />
    147                 <zipfileset src="${main}" />
    148                 <zipfileset src="${metadata}" />
    149                 <zipfileset src="${opengis}" />
    150                 <zipfileset src="${referencing}" />
    151                 <zipfileset src="${referencing3D}" />
    152                 <zipfileset src="${render}" />
    153                 <zipfileset src="${wfs}" />
    154                 <zipfileset src="${jts}" />
    155                 <zipfileset src="${collections}" />
    156                 <zipfileset src="${jxpath}" />
    157                 <zipfileset src="${cql}" />
    158                 <zipfileset src="${xml}" />
    159                 <zipfileset src="${xsdcore}" />
    160                 <zipfileset src="${xsdwfs}" />
    161                 <zipfileset src="${hsqldb}" />
    162                 <zipfileset src="${jsr}" />
    163                 <zipfileset src="${utils}" />
    164                 <zipfileset src="${zonalstats}" />
    165                 </jar>
    166         </target>
    167         <!--
    168     **********************************************************
    169     ** revision - extracts the current revision number for the
    170     **    file build.number and stores it in the XML property
    171     **    version.*
    172     **********************************************************
    173     -->
    174         <target name="revision">
    175 
    176         </target>
    177         <!--
    178     **********************************************************
    179     ** install - install the plugin in your local JOSM installation
    180     **********************************************************
    181     -->
    182         <target name="install" depends="dist">
    183                 <property environment="env" />
    184                 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
    185                         <and>
    186                                 <os family="windows" />
    187                         </and>
    188                 </condition>
    189                 <copy file="${plugin.jar}" todir="${josm.plugins.dir}" />
    190         </target>
    191         <!--
    192     ************************** Publishing the plugin ***********************************
    193     -->
    194         <!--
    195     ** extracts the JOSM release for the JOSM version in ../core and saves it in the
    196     ** property ${coreversion.info.entry.revision}
    197     -->
    198         <target name="core-info">
    199                 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
    200                         <env key="LANG" value="C" />
    201                         <arg value="info" />
    202                         <arg value="--xml" />
    203                         <arg value="../../core" />
    204                 </exec>
    205                 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true" />
    206                 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
    207                 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
    208                 <delete file="core.info.xml" />
    209         </target>
    210         <!-- commits the source tree for this plugin -->
    211         <target name="commit-current">
    212                 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
    213                 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    214                         <env key="LANG" value="C" />
    215                         <arg value="commit" />
    216                         <arg value="-m '${commit.message}'" />
    217                         <arg value="." />
    218                 </exec>
    219         </target>
    220         <!-- updates (svn up) the source tree for this plugin -->
    221         <target name="update-current">
    222                 <echo>Updating plugin source ...</echo>
    223                 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    224                         <env key="LANG" value="C" />
    225                         <arg value="up" />
    226                         <arg value="." />
    227                 </exec>
    228                 <echo>Updating ${plugin.jar} ...</echo>
    229                 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    230                         <env key="LANG" value="C" />
    231                         <arg value="up" />
    232                         <arg value="../dist/${plugin.jar}" />
    233                 </exec>
    234         </target>
    235         <!-- commits the plugin.jar -->
    236         <target name="commit-dist">
    237                 <echo>
    238     ***** Properties of published ${plugin.jar} *****
    239     Commit message    : '${commit.message}'                   
    240     Plugin-Mainversion: ${plugin.main.version}
    241     JOSM build version: ${coreversion.info.entry.revision}
    242     Plugin-Version    : ${version.entry.commit.revision}
    243     ***** / Properties of published ${plugin.jar} *****                   
    244                        
    245     Now commiting ${plugin.jar} ...
    246     </echo>
    247                 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    248                         <env key="LANG" value="C" />
    249                         <arg value="-m '${commit.message}'" />
    250                         <arg value="commit" />
    251                         <arg value="${plugin.jar}" />
    252                 </exec>
    253         </target>
    254         <!-- make sure svn is present as a command line tool -->
    255         <target name="ensure-svn-present">
    256                 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
    257                         <env key="LANG" value="C" />
    258                         <arg value="--version" />
    259                 </exec>
    260                 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
    261                         <!-- return code not set at all? Most likely svn isn't installed -->
    262                         <condition>
    263                                 <not>
    264                                         <isset property="svn.exit.code" />
    265                                 </not>
    266                         </condition>
    267                 </fail>
    268                 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
    269                         <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
    270                         <condition>
    271                                 <isfailure code="${svn.exit.code}" />
    272                         </condition>
    273                 </fail>
    274         </target>
    275         <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,dist,commit-dist">
    276         </target>
    27749</project>
Note: See TracChangeset for help on using the changeset viewer.