Skip to content

Commit 70c072a

Browse files
committed
Switch to build.sbt
Using the same technique than scala-js where we just forward to Build.scala: scala-js/scala-js#2312
1 parent d9f98c2 commit 70c072a

File tree

2 files changed

+41
-23
lines changed

2 files changed

+41
-23
lines changed

build.sbt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
val dotty = Build.dotty
2+
val `dotty-bootstrapped` = Build.`dotty-bootstrapped`
3+
val `dotty-interfaces` = Build.`dotty-interfaces`
4+
val `dotty-doc` = Build.`dotty-doc`
5+
val `dotty-bot` = Build.`dotty-bot`
6+
val `dotty-compiler` = Build.`dotty-compiler`
7+
val `dotty-compiler-bootstrapped` = Build.`dotty-compiler-bootstrapped`
8+
val `dotty-bin-tests` = Build.`dotty-bin-tests`
9+
val `dotty-library` = Build.`dotty-library`
10+
val `dotty-library-bootstrapped` = Build.`dotty-library-bootstrapped`
11+
val `dotty-sbt-bridge` = Build.`dotty-sbt-bridge`
12+
val sjsSandbox = Build.sjsSandbox
13+
val `dotty-bench` = Build.`dotty-bench`
14+
val `scala-library` = Build.`scala-library`
15+
val `scala-compiler` = Build.`scala-compiler`
16+
val `scala-reflect` = Build.`scala-reflect`
17+
val scalap = Build.scalap
18+
19+
inThisBuild(Build.thisBuildSettings)

project/Build.scala

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import org.scalajs.sbtplugin.ScalaJSPlugin
1010
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
1111
import sbt.Package.ManifestAttributes
1212

13-
object DottyBuild extends Build {
13+
object Build {
1414

1515
val scalacVersion = "2.11.5" // Do not rename, this is grepped in bin/common.
1616

@@ -59,26 +59,25 @@ object DottyBuild extends Build {
5959
// Shorthand for compiling a docs site
6060
lazy val dottydoc = inputKey[Unit]("run dottydoc")
6161

62-
override def settings: Seq[Setting[_]] = {
63-
super.settings ++ Seq(
64-
scalaVersion in Global := scalacVersion,
65-
version in Global := dottyVersion,
66-
organization in Global := dottyOrganization,
67-
organizationName in Global := "LAMP/EPFL",
68-
organizationHomepage in Global := Some(url("http://lamp.epfl.ch")),
69-
homepage in Global := Some(url("https://github.com/lampepfl/dotty")),
70-
71-
// scalac options
72-
scalacOptions in Global ++= Seq(
73-
"-feature",
74-
"-deprecation",
75-
"-encoding", "UTF8",
76-
"-language:existentials,higherKinds,implicitConversions"
77-
),
78-
79-
javacOptions in Global ++= Seq("-Xlint:unchecked", "-Xlint:deprecation")
80-
)
81-
}
62+
// Used in build.sbt
63+
val thisBuildSettings = Seq(
64+
scalaVersion in Global := scalacVersion,
65+
version in Global := dottyVersion,
66+
organization in Global := dottyOrganization,
67+
organizationName in Global := "LAMP/EPFL",
68+
organizationHomepage in Global := Some(url("http://lamp.epfl.ch")),
69+
homepage in Global := Some(url("https://github.com/lampepfl/dotty")),
70+
71+
// scalac options
72+
scalacOptions in Global ++= Seq(
73+
"-feature",
74+
"-deprecation",
75+
"-encoding", "UTF8",
76+
"-language:existentials,higherKinds,implicitConversions"
77+
),
78+
79+
javacOptions in Global ++= Seq("-Xlint:unchecked", "-Xlint:deprecation")
80+
)
8281

8382
/** Enforce 2.11.5. Do not let it be upgraded by dependencies. */
8483
private val overrideScalaVersionSetting =
@@ -124,7 +123,7 @@ object DottyBuild extends Build {
124123
lazy val dotty = project.in(file(".")).
125124
// FIXME: we do not aggregate `bin` because its tests delete jars, thus breaking other tests
126125
aggregate(`dotty-interfaces`, `dotty-library`, `dotty-compiler`, `dotty-doc`, dottySbtBridgeRef,
127-
`scala-library`, `scala-compiler`, `scala-reflect`, `scalap`).
126+
`scala-library`, `scala-compiler`, `scala-reflect`, scalap).
128127
dependsOn(`dotty-compiler`).
129128
dependsOn(`dotty-library`).
130129
settings(
@@ -728,7 +727,7 @@ object DottyInjectedPlugin extends AutoPlugin {
728727
libraryDependencies := Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value)
729728
).
730729
settings(publishing)
731-
lazy val `scalap` = project.
730+
lazy val scalap = project.
732731
settings(
733732
crossPaths := false,
734733
libraryDependencies := Seq("org.scala-lang" % "scalap" % scalaVersion.value)

0 commit comments

Comments
 (0)