From 09b2f39731386cd5b3688d5c3badf75d956d4f6d Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Tue, 31 May 2016 15:23:04 +0200 Subject: 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 Original history: https://github.com/smarter/dotty-bridge/commits/master --- project/Build.scala | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'project/Build.scala') diff --git a/project/Build.scala b/project/Build.scala index c753d3779..7a140534f 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -194,6 +194,58 @@ object DottyBuild extends Build { addCommandAlias("partest-only-no-bootstrap", ";test:package;package; lockPartestFile;test:test-only dotc.tests;runPartestRunner") ) + lazy val `dotty-bridge` = project.in(file("bridge")). + dependsOn(dotty). + settings( + overrideScalaVersionSetting, + + description := "sbt compiler bridge for Dotty", + resolvers += Resolver.typesafeIvyRepo("releases"), + libraryDependencies ++= Seq( + "org.scala-sbt" % "interface" % sbtVersion.value, + "org.scala-sbt" % "api" % sbtVersion.value % "test", + "org.specs2" %% "specs2" % "2.3.11" % "test" + ), + version := "0.1.1-SNAPSHOT", + // The sources should be published with crossPaths := false, the binaries + // are unused so it doesn't matter. + crossPaths := false, + + fork in Test := true, + parallelExecution in Test := false + ). + settings(ScriptedPlugin.scriptedSettings: _*). + settings( + ScriptedPlugin.scriptedLaunchOpts := Seq("-Xmx1024m"), + ScriptedPlugin.scriptedBufferLog := false + // TODO: Use this instead of manually copying DottyInjectedPlugin.scala + // everywhere once https://github.com/sbt/sbt/issues/2601 gets fixed. + /*, + ScriptedPlugin.scriptedPrescripted := { f => + IO.write(inj, """ +import sbt._ +import Keys._ + +object DottyInjectedPlugin extends AutoPlugin { + override def requires = plugins.JvmPlugin + override def trigger = allRequirements + + override val projectSettings = Seq( + scalaVersion := "0.1-SNAPSHOT", + scalaOrganization := "ch.epfl.lamp", + scalacOptions += "-language:Scala2", + scalaBinaryVersion := "2.11", + autoScalaLibrary := false, + libraryDependencies ++= Seq("org.scala-lang" % "scala-library" % "2.11.5"), + scalaCompilerBridgeSource := ("ch.epfl.lamp" % "dotty-bridge" % "0.1.1-SNAPSHOT" % "component").sources() + ) +} +""") + } + */ + ) + + /** A sandbox to play with the Scala.js back-end of dotty. * * This sandbox is compiled with dotty with support for Scala.js. It can be -- cgit v1.2.3