From 9301c8ac252a93fb4649d5a024fbcbeb17c274ae Mon Sep 17 00:00:00 2001
From: Etienne Kneuss <ekneuss@gmail.com>
Date: Wed, 12 Dec 2012 17:48:02 +0100
Subject: [PATCH] Obtain inner classpath from SCALA_HOME, so make sure it is
 SET

---
 .../scala/leon/plugin/ExtractionPhase.scala   | 22 +++++---
 web/README                                    |  5 +-
 web/conf/application.conf                     |  2 +-
 web/conf/local.conf                           | 52 -------------------
 4 files changed, 18 insertions(+), 63 deletions(-)
 delete mode 100644 web/conf/local.conf

diff --git a/src/main/scala/leon/plugin/ExtractionPhase.scala b/src/main/scala/leon/plugin/ExtractionPhase.scala
index 72064330b..08be33155 100644
--- a/src/main/scala/leon/plugin/ExtractionPhase.scala
+++ b/src/main/scala/leon/plugin/ExtractionPhase.scala
@@ -12,7 +12,16 @@ object ExtractionPhase extends LeonPhase[List[String], Program] {
   def run(ctx: LeonContext)(args: List[String]): Program = {
 
     val settings = new NSCSettings
-    settings.extdirs.value = ctx.settings.classPath
+
+    val scalaHome = System.getenv("SCALA_HOME")
+
+    val fullClassPath = if (scalaHome != "") {
+      scalaHome+"/lib:"+ctx.settings.classPath
+    } else {
+      ctx.settings.classPath
+    }
+
+    settings.extdirs.value = fullClassPath
 
     val compilerOpts = args.filterNot(_.startsWith("--"))
 
@@ -22,11 +31,12 @@ object ExtractionPhase extends LeonPhase[List[String], Program] {
 
     if(command.ok) {
       // Debugging code for classpath crap
-      //new scala.tools.util.PathResolver(settings).Calculated.basis.foreach { cp =>
-      //  cp.foreach( p => 
-      //    ctx.reporter.info(" => "+p.toString)
-      //  )
-      //}
+      // new scala.tools.util.PathResolver(settings).Calculated.basis.foreach { cp =>
+      //   cp.foreach( p =>
+      //     ctx.reporter.info(" => "+p.toString)
+      //   )
+      // }
+
       val runner = new PluginRunner(settings, ctx, None)
       val run = new runner.Run
       run.compile(command.files)
diff --git a/web/README b/web/README
index 2f80ebec4..5f8a619a1 100644
--- a/web/README
+++ b/web/README
@@ -13,8 +13,5 @@ $ play "start -Dconfig.file=conf/laraserver.conf"
 $ cd path/to/leon-2.0
 $ sbt package
 $ cd web
-
-edit conf/local.conf to match your class-path!
-
 $ export LD_LIBRARY_PATH=../lib-bin/64/
-$ play "start -Dconfig.file=conf/local.conf"
+$ play start
diff --git a/web/conf/application.conf b/web/conf/application.conf
index 5dfd3e304..feebc38b2 100644
--- a/web/conf/application.conf
+++ b/web/conf/application.conf
@@ -49,4 +49,4 @@ logger.application=DEBUG
 app.prefix=""
 
 # Specifies the classpath used by the Scala compiler within Leon
-app.classpath="."
+app.classpath="../library/target/scala-2.9.2/"
diff --git a/web/conf/local.conf b/web/conf/local.conf
deleted file mode 100644
index 165d134cc..000000000
--- a/web/conf/local.conf
+++ /dev/null
@@ -1,52 +0,0 @@
-# This is the main configuration file for the application.
-# ~~~~~
-
-# Secret key
-# ~~~~~
-# The secret key is used to secure cryptographics functions.
-# If you deploy your application to several instances be sure to use the same key!
-application.secret="_JKq[m=o8OG;]F8xD:bGMs^/?KXXb2Huq^KLM=obhIQvsPIwPNJq@sgLWTRCLr4]"
-
-# The application languages
-# ~~~~~
-application.langs="en"
-
-# Global object class
-# ~~~~~
-# Define the Global object class for this application.
-# Default to Global in the root package.
-# global=Global
-
-# Database configuration
-# ~~~~~ 
-# You can declare as many datasources as you want.
-# By convention, the default datasource is named `default`
-#
-# db.default.driver=org.h2.Driver
-# db.default.url="jdbc:h2:mem:play"
-# db.default.user=sa
-# db.default.password=
-
-# Evolutions
-# ~~~~~
-# You can disable evolutions if needed
-# evolutionplugin=disabled
-
-# Logger
-# ~~~~~
-# You can also configure logback (http://logback.qos.ch/), by providing a logger.xml file in the conf directory .
-
-# Root logger:
-logger.root=ERROR
-
-# Logger used by the framework:
-logger.play=INFO
-
-# Logger provided to your application:
-logger.application=DEBUG
-
-# This specifies the prefix under which the web page lies, used almost exclusively for the laraserver setup
-app.prefix=""
-
-# Specifies the classpath used by the Scala compiler within Leon
-app.classpath="/home/ekneuss/.sbt/0.12.1/boot/scala-2.9.2/lib/:../library/target/scala-2.9.2/"
-- 
GitLab