summaryrefslogtreecommitdiff
path: root/src/scalap
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-03-13 14:47:09 +0000
committerPaul Phillips <paulp@improving.org>2009-03-13 14:47:09 +0000
commitcd105bb1f485acec9a5f4e57b859112f30bd43f5 (patch)
tree60a9ab61bc1a7e1c7b76ed21946a905216b2bbe8 /src/scalap
parentca9431e11c1d72de95ef76cc04474725eae34b0e (diff)
downloadscala-cd105bb1f485acec9a5f4e57b859112f30bd43f5.tar.gz
scala-cd105bb1f485acec9a5f4e57b859112f30bd43f5.tar.bz2
scala-cd105bb1f485acec9a5f4e57b859112f30bd43f5.zip
More consolidation and duplication elimination ...
More consolidation and duplication elimination in Properties.
Diffstat (limited to 'src/scalap')
-rw-r--r--src/scalap/scala/tools/scalap/Properties.scala46
1 files changed, 7 insertions, 39 deletions
diff --git a/src/scalap/scala/tools/scalap/Properties.scala b/src/scalap/scala/tools/scalap/Properties.scala
index 302b0ec463..05452c448e 100644
--- a/src/scalap/scala/tools/scalap/Properties.scala
+++ b/src/scalap/scala/tools/scalap/Properties.scala
@@ -9,42 +9,10 @@
package scala.tools.scalap
-/** A utility to load the compiler properties from a Java properties file
- * included in the jar.
- */
-object Properties {
-
- /** The name of the properties file */
- private val propFilename = "/decoder.properties"
-
- /** The loaded properties */
- private val props = {
- val props = new java.util.Properties
- val stream = classOf[Classfile].getResourceAsStream(propFilename)
- if (stream != null)
- props.load(stream)
- props
- }
-
- /** The version number of the jar this was loaded from, or
- * "(unknown)" if it cannot be determined.
- */
- val versionString: String = {
- val defaultString = "(unknown)"
- "version " + props.getProperty("version.number")
- }
-
- val copyrightString: String = {
- val defaultString = "(c) 2002-2009 LAMP/EPFL"
- props.getProperty("copyright.string", defaultString)
- }
-
- val scalaHome: String =
- System.getProperty("scala.home")
-
- val cmdName: String = {
- val isWin = System.getProperty("os.name") startsWith "Windows"
- if (isWin) "scala.bat" else "scala"
- }
-
-}
+/** Loads decoder.properties from the jar. */
+object Properties extends scala.util.PropertiesTrait
+{
+ protected def propCategory = "decoder"
+ protected def pickJarBasedOn = classOf[Classfile]
+ val cmdName = nsc.Properties.cmdName
+} \ No newline at end of file