Changeset 4024 in osm for applications
- Timestamp:
- 2007-08-08T22:30:31+02:00 (17 years ago)
- Location:
- applications/editors/josm/plugins/validator
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/validator/build.xml
r3577 r4024 17 17 18 18 <target name="build" depends="clean, compile"> 19 <copy todir="build/resources">20 <fileset dir="resources"/>21 </copy>22 19 <copy todir="build/images"> 23 20 <fileset dir="images"/> 24 21 </copy> 25 <exec append="false" output=" build/resources/REVISION" executable="svn" failifexecutionfails="false">22 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false"> 26 23 <env key="LANG" value="C"/> 27 24 <arg value="info"/> 25 <arg value="--xml"/> 28 26 <arg value="."/> 29 27 </exec> 30 <property file="build/resources/REVISION" /> 28 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/> 29 <delete file="REVISION"/> 31 30 <jar destfile="validator.jar" basedir="build"> 32 31 <manifest> 33 32 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.validator.OSMValidatorPlugin"/> 34 33 <attribute name="Plugin-Description" value="A OSM data validator"/> 35 <attribute name="Plugin-Version" value="${Revision}"/> 34 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 35 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 36 36 <attribute name="Author" value="Francisco R. Santos <frsantos@gmail.com>"/> 37 37 </manifest> -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/util/Util.java
r3440 r4024 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; … … 15 13 import org.openstreetmap.josm.Main; 16 14 import org.openstreetmap.josm.plugins.Plugin; 15 import org.openstreetmap.josm.plugins.PluginInformation; 17 16 import org.openstreetmap.josm.plugins.PluginProxy; 18 17 import org.openstreetmap.josm.tools.ImageProvider; … … 81 80 public static Version getVersion() 82 81 { 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); 82 PluginInformation info = PluginInformation.getLoaded("validator"); 83 if( info == null ) 84 return null; 85 86 return new Version(info.version, info.attr.get("Plugin-Date")); 102 87 } 103 88
Note:
See TracChangeset
for help on using the changeset viewer.