@@ -65,28 +65,23 @@ object Build {
65
65
// Shorthand for compiling a docs site
66
66
lazy val dottydoc = inputKey[Unit ](" run dottydoc" )
67
67
68
- // Used in build.sbt
69
- val thisBuildSettings = Seq (
70
- scalaVersion in Global := scalacVersion,
71
- version in Global := dottyVersion,
72
- organization in Global := dottyOrganization,
73
- organizationName in Global := " LAMP/EPFL" ,
74
- organizationHomepage in Global := Some (url(" http://lamp.epfl.ch" )),
75
- homepage in Global := Some (url(" https://github.com/lampepfl/dotty" )),
76
-
77
- // scalac options
78
- scalacOptions in Global ++= Seq (
68
+ lazy val commonSettings = Seq (
69
+ scalaVersion := scalacVersion,
70
+ version := dottyVersion,
71
+ organization := dottyOrganization,
72
+ organizationName := " LAMP/EPFL" ,
73
+ organizationHomepage := Some (url(" http://lamp.epfl.ch" )),
74
+ homepage := Some (url(" https://github.com/lampepfl/dotty" )),
75
+
76
+ scalacOptions ++= Seq (
79
77
" -feature" ,
80
78
" -deprecation" ,
81
79
" -encoding" , " UTF8" ,
82
80
" -language:existentials,higherKinds,implicitConversions"
83
81
),
84
82
85
- javacOptions in Global ++= Seq (" -Xlint:unchecked" , " -Xlint:deprecation" )
86
- )
83
+ javacOptions ++= Seq (" -Xlint:unchecked" , " -Xlint:deprecation" ),
87
84
88
- // set sources to src/, tests to test/ and resources to resources/
89
- lazy val sourceStructure = Seq (
90
85
scalaSource in Compile := baseDirectory.value / " src" ,
91
86
scalaSource in Test := baseDirectory.value / " test" ,
92
87
javaSource in Compile := baseDirectory.value / " src" ,
@@ -129,6 +124,7 @@ object Build {
129
124
`scala-library`, `scala-compiler`, `scala-reflect`, scalap).
130
125
dependsOn(`dotty-compiler`).
131
126
dependsOn(`dotty-library`).
127
+ settings(commonSettings).
132
128
settings(
133
129
triggeredMessage in ThisBuild := Watched .clearWhenTriggered,
134
130
@@ -140,12 +136,13 @@ object Build {
140
136
// Meta project aggregating all bootstrapped projects
141
137
lazy val `dotty-bootstrapped` = project.
142
138
aggregate(`dotty-library-bootstrapped`, `dotty-compiler-bootstrapped`, `dotty-doc-bootstrapped`).
139
+ settings(commonSettings).
143
140
settings(
144
141
publishArtifact := false
145
142
)
146
143
147
144
lazy val `dotty-interfaces` = project.in(file(" interfaces" )).
148
- settings(sourceStructure ).
145
+ settings(commonSettings ).
149
146
settings(
150
147
// Do not append Scala versions to the generated artifacts
151
148
crossPaths := false ,
@@ -214,19 +211,19 @@ object Build {
214
211
215
212
lazy val `dotty-doc` = project.in(file(" doc-tool" )).
216
213
dependsOn(`dotty-compiler`, `dotty-compiler` % " test->test" ).
217
- settings(sourceStructure ).
214
+ settings(commonSettings ).
218
215
settings(dottyDocSettings).
219
216
settings(publishing)
220
217
221
218
lazy val `dotty-doc-bootstrapped` = project.in(file(" doc-tool" )).
222
219
dependsOn(`dotty-compiler-bootstrapped`, `dotty-compiler-bootstrapped` % " test->test" ).
223
- settings(sourceStructure ).
220
+ settings(commonSettings ).
224
221
settings(commonBootstrappedSettings).
225
222
settings(dottyDocSettings)
226
223
227
224
228
225
lazy val `dotty-bot` = project.in(file(" bot" )).
229
- settings(sourceStructure ).
226
+ settings(commonSettings ).
230
227
settings(
231
228
resourceDirectory in Test := baseDirectory.value / " test" / " resources" ,
232
229
@@ -485,7 +482,7 @@ object Build {
485
482
lazy val `dotty-compiler` = project.in(file(" compiler" )).
486
483
dependsOn(`dotty-interfaces`).
487
484
dependsOn(`dotty-library`).
488
- settings(sourceStructure ).
485
+ settings(commonSettings ).
489
486
settings(dottyCompilerSettings).
490
487
settings(
491
488
// Disable scaladoc generation, it's way too slow and we'll replace it
@@ -507,7 +504,7 @@ object Build {
507
504
508
505
lazy val `dotty-compiler-bootstrapped` = project.in(file(" compiler" )).
509
506
dependsOn(`dotty-library-bootstrapped`).
510
- settings(sourceStructure ).
507
+ settings(commonSettings ).
511
508
settings(commonBootstrappedSettings).
512
509
settings(dottyCompilerSettings).
513
510
settings(
@@ -524,7 +521,7 @@ object Build {
524
521
525
522
/* Contains unit tests for the scripts */
526
523
lazy val `dotty-bin-tests` = project.in(file(" bin" )).
527
- settings(sourceStructure ).
524
+ settings(commonSettings ).
528
525
settings(
529
526
publishArtifact := false ,
530
527
parallelExecution in Test := false ,
@@ -542,12 +539,12 @@ object Build {
542
539
)
543
540
544
541
lazy val `dotty-library` = project.in(file(" library" )).
545
- settings(sourceStructure ).
542
+ settings(commonSettings ).
546
543
settings(dottyLibrarySettings).
547
544
settings(publishing)
548
545
549
546
lazy val `dotty-library-bootstrapped` = project.in(file(" library" )).
550
- settings(sourceStructure ).
547
+ settings(commonSettings ).
551
548
settings(commonBootstrappedSettings).
552
549
settings(dottyLibrarySettings)
553
550
@@ -556,7 +553,7 @@ object Build {
556
553
557
554
lazy val `dotty-sbt-bridge` = project.in(file(" sbt-bridge" )).
558
555
dependsOn(`dotty-compiler`).
559
- settings(sourceStructure ).
556
+ settings(commonSettings ).
560
557
settings(
561
558
cleanSbtBridge := {
562
559
val dottySbtBridgeVersion = version.value
@@ -643,7 +640,7 @@ object DottyInjectedPlugin extends AutoPlugin {
643
640
*/
644
641
lazy val sjsSandbox = project.in(file(" sandbox/scalajs" )).
645
642
enablePlugins(ScalaJSPlugin ).
646
- settings(sourceStructure ).
643
+ settings(commonSettings ).
647
644
settings(
648
645
/* Remove the Scala.js compiler plugin for scalac, and enable the
649
646
* Scala.js back-end of dotty instead.
@@ -676,7 +673,7 @@ object DottyInjectedPlugin extends AutoPlugin {
676
673
677
674
lazy val `dotty-bench` = project.in(file(" bench" )).
678
675
dependsOn(`dotty-compiler` % " compile->test" ).
679
- settings(sourceStructure ).
676
+ settings(commonSettings ).
680
677
settings(
681
678
baseDirectory in (Test ,run) := (baseDirectory in `dotty-compiler`).value,
682
679
@@ -718,6 +715,7 @@ object DottyInjectedPlugin extends AutoPlugin {
718
715
// automatically depend on scalaOrganization.value % "scala-library" % scalaVersion.value
719
716
lazy val `scala-library` = project.
720
717
dependsOn(`dotty-library`).
718
+ settings(commonSettings).
721
719
settings(
722
720
crossPaths := false
723
721
).
@@ -731,17 +729,20 @@ object DottyInjectedPlugin extends AutoPlugin {
731
729
// otherwise users will get compilation errors if they happen to transitively
732
730
// depend on one of these projects.
733
731
lazy val `scala-compiler` = project.
732
+ settings(commonSettings).
734
733
settings(
735
734
crossPaths := false
736
735
).
737
736
settings(publishing)
738
737
lazy val `scala-reflect` = project.
738
+ settings(commonSettings).
739
739
settings(
740
740
crossPaths := false ,
741
741
libraryDependencies := Seq (" org.scala-lang" % " scala-reflect" % scalaVersion.value)
742
742
).
743
743
settings(publishing)
744
744
lazy val scalap = project.
745
+ settings(commonSettings).
745
746
settings(
746
747
crossPaths := false ,
747
748
libraryDependencies := Seq (" org.scala-lang" % " scalap" % scalaVersion.value)
0 commit comments