ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant version.txt Constants.java Main.java
Date Wed, 31 Jan 2001 13:32:57 GMT
conor       01/01/31 05:32:57

  Modified:    src/main/org/apache/tools/ant Constants.java Main.java
  Added:       src/main/org/apache/tools/ant version.txt
  Log:
  Restore version resource
  
  Revision  Changes    Path
  1.3       +1 -4      jakarta-ant/src/main/org/apache/tools/ant/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Constants.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Constants.java	2001/01/29 15:42:24	1.2
  +++ Constants.java	2001/01/31 13:32:57	1.3
  @@ -12,8 +12,5 @@
    * 
    * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
    */
  -interface Constants
  -{
  -    String  DATE     = "@DATE@";
  -    String  VERSION  = "@VERSION@";
  +interface Constants {
   }
  
  
  
  1.30      +21 -5     jakarta-ant/src/main/org/apache/tools/ant/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Main.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- Main.java	2001/01/29 12:42:15	1.29
  +++ Main.java	2001/01/31 13:32:57	1.30
  @@ -72,9 +72,6 @@
   
   public class Main {
   
  -    public final static String BANNER              = 
  -        "Ant version " + Constants.VERSION + " compiled on " + Constants.DATE;
  -
       /** The default build file name */
       public static final String DEFAULT_BUILD_FILENAME = "build.xml";
   
  @@ -513,8 +510,27 @@
       }
   
       private static void printVersion() {
  -        System.out.println( BANNER );
  -        System.out.println();
  +        try {
  +            Properties props = new Properties();
  +            InputStream in =
  +                Main.class.getResourceAsStream("/org/apache/tools/ant/version.txt");
  +            props.load(in);
  +            in.close();
  +
  +            String lSep = System.getProperty("line.separator");
  +            StringBuffer msg = new StringBuffer();
  +            msg.append("Ant version ");
  +            msg.append(props.getProperty("VERSION"));
  +            msg.append(" compiled on ");
  +            msg.append(props.getProperty("DATE"));
  +            msg.append(lSep);
  +            System.out.println(msg.toString());
  +        } catch (IOException ioe) {
  +            System.err.println("Could not load the version information.");
  +            System.err.println(ioe.getMessage());
  +        } catch (NullPointerException npe) {
  +            System.err.println("Could not load the version information.");
  +        }
       }
   
       /**
  
  
  
  1.3       +0 -0      jakarta-ant/src/main/org/apache/tools/ant/version.txt
  
  
  
  

Mime
View raw message