Ignore:
Timestamp:
2009-12-12T18:08:41+01:00 (15 years ago)
Author:
guggis
Message:

'Updated to JOSM 2621; updated build.xml'

Location:
applications/editors/josm/plugins/graphview
Files:
3 edited

Legend:

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

    r18962 r19054  
     1<?xml version="1.0" encoding="UTF-8"?>
     2<!--
     3** This is the build file for the graphview 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 your default plugin directory) run
     16**
     17**    > ant  install
     18**
     19** To build against the core in ../../core, create a correct manifest and deploy to
     20** SVN,
     21**    set the properties commit.message and plugin.main.version
     22** and run
     23**    > ant  publish
     24**
     25**
     26-->
    127<project name="graphview" default="dist" basedir=".">
    228
     29        <property name="commit.message" value="Updated to JOSM 2621; updated build.xml" />
     30        <property name="plugin.main.version" value="2621" />
     31       
    332    <property name="josm"                   location="../../core/dist/josm-custom.jar"/>
    433    <property name="plugin.build.dir"       value="build"/>
     
    5786                <attribute name="Plugin-Description" value="Visualizes routing information as a routing graph."/>
    5887                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Graphview"/>
    59                 <attribute name="Plugin-Mainversion" value="2578"/>
     88                <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
    6089                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    6190            </manifest>
     
    106135        <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
    107136    </target>
     137       
     138       
     139        <!--
     140                 ************************** Publishing the plugin ***********************************
     141                -->
     142                <!--
     143                ** extracts the JOSM release for the JOSM version in ../core and saves it in the
     144                ** property ${coreversion.info.entry.revision}
     145                **
     146                -->
     147                <target name="core-info">
     148                        <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
     149                                <env key="LANG" value="C"/>
     150                                <arg value="info"/>
     151                                <arg value="--xml"/>
     152                                <arg value="../../core"/>
     153                        </exec>
     154                        <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
     155                        <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
     156                        <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
     157                        <delete file="core.info.xml" />
     158                </target>
     159
     160                <!--
     161                ** commits the source tree for this plugin
     162                -->
     163                <target name="commit-current">
     164                        <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
     165                        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     166                                <env key="LANG" value="C"/>
     167                                <arg value="commit"/>
     168                                <arg value="-m '${commit.message}'"/>
     169                                <arg value="."/>
     170                        </exec>
     171                </target>
     172
     173                <!--
     174                ** updates (svn up) the source tree for this plugin
     175                -->
     176                <target name="update-current">
     177                        <echo>Updating plugin source ...</echo>
     178                        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     179                                <env key="LANG" value="C"/>
     180                                <arg value="up"/>
     181                                <arg value="."/>
     182                        </exec>
     183                        <echo>Updating ${plugin.jar} ...</echo>
     184                        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     185                                <env key="LANG" value="C"/>
     186                                <arg value="up"/>
     187                                <arg value="../dist/${plugin.jar}"/>
     188                        </exec>
     189                </target>
     190
     191                <!--
     192                ** commits the plugin.jar
     193                -->
     194                <target name="commit-dist">
     195                        <echo>
     196        ***** Properties of published ${plugin.jar} *****
     197        Commit message    : '${commit.message}'                                 
     198        Plugin-Mainversion: ${plugin.main.version}
     199        JOSM build version: ${coreversion.info.entry.revision}
     200        Plugin-Version    : ${version.entry.commit.revision}
     201        ***** / Properties of published ${plugin.jar} *****                                     
     202                                               
     203        Now commiting ${plugin.jar} ...
     204        </echo>
     205                        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     206                                <env key="LANG" value="C"/>
     207                                <arg value="-m '${commit.message}'"/>
     208                                <arg value="commit"/>
     209                                <arg value="${plugin.jar}"/>
     210                        </exec>
     211                </target>
     212
     213                <!-- ** make sure svn is present as a command line tool ** -->
     214                <target name="ensure-svn-present">
     215                        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
     216                                <env key="LANG" value="C" />
     217                                <arg value="--version" />
     218                        </exec>
     219                        <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
     220                                <!-- return code not set at all? Most likely svn isn't installed -->
     221                                <condition>
     222                                        <not>
     223                                                <isset property="svn.exit.code" />
     224                                        </not>
     225                                </condition>
     226                        </fail>
     227                        <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
     228                                <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
     229                                <condition>
     230                                        <isfailure code="${svn.exit.code}" />
     231                                </condition>
     232                        </fail>
     233                </target>
     234
     235                <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
     236                </target>
    108237</project>
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/GraphViewPlugin.java

    r17210 r19054  
    1616import org.openstreetmap.josm.Main;
    1717import org.openstreetmap.josm.gui.MapFrame;
     18import org.openstreetmap.josm.gui.MapView;
     19import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
    1820import org.openstreetmap.josm.gui.layer.Layer;
    19 import org.openstreetmap.josm.gui.layer.Layer.LayerChangeListener;
    2021import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
    2122import org.openstreetmap.josm.plugins.Plugin;
     
    236237                                newFrame.addToggleDialog(laneDialog);
    237238                        }
    238                         Layer.listeners.add(this);
     239                        MapView.addLayerChangeListener(this);
    239240                } else {
    240                         Layer.listeners.remove(this);
     241                        MapView.removeLayerChangeListener(this);
    241242                }
    242243        }
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/layer/GraphViewLayer.java

    r18593 r19054  
    2424import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
    2525import org.openstreetmap.josm.gui.MapView;
     26import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
    2627import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
    2728import org.openstreetmap.josm.gui.dialogs.LayerListPopup;
    2829import org.openstreetmap.josm.gui.layer.Layer;
    29 import org.openstreetmap.josm.gui.layer.Layer.LayerChangeListener;
    3030import org.openstreetmap.josm.plugins.graphview.core.graph.GraphEdge;
    3131import org.openstreetmap.josm.plugins.graphview.core.graph.GraphNode;
     
    8484        public GraphViewLayer() {
    8585                super("Graph view");
    86                 Layer.listeners.add(this);
     86                MapView.addLayerChangeListener(this);
    8787        }
    8888
     
    343343        }
    344344        public void layerRemoved(Layer oldLayer) {
    345                 //do nothing
     345                if (oldLayer == this) {
     346                        MapView.removeLayerChangeListener(this);
     347                }
    346348        }
    347349}
Note: See TracChangeset for help on using the changeset viewer.