added property file to scala-library.jar
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@11012 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
parent
2b612049b2
commit
4609ba6ad0
33
build.xml
33
build.xml
|
@ -65,6 +65,7 @@ PROPERTIES
|
||||||
<property name="scaladoc.exec.name" value="scaladoc"/>
|
<property name="scaladoc.exec.name" value="scaladoc"/>
|
||||||
<property name="fsc.exec.name" value="fsc"/>
|
<property name="fsc.exec.name" value="fsc"/>
|
||||||
<property name="comp.prop.name" value="compiler.properties"/>
|
<property name="comp.prop.name" value="compiler.properties"/>
|
||||||
|
<property name="lib.prop.name" value="library.properties"/>
|
||||||
|
|
||||||
<!-- ===========================================================================
|
<!-- ===========================================================================
|
||||||
ANT INITIALISATION
|
ANT INITIALISATION
|
||||||
|
@ -346,6 +347,16 @@ BUILD LOCAL REFERENCE (LOCKER) LAYER
|
||||||
<exclude name="scala/actors/**"/>
|
<exclude name="scala/actors/**"/>
|
||||||
<excludesfile name="${nsc.excludes.file}" if="excludes.avail"/>
|
<excludesfile name="${nsc.excludes.file}" if="excludes.avail"/>
|
||||||
</starr>
|
</starr>
|
||||||
|
<echo
|
||||||
|
file="${locker.dir}/lib/library/${lib.prop.name}"
|
||||||
|
message="version.number=${version.number}${line.separator}"
|
||||||
|
append="false"
|
||||||
|
/>
|
||||||
|
<echo
|
||||||
|
file="${locker.dir}/lib/library/${lib.prop.name}"
|
||||||
|
message="copyright.string=${copyright.string}${line.separator}"
|
||||||
|
append="true"
|
||||||
|
/>
|
||||||
<!-- Build compiler -->
|
<!-- Build compiler -->
|
||||||
<mkdir dir="${locker.dir}/lib/compiler"/>
|
<mkdir dir="${locker.dir}/lib/compiler"/>
|
||||||
<starr
|
<starr
|
||||||
|
@ -466,6 +477,16 @@ BUILD QUICK-TEST LAYER
|
||||||
<exclude name="scala/actors/**"/>
|
<exclude name="scala/actors/**"/>
|
||||||
<excludesfile name="${nsc.excludes.file}" if="excludes.avail"/>
|
<excludesfile name="${nsc.excludes.file}" if="excludes.avail"/>
|
||||||
</locker>
|
</locker>
|
||||||
|
<echo
|
||||||
|
file="${quick.dir}/lib/library/${lib.prop.name}"
|
||||||
|
message="version.number=${version.number}${line.separator}"
|
||||||
|
append="false"
|
||||||
|
/>
|
||||||
|
<echo
|
||||||
|
file="${quick.dir}/lib/library/${lib.prop.name}"
|
||||||
|
message="copyright.string=${copyright.string}${line.separator}"
|
||||||
|
append="true"
|
||||||
|
/>
|
||||||
<!-- Build DBC -->
|
<!-- Build DBC -->
|
||||||
<mkdir dir="${quick.dir}/lib/dbc"/>
|
<mkdir dir="${quick.dir}/lib/dbc"/>
|
||||||
<locker
|
<locker
|
||||||
|
@ -668,6 +689,16 @@ TEST
|
||||||
<exclude name="scala/actors/**"/>
|
<exclude name="scala/actors/**"/>
|
||||||
<excludesfile name="${nsc.excludes.file}" if="excludes.avail"/>
|
<excludesfile name="${nsc.excludes.file}" if="excludes.avail"/>
|
||||||
</quick>
|
</quick>
|
||||||
|
<echo
|
||||||
|
file="${strap.dir}/lib/library/${lib.prop.name}"
|
||||||
|
message="version.number=${version.number}${line.separator}"
|
||||||
|
append="false"
|
||||||
|
/>
|
||||||
|
<echo
|
||||||
|
file="${strap.dir}/lib/library/${lib.prop.name}"
|
||||||
|
message="copyright.string=${copyright.string}${line.separator}"
|
||||||
|
append="true"
|
||||||
|
/>
|
||||||
<!-- Build DBC -->
|
<!-- Build DBC -->
|
||||||
<mkdir dir="${strap.dir}/lib/dbc"/>
|
<mkdir dir="${strap.dir}/lib/dbc"/>
|
||||||
<quick
|
<quick
|
||||||
|
@ -970,6 +1001,7 @@ GENERATES A DISTRIBUTION
|
||||||
<manifest>
|
<manifest>
|
||||||
<attribute name="Signature-Version" value="${version.number}"/>
|
<attribute name="Signature-Version" value="${version.number}"/>
|
||||||
<attribute name="Built-By" value="${user.name}"/>
|
<attribute name="Built-By" value="${user.name}"/>
|
||||||
|
<attribute name="Main-Class" value="scala.tools.nsc.Main"/>
|
||||||
<attribute name="Class-Path" value="${lib.jar.name}"/>
|
<attribute name="Class-Path" value="${lib.jar.name}"/>
|
||||||
<section name="scala/tools/nsc">
|
<section name="scala/tools/nsc">
|
||||||
<attribute name="Extension-Name" value="scala.tools.nsc"/>
|
<attribute name="Extension-Name" value="scala.tools.nsc"/>
|
||||||
|
@ -988,6 +1020,7 @@ GENERATES A DISTRIBUTION
|
||||||
<manifest>
|
<manifest>
|
||||||
<attribute name="Signature-Version" value="${version.number}"/>
|
<attribute name="Signature-Version" value="${version.number}"/>
|
||||||
<attribute name="Built-By" value="${user.name}"/>
|
<attribute name="Built-By" value="${user.name}"/>
|
||||||
|
<attribute name="Main-Class" value="scala.runtime.Properties"/>
|
||||||
<section name="scala">
|
<section name="scala">
|
||||||
<attribute name="Extension-Name" value="scala"/>
|
<attribute name="Extension-Name" value="scala"/>
|
||||||
<attribute name="Specification-Title" value="Scala Library"/>
|
<attribute name="Specification-Title" value="Scala Library"/>
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
/* __ *\
|
||||||
|
** ________ ___ / / ___ Scala API **
|
||||||
|
** / __/ __// _ | / / / _ | (c) 2006-2007, LAMP/EPFL **
|
||||||
|
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
|
||||||
|
** /____/\___/_/ |_/____/_/ | | **
|
||||||
|
** |/ **
|
||||||
|
\* */
|
||||||
|
|
||||||
|
// $Id$
|
||||||
|
|
||||||
|
package scala.runtime
|
||||||
|
|
||||||
|
/** A utility to load the library properties from a Java properties file
|
||||||
|
* included in the jar.
|
||||||
|
*
|
||||||
|
* @author Stephane Micheloud
|
||||||
|
*/
|
||||||
|
object Properties {
|
||||||
|
|
||||||
|
/** The name of the properties file */
|
||||||
|
private val propFilename = "/library.properties"
|
||||||
|
|
||||||
|
/** The loaded properties */
|
||||||
|
private val props = {
|
||||||
|
val props = new java.util.Properties
|
||||||
|
val stream = classOf[Application].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-2007 LAMP/EPFL"
|
||||||
|
props.getProperty("copyright.string", defaultString)
|
||||||
|
}
|
||||||
|
|
||||||
|
val encodingString: String = {
|
||||||
|
val defaultString = "ISO-8859-1"
|
||||||
|
props.getProperty("file.encoding", defaultString)
|
||||||
|
}
|
||||||
|
|
||||||
|
private val writer = new java.io.PrintWriter(Console.err, true)
|
||||||
|
|
||||||
|
val versionMsg = "Scala library " + versionString + " -- " + copyrightString
|
||||||
|
|
||||||
|
def main(args: Array[String]) {
|
||||||
|
writer.println(versionMsg)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue