Changeset 4018 in osm for applications/editors
- Timestamp:
- 2007-08-08T21:08:40+02:00 (17 years ago)
- Location:
- applications/editors/josm/plugins/ywms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/ywms/build.xml
r3579 r4018 23 23 <fileset dir="images"/> 24 24 </copy> 25 <exec append="false" output=" build/resources/REVISION" executable="svn" failifexecutionfails="false">25 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false"> 26 26 <env key="LANG" value="C"/> 27 27 <arg value="info"/> 28 <arg value="--xml"/> 28 29 <arg value="."/> 29 30 </exec> 30 <property file="build/resources/REVISION" /> 31 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/> 32 <delete file="REVISION"/> 31 33 <jar destfile="ywms.jar" basedir="build"> 32 34 <manifest> 33 35 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.ywms.YWMSPlugin"/> 34 36 <attribute name="Plugin-Description" value="A WMS server for Yahoo imagery based on Firefox"/> 35 <attribute name="Plugin-Version" value="${Revision}"/> 37 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 38 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 36 39 <attribute name="Author" value="Francisco R. Santos <frsantos@gmail.com>"/> 37 40 </manifest> -
applications/editors/josm/plugins/ywms/src/org/openstreetmap/josm/plugins/ywms/Util.java
r3612 r4018 8 8 import java.net.URLConnection; 9 9 import java.util.StringTokenizer; 10 import java.util.regex.Matcher;11 import java.util.regex.Pattern;12 10 13 11 import javax.swing.JButton; 14 12 15 13 import org.openstreetmap.josm.Main; 16 import org.openstreetmap.josm.plugins.Plugin; 17 import org.openstreetmap.josm.plugins.PluginProxy; 14 import org.openstreetmap.josm.plugins.*; 18 15 import org.openstreetmap.josm.tools.ImageProvider; 19 16 … … 81 78 public static Version getVersion() 82 79 { 83 String revision; 84 try 85 { 86 revision = loadFile(Util.class.getResource("/resources/REVISION")); 87 } 88 catch (Exception e) 89 { 90 return null; 91 } 92 93 Pattern versionPattern = Pattern.compile(".*?Revision: ([0-9]*).*", Pattern.CASE_INSENSITIVE|Pattern.DOTALL); 94 Matcher match = versionPattern.matcher(revision); 95 String version = match.matches() ? match.group(1) : "UNKNOWN"; 96 97 Pattern timePattern = Pattern.compile(".*?Last Changed Date: ([^\n]*).*", Pattern.CASE_INSENSITIVE|Pattern.DOTALL); 98 match = timePattern.matcher(revision); 99 String time = match.matches() ? match.group(1) : "UNKNOWN"; 100 101 return new Version(version, time); 80 PluginInformation info = PluginInformation.getLoaded("ywms"); 81 if( info == null ) 82 return null; 83 84 return new Version(info.version, info.attr.get("Plugin-Date")); 102 85 } 103 86
Note:
See TracChangeset
for help on using the changeset viewer.