Ignore:
Timestamp:
2010-01-13T14:13:59+01:00 (15 years ago)
Author:
guggis
Message:

'Changed constructor for Plugin'

Location:
applications/editors/josm/plugins/addrinterpolation
Files:
2 edited

Legend:

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

    r18874 r19422  
    2222-->
    2323<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        <!--
    2530      ************************************************
    2631      ** should not be necessary to change the following properties
    2732     -->
    28     <property name="josm"                   location="../../core/dist/josm-custom.jar"/>
    29     <property name="plugin.build.dir"       value="build"/>
    30     <property name="plugin.src.dir"         value="src"/>
    31     <!-- this is the directory where the plugin jar is copied to -->
    32     <property name="plugin.dist.dir"        value="../../dist"/>
    33     <property name="ant.build.javac.target" value="1.5"/>
    34     <property name="plugin.dist.dir"        value="../../dist"/>
    35     <property name="plugin.jar"             value="${plugin.dist.dir}/${ant.project.name}.jar"/>
    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        <!--
    3843    **********************************************************
    3944    ** init - initializes the build
    4045    **********************************************************
    4146    -->
    42     <target name="init">
    43         <mkdir dir="${plugin.build.dir}"/>
    44     </target>
    45 
    46     <!--
     47        <target name="init">
     48                <mkdir dir="${plugin.build.dir}"/>
     49        </target>
     50
     51        <!--
    4752    **********************************************************
    4853    ** compile - complies the source tree
    4954    **********************************************************
    5055    -->
    51     <target name="compile" depends="init">
    52         <echo message="compiling sources for  ${plugin.jar} ... "/>
    53         <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
    54             <compilerarg value="-Xlint:deprecation"/>
    55             <compilerarg value="-Xlint:unchecked"/>
    56         </javac>
    57     </target>
    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        <!--
    6065    **********************************************************
    6166    ** dist - creates the plugin jar
    6267    **********************************************************
    6368    -->
    64     <target name="dist" depends="compile,revision">
    65         <echo message="creating ${plugin.jar.name} ... "/>
    66         <copy todir="${plugin.build.dir}/resources">
    67             <fileset dir="resources"/>
    68         </copy>
    69         <copy todir="${plugin.build.dir}/images">
    70             <fileset dir="images"/>
    71         </copy>
    72         <copy todir="${plugin.build.dir}">
    73             <fileset dir=".">
    74                 <include name="README" />
    75                 <include name="LICENSE" />
    76             </fileset>
    77         </copy>
    78         <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
    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                        <!--
    8085        ************************************************
    8186        ** configure these properties. Most of them will be copied to the plugins
     
    8590        ************************************************
    8691    -->
    87             <manifest>
    88                 <attribute name="Author" value="Mike Nice"/>
    89                 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.AddrInterpolation.AddrInterpolationPlugin"/>
    90                 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
    91                 <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."/>
    92                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/AddrInterpolation"/>
    93                 <attribute name="Plugin-Mainversion" value="2552"/>
    94                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    95             </manifest>
    96         </jar>
    97     </target>
    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        <!--
    100105    **********************************************************
    101106    ** revision - extracts the current revision number for the
     
    104109    **********************************************************
    105110    -->
    106     <target name="revision">
    107         <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
    108             <env key="LANG" value="C"/>
    109             <arg value="info"/>
    110             <arg value="--xml"/>
    111             <arg value="."/>
    112         </exec>
    113         <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
    114         <delete file="REVISION"/>
    115     </target>
    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        <!--
    118123    **********************************************************
    119124    ** clean - clean up the build environment
    120125    **********************************************************
    121126    -->
    122     <target name="clean">
    123         <delete dir="${plugin.build.dir}"/>
    124         <delete file="${plugin.jar}"/>
    125     </target>
    126 
    127     <!--
     127        <target name="clean">
     128                <delete dir="${plugin.build.dir}"/>
     129                <delete file="${plugin.jar}"/>
     130        </target>
     131
     132        <!--
    128133    **********************************************************
    129134    ** install - install the plugin in your local JOSM installation
    130135    **********************************************************
    131136    -->
    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} *****
     205Commit message    : '${commit.message}'                                 
     206Plugin-Mainversion: ${plugin.main.version}
     207JOSM build version: ${coreversion.info.entry.revision}
     208Plugin-Version    : ${version.entry.commit.revision}
     209***** / Properties of published ${plugin.jar} *****                                     
     210                                       
     211Now 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>
    141245</project>
  • applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/AddrInterpolationPlugin.java

    r17721 r19422  
    55import org.openstreetmap.josm.Main;
    66import org.openstreetmap.josm.plugins.Plugin;
     7import org.openstreetmap.josm.plugins.PluginInformation;
    78
    89public class AddrInterpolationPlugin extends Plugin {
     
    1314         * constructor
    1415         */
    15         public AddrInterpolationPlugin() {
     16        public AddrInterpolationPlugin(PluginInformation info) {
     17                super(info);
    1618                action = new AddrInterpolationAction();
    1719                Main.main.menu.toolsMenu.add(action);
    1820        }
    19 
    20 
    2121}
Note: See TracChangeset for help on using the changeset viewer.