Changeset 13197 for trunk/abcl/src/org


Ignore:
Timestamp:
01/30/11 22:26:43 (11 years ago)
Author:
Mark Evenson
Message:

Incorporate output of 'svnversion' into LISP-IMPLEMENTATION-VERSION.

In the Ant-based build, if the executable 'svnversion' can be found on
the PATH and the topmost '.svn' subdirectory exists, the output of
'svnversion' is appended to the value returned by
LISP-IMPLEMENTATION-VERSION.

The use of 'version.src' in 'abcl.properties' has been removed.

TODO: the same functionality should be added to the Lisp-based build.

TODO: test that this works on Windows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Version.java

    r13131 r13197  
    3434package org.armedbear.lisp;
    3535
     36import java.io.BufferedReader;
     37import java.io.InputStream;
     38import java.io.InputStreamReader;
     39
    3640public final class Version
    3741{
    38   private Version()
     42  private Version() {}
     43 
     44  static final String baseVersion = "0.25.0-dev";
     45 
     46  static void init() {
     47    try {
     48      InputStream input = Version.class.getResourceAsStream("version");
     49      BufferedReader reader = new BufferedReader(new InputStreamReader(input));
     50      String v = reader.readLine().trim();
     51      version = v;
     52    } catch (Throwable t) {
     53      version = baseVersion;
     54    }
     55  }
     56 
     57  static String version = "";
     58  public synchronized static String getVersion()
    3959  {
    40   }
    41 
    42   public static String getVersion()
    43   {
    44     return "0.25.0-dev";
     60    if ("".equals(version)) {
     61      init();
     62    }
     63    return version;
    4564  }
    4665
Note: See TracChangeset for help on using the changeset viewer.