File tree Expand file tree Collapse file tree 5 files changed +17
-7
lines changed
sbt-test/sbt-dotty/scala2
src/dotty/tools/sbtplugin Expand file tree Collapse file tree 5 files changed +17
-7
lines changed Original file line number Diff line number Diff line change
1
+ ThisBuild / scalaVersion := " 2.12.8"
Original file line number Diff line number Diff line change
1
+ addSbtPlugin(" ch.epfl.lamp" % " sbt-dotty" % sys.props(" plugin.version" ))
Original file line number Diff line number Diff line change
1
+ package hello
2
+ /** Hello, world! */
3
+ object Hello {
4
+ def main (args : Array [String ]): Unit = {
5
+ println(" Hello Scala 2" )
6
+ }
7
+ }
Original file line number Diff line number Diff line change
1
+ > run
2
+ > doc
Original file line number Diff line number Diff line change @@ -148,6 +148,8 @@ object DottyPlugin extends AutoPlugin {
148
148
}
149
149
)
150
150
151
+ // https://github.com/sbt/sbt/issues/3110
152
+ val Def = sbt.Def
151
153
override def projectSettings : Seq [Setting [_]] = {
152
154
Seq (
153
155
isDotty := scalaVersion.value.startsWith(" 0." ),
@@ -299,13 +301,10 @@ object DottyPlugin extends AutoPlugin {
299
301
allJars
300
302
)
301
303
}
302
- else Def .task {
303
- // This should really be `old` with `val old = scalaInstance.value`
304
- // above, except that this would force the original definition of the
305
- // `scalaInstance` task to be computed when `isDotty` is true, which
306
- // would fail because `managedScalaInstance` is false.
307
- Defaults .scalaInstanceTask.value
308
- }
304
+ else
305
+ // This dereferences the Initialize graph, but keeps the Task unevaluated,
306
+ // so its effect gets fired only when isDotty.value evaluates to false. yay monad.
307
+ Def .valueStrict { scalaInstance.taskValue }
309
308
}.value,
310
309
311
310
// Because managedScalaInstance is false, sbt won't add the standard library to our dependencies for us
You can’t perform that action at this time.
0 commit comments