Changeset 2369 in josm for trunk


Ignore:
Timestamp:
2009-11-01T09:22:27+01:00 (12 years ago)
Author:
Gubaer
Message:

fixed #3305: Version is UNKNOWN
see also howto create a JOSM build?

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r2368 r2369  
     1<!--
     2** build.xml - main ant file for JOSM
     3**
     4** To build run
     5**    ant clean
     6**    ant dist
     7** This will create 'josm-custom.jar'  in directory 'dist'. See also
     8**   https://josm.openstreetmap.de/wiki/CreateBuild
     9**
     10**
     11-->
    112<project name="josm" default="dist" basedir=".">
    213        <property name="test.dir" value="test" />
  • trunk/src/org/openstreetmap/josm/actions/AboutAction.java

    r2358 r2369  
    7575        JTextArea revision = new JTextArea();
    7676        revision.setEditable(false);
    77         revision.setText(version.getRevision());
     77        revision.setText(version.getReleaseAttributes());
    7878        about.addTab(tr("Info"), info);
    7979        about.addTab(tr("Readme"), createScrollPane(readme));
  • trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java

    r2358 r2369  
    4747    {
    4848        StringBuilder text = new StringBuilder();
    49         text.append(Version.getInstance().getRevision());
     49        text.append(Version.getInstance().getReleaseAttributes());
    5050        text.append("\n");
    5151        text.append("Memory Usage: ");
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r2358 r2369  
    699699        }
    700700        int v = Version.getInstance().getVersion();
    701         String s = ( v == Version.JOSM_UNKNOWN_VERSION) ? "UNKNOWN" : Integer.toString(v);       
     701        String s = (v == Version.JOSM_UNKNOWN_VERSION) ? "UNKNOWN" : Integer.toString(v);   
     702        if (! Version.getInstance().isLocalBuild() && v != Version.JOSM_UNKNOWN_VERSION) {
     703            s += " SVN";
     704        } else if (Version.getInstance().isLocalBuild() && v != Version.JOSM_UNKNOWN_VERSION) {
     705            s += " Local";
     706        }
    702707        sysProp.put("http.agent", "JOSM/1.5 ("+ s+" "+LanguageInfo.getJOSMLocaleCode()+")");
    703708        System.setProperties(sysProp);
  • trunk/src/org/openstreetmap/josm/data/Version.java

    r2358 r2369  
    77import java.io.IOException;
    88import java.io.InputStreamReader;
    9 import java.net.MalformedURLException;
    109import java.net.URL;
    1110import java.util.HashMap;
     
    1716
    1817/**
    19  * Provides basic information about JOSM build currently used.
     18 * Provides basic information about the currently used JOSM build.
    2019 *
    2120 */
     
    6766    private String revision;
    6867    private String time;
    69    
     68    private boolean isLocalBuild;
    7069   
    7170    protected HashMap<String, String> parseManifestStyleFormattedString(String content) {
     
    118117        }
    119118       
     119        // is this a local build ?
     120        //
     121        isLocalBuild = false;
     122        value = properties.get("Is-Local-Build");
     123        if (value != null && value.trim().toLowerCase().equals("true"))  {
     124            isLocalBuild = true;
     125        }
     126       
    120127        // the revision info
    121128        //
     
    149156    }
    150157   
    151     public String getRevision() {
     158    /**
     159     * Replies a text with the release attributes
     160     * 
     161     * @return a text with the release attributes
     162     */
     163    public String getReleaseAttributes() {
    152164        return revision;
    153165    }
    154166
     167    /**
     168     * Replies the build date as string
     169     *
     170     * @return the build date as string
     171     */
    155172    public String getTime() {
    156173        return time;
    157174    }
    158175   
     176    /**
     177     * Replies the JOSM version. Replies {@see #JOSM_UNKNOWN_VERSION} if the version isn't known.
     178     * @return the JOSM version
     179     */
    159180    public int getVersion() {
    160181        return version;
    161182    }
     183
     184    /**
     185     * Replies true if this is a local build, i.e. an inofficial development build.
     186     *
     187     * @return true if this is a local build, i.e. an inofficial development build.
     188     */
     189    public boolean isLocalBuild() {
     190        return isLocalBuild;
     191    }
    162192}
Note: See TracChangeset for help on using the changeset viewer.