Skip to content

Commit 47b6c5c

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 47b6c5c

File tree

8 files changed

+56
-110
lines changed

8 files changed

+56
-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: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ object DottyBuild extends Build {
2525
override def settings: Seq[Setting[_]] = {
2626
super.settings ++ Seq(
2727
scalaVersion in Global := "2.11.5",
28+
publishArtifact in packageDoc := false,
2829
version in Global := "0.1-SNAPSHOT",
2930
organization in Global := "ch.epfl.lamp",
3031
organizationName in Global := "LAMP/EPFL",
@@ -194,6 +195,58 @@ object DottyBuild extends Build {
194195
addCommandAlias("partest-only-no-bootstrap", ";test:package;package; lockPartestFile;test:test-only dotc.tests;runPartestRunner")
195196
)
196197

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