A Universe Type System for Scala
================================

The implementation of the type system uses two Scala [1] compiler
plugins. It was developed and tested with Scala 2.6.1 and Scala's trunk up
to r13855. Versions >2.6.1 don't need/support the -Ygenerics and
-Xplug-types options anymore, so they might need to be removed from the
build script and source code files, if present. See the bottom of this file for
a patch which should achieve this.



Directory Layout
****************

The directory layout mimics the recommended layout from Apache Maven [2] in
order to ease a possible future migration to Maven.

.
|-- lib                          Runtime support library for MultiJava, 
|                                required when working with Eclipse [3,4].
|-- src                          Source code.
|   |-- examples                 Example programs which use ownership 
|   |                            modifiers.
|   |-- main                     Main implementation of the plugins.
|   `-- test                     Tests and some helper classes for tests.
`-- target                       Directory where the compiled classes,
                                 packages, etc. are put.



Build
*****

The build uses Apache Ant [5]. It was tested with Ant 1.7.0, but 1.6.3
should work, too. It expects that $SCALA_HOME points to the directory where
Scala resides (similar to $JAVA_HOME for Java) or alternatively, that Scala
can be found in ~/sbaz. If it lives somewhere else, appending
-Dscala.home=<path> to calls of ant should help.

There are several targets, all of which can be listed by calling ant -p.
This will give a list of targets with a short description for each
target. The most relevant ones are the following: 
o build:     Builds the plugins.
o run.tests: Runs the unit tests.
o clean:     Removes the target directory.
o eclipse:   Builds a library which must be available on Eclipse's class
             path in order to compile the Scala code of the plugins in
			 Eclipse.
o dist       Builds an sbaz [6] distribution and the API documentation.

It is possible to customize the build by adapting the build.properties
file. This avoids changes to the main build script in build.xml.



Licenses
********

o GNU General Public License >= v2 for the actual implementation of the
  plugins.

o GNU Lesser General Public License >= 2.1 for the annotations
  (src/main/scala/ch/ethz/inf/sct/uts/annotation/*.scala) and the runtime
  support libraries (src/main/scala/ch/ethz/inf/sct/uts/rt/*,
  src/main/java/org/multijava/*, except for
  src/main/java/org/multijava/util/Utils.java which is GPL).

The license texts may be found in [7,8].



References
**********

[1] http://www.scala-lang.org/
[2] http://maven.apache.org/
[3] http://www.eclipse.org/
[4] http://www.scala-lang.org/downloads/eclipse/index.html
[5] http://ant.apache.org/
[6] http://www.lexspoon.org/sbaz/
[7] http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
[8] http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt



Patch to make plugins work with Scala >2.6.1
********************************************

Index: src/main/scala/ch/ethz/inf/sct/uts/plugin/UniverseTypeSystemComponentBase.scala
===================================================================
--- src/main/scala/ch/ethz/inf/sct/uts/plugin/UniverseTypeSystemComponentBase.scala
+++ src/main/scala/ch/ethz/inf/sct/uts/plugin/UniverseTypeSystemComponentBase.scala
@@ -107,16 +107,11 @@
    * @param f       Code block which does the actual processing.
    */
   def processUnits(message: => String, f: => Unit) {
-    if (!settings.Xplugtypes.value) {
-      logger.notice("-Xplug-types not in use, therefore no Universe type system checks are done.")
-    }
-    else {
-      logger.info(message)
-      f
-      logger.info("Done.")
+    logger.info(message)
+    f
+    logger.info("Done.")
      
-      showASTBrowser
-      printProcessedAST
-    }
+    showASTBrowser
+    printProcessedAST
   }
 }
Index: build.xml
===================================================================
--- build.xml
+++ build.xml
@@ -28,7 +28,7 @@
 	<property name="testopt" value="" />
 	<property name="incpat" value="**/*.scala" />
 	<property name="scalac.options"
-	          value="-unchecked -deprecation -explaintypes -Xplug-types -Ygenerics" />
+	          value="-unchecked -deprecation -explaintypes" />
 
 	<!-- Classes with tests -->
 	<property name="test.static.main"

The patch may be applied by calling patch -p0 < README in this directory. It
was last tested with Scala version 2.7.0.13931.
