Skip to content

Commit 7f026aa

Browse files
committed
Make the dotty-bridge sbt project a subproject of dotty
Note that the dotty-bridge tests will not be run automatically by `test` which is short for `dotty/test`, to run the dotty-bridge tests, do in sbt: > dotty-bridge/test > dotty-bridge/scripted Fix #1293
1 parent fa151a8 commit 7f026aa

File tree

8 files changed

+55
-110
lines changed

8 files changed

+55
-110
lines changed

AUTHORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The majority of the dotty codebase is new code, with the exception of the compon
5353
> the needs of dotty. Original authors include: Adrian Moors, Lukas Rytz,
5454
> Grzegorz Kossakowski, Paul Phillips
5555
56-
`dotty.tools.dotc.sbt`
56+
`dotty.tools.dotc.sbt and everything in bridge/`
5757

5858
> The sbt compiler phases are based on
5959
> https://github.com/adriaanm/scala/tree/sbt-api-consolidate/src/compiler/scala/tools/sbt

bridge/LICENSE

Lines changed: 0 additions & 30 deletions
This file was deleted.

bridge/README.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

bridge/build.sbt

Lines changed: 0 additions & 54 deletions
This file was deleted.

bridge/project/build.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

bridge/project/scripted.sbt

Lines changed: 0 additions & 3 deletions
This file was deleted.

project/Build.scala

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,58 @@ object DottyBuild extends Build {
194194
addCommandAlias("partest-only-no-bootstrap", ";test:package;package; lockPartestFile;test:test-only dotc.tests;runPartestRunner")
195195
)
196196

197+
lazy val `dotty-bridge` = project.in(file("bridge")).
198+
dependsOn(dotty).
199+
settings(
200+
overrideScalaVersionSetting,
201+
202+
description := "sbt compiler bridge for Dotty",
203+
resolvers += Resolver.typesafeIvyRepo("releases"),
204+
libraryDependencies ++= Seq(
205+
"org.scala-sbt" % "interface" % sbtVersion.value,
206+
"org.scala-sbt" % "api" % sbtVersion.value % "test",
207+
"org.specs2" %% "specs2" % "2.3.11" % "test"
208+
),
209+
version := "0.1.1-SNAPSHOT",
210+
// The sources should be published with crossPaths := false, the binaries
211+
// are unused so it doesn't matter.
212+
crossPaths := false,
213+
214+
fork in Test := true,
215+
parallelExecution in Test := false
216+
).
217+
settings(ScriptedPlugin.scriptedSettings: _*).
218+
settings(
219+
ScriptedPlugin.scriptedLaunchOpts := Seq("-Xmx1024m"),
220+
ScriptedPlugin.scriptedBufferLog := false
221+
// TODO: Use this instead of manually copying DottyInjectedPlugin.scala
222+
// everywhere once https://github.com/sbt/sbt/issues/2601 gets fixed.
223+
/*,
224+
ScriptedPlugin.scriptedPrescripted := { f =>
225+
IO.write(inj, """
226+
import sbt._
227+
import Keys._
228+
229+
object DottyInjectedPlugin extends AutoPlugin {
230+
override def requires = plugins.JvmPlugin
231+
override def trigger = allRequirements
232+
233+
override val projectSettings = Seq(
234+
scalaVersion := "0.1-SNAPSHOT",
235+
scalaOrganization := "ch.epfl.lamp",
236+
scalacOptions += "-language:Scala2",
237+
scalaBinaryVersion := "2.11",
238+
autoScalaLibrary := false,
239+
libraryDependencies ++= Seq("org.scala-lang" % "scala-library" % "2.11.5"),
240+
scalaCompilerBridgeSource := ("ch.epfl.lamp" % "dotty-bridge" % "0.1.1-SNAPSHOT" % "component").sources()
241+
)
242+
}
243+
""")
244+
}
245+
*/
246+
)
247+
248+
197249
/** A sandbox to play with the Scala.js back-end of dotty.
198250
*
199251
* This sandbox is compiled with dotty with support for Scala.js. It can be

project/scripted.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Used by the subproject dotty-bridge
2+
libraryDependencies += "org.scala-sbt" % "scripted-plugin" % sbtVersion.value

0 commit comments

Comments
 (0)