diff options
author | wisberg <wisberg> | 2002-12-16 17:09:36 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2002-12-16 17:09:36 +0000 |
commit | c3300283ecc397d26ad9dfe31d1710ec45db2af0 (patch) | |
tree | e9acb7f3d33c1499975cec9ef3cc7ea151078344 /build/lib | |
parent | 3cde920c3f7eb8241bf569007e25225d80b43c0f (diff) | |
download | aspectj-c3300283ecc397d26ad9dfe31d1710ec45db2af0.tar.gz aspectj-c3300283ecc397d26ad9dfe31d1710ec45db2af0.zip |
initial version
Diffstat (limited to 'build/lib')
-rw-r--r-- | build/lib/BridgeVersion.java.txt | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/build/lib/BridgeVersion.java.txt b/build/lib/BridgeVersion.java.txt new file mode 100644 index 000000000..95d41d201 --- /dev/null +++ b/build/lib/BridgeVersion.java.txt @@ -0,0 +1,66 @@ +/* ******************************************************************** + * Copyright (c) 1998-2001 Xerox Corporation, + * 2002 Palo Alto Research Center, Incorporated (PARC). + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Common Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * Xerox/PARC initial implementation + * *******************************************************************/ + +package org.aspectj.bridge; + +import java.text.ParsePosition; +import java.text.SimpleDateFormat; +import java.util.Date; + +/** release-specific version information */ +public class Version { + + /** default version value for development version */ + public static final String DEVELOPMENT = "DEVELOPMENT"; + + /** default time value for development version */ + public static final long NOTIME = 0L; + + /** set by build script */ + public static final String text = "@build.version@"; + + /** + * Time text set by build script using SIMPLE_DATE_FORMAT. + * (if DEVELOPMENT version, invalid) + */ + public static final String time_text = "@build.time@"; + + /** + * time in seconds-since-... format, used by programmatic clients. + * (if DEVELOPMENT version, NOTIME) + */ + public static final long time; + + /** format used by build script to set time_text */ + public static final String SIMPLE_DATE_FORMAT = "@build.time.format@"; + + // if not DEVELOPMENT version, read time text using format used to set time + static { + long foundTime = NOTIME; + if (!DEVELOPMENT.equals(text)) { + try { + SimpleDateFormat format = new SimpleDateFormat(SIMPLE_DATE_FORMAT); + ParsePosition pos = new ParsePosition(0); + Date date = format.parse(time_text, pos); + foundTime = date.getTime(); + } catch (Throwable t) { + } + } + time = foundTime; + } +} + + + + + |