-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Create dotty-staging library #7080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create dotty-staging library #7080
Conversation
4501e88
to
49645bd
Compare
bbf73b8
to
9890305
Compare
import java.io.File.{ pathSeparator => sep } | ||
val args = "-from-tasty" :: "-Yretain-trees" :: "-classpath" :: s"$classpath$sep$currentClasspath" :: classes | ||
(new Consume).process(args.toArray) | ||
} | ||
|
||
private def getCurrentClasspath(cl: ClassLoader): String = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need to be duplicated with QuoteDriver ? (Unrelated but this implementation looks very fragile to me, this makes way too many assumptions about how classloaders are setup, which might be broken by sbt 1.3 uses of layered classloaders for example)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will look into it in another PR. For now we keep the same behaviour as before.
9890305
to
028615e
Compare
Rebased |
a749162
to
0252bed
Compare
// when compiling a project that depends on dotty-staging (see ...), but we always need it to be present | ||
// on the JVM classpath at runtime. | ||
dependsOn(dottyCompiler(Bootstrapped) % "provided"). | ||
dependsOn(dottyCompiler(Bootstrapped) % "compile->runtime"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smarter I had to separate the dependencies. % "provided,compile->runtime,test->test"
was not working.
0252bed
to
fdec7ad
Compare
Extract the staging out of the standard library and compiler.
dotty-staging
project that depends ondotty-compiler
dotty-staging
project or jarScopeId
logic intodotty.tools.dotc.quoted.QuoteContext
library/src-non-bootstrapped/scala/quoted/package.scala
staging.{run, withQuoteContext}
,Toolbox
,QuoteDriver
,QuoteCompiler
,ExprCompilationUnit
todotty-staging
Toolbox.make
directly (instead of as a java reflection call)"ch.epfl.lamp" %% "dotty-staging" % scalaVersion.value