Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LARA
inox
Commits
8291f8f7
Commit
8291f8f7
authored
10 years ago
by
Emmanouil (Manos) Koukoutos
Committed by
Manos Koukoutos
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Make Leon find scala lib in Eclipse
parent
f513ef07
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/scala/leon/frontends/scalac/ExtractionPhase.scala
+14
-9
14 additions, 9 deletions
src/main/scala/leon/frontends/scalac/ExtractionPhase.scala
with
14 additions
and
9 deletions
src/main/scala/leon/frontends/scalac/ExtractionPhase.scala
+
14
−
9
View file @
8291f8f7
...
@@ -9,6 +9,7 @@ import purescala.Common.FreshIdentifier
...
@@ -9,6 +9,7 @@ import purescala.Common.FreshIdentifier
import
utils._
import
utils._
import
scala.tools.nsc.
{
Settings
=>
NSCSettings
,
CompilerCommand
}
import
scala.tools.nsc.
{
Settings
=>
NSCSettings
,
CompilerCommand
}
import
java.io.File
object
ExtractionPhase
extends
LeonPhase
[
List
[
String
]
,
Program
]
{
object
ExtractionPhase
extends
LeonPhase
[
List
[
String
]
,
Program
]
{
...
@@ -22,15 +23,19 @@ object ExtractionPhase extends LeonPhase[List[String], Program] {
...
@@ -22,15 +23,19 @@ object ExtractionPhase extends LeonPhase[List[String], Program] {
val
settings
=
new
NSCSettings
val
settings
=
new
NSCSettings
val
neededClasses
=
List
[
Class
[
_
]](
val
scalaLib
=
Option
(
scala
.
Predef
.
getClass
scala
.
Predef
.
getClass
.
getProtectionDomain
.
getCodeSource
()
)
)
map
{
_
.
getLocation
.
getPath
}
getOrElse
{
// We are in Eclipse. Look in Eclipse plugins to find scala lib
val
urls
=
neededClasses
.
map
{
_
.
getProtectionDomain
().
getCodeSource
().
getLocation
()
}
val
eclipsePlugins
=
System
.
getenv
(
"ECLIPSE_HOME"
)
+
"/plugins"
new
File
(
eclipsePlugins
).
listFiles
().
map
{
_
.
getAbsolutePath
}.
find
{
_
contains
"scala-library"
}.
val
classpath
=
urls
.
map
(
_
.
getPath
).
mkString
(
":"
)
getOrElse
(
ctx
.
reporter
.
fatalError
(
"No Scala library found. "
+
"If you are working in Eclipse, make sure to set the ECLIPSE_HOME environment variable."
settings
.
classpath
.
value
=
classpath
)
)
}
settings
.
classpath
.
value
=
scalaLib
settings
.
usejavacp
.
value
=
false
settings
.
usejavacp
.
value
=
false
settings
.
Yrangepos
.
value
=
true
settings
.
Yrangepos
.
value
=
true
settings
.
skip
.
value
=
List
(
"patmat"
)
settings
.
skip
.
value
=
List
(
"patmat"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment