@@ -66,8 +66,6 @@ object Build {
66
66
lazy val dottydoc = inputKey[Unit ](" run dottydoc" )
67
67
68
68
lazy val commonSettings = publishSettings ++ Seq (
69
- scalaVersion := scalacVersion,
70
- version := dottyVersion,
71
69
organization := dottyOrganization,
72
70
organizationName := " LAMP/EPFL" ,
73
71
organizationHomepage := Some (url(" http://lamp.epfl.ch" )),
@@ -92,11 +90,24 @@ object Build {
92
90
ivyScala ~= (_ map (_ copy (overrideScalaVersion = false )))
93
91
)
94
92
95
- // Settings used by all dotty-compiled projects
96
- lazy val commonBootstrappedSettings = Seq (
93
+ // Settings used for projects compiled only with Scala 2
94
+ lazy val commonScala2Settings = commonSettings ++ Seq (
95
+ version := dottyVersion,
96
+ scalaVersion := scalacVersion
97
+ )
98
+
99
+ // Settings used when compiling dotty using Scala 2
100
+ lazy val commonNonBootstrappedSettings = commonSettings ++ publishSettings ++ Seq (
101
+ version := dottyVersion,
102
+ scalaVersion := scalacVersion
103
+ )
104
+
105
+ // Settings used when compiling dotty with a non-bootstrapped dotty
106
+ lazy val commonBootstrappedSettings = commonSettings ++ Seq (
97
107
EclipseKeys .skipProject := true ,
98
- scalaOrganization := dottyOrganization ,
108
+ version := dottyVersion ,
99
109
scalaVersion := dottyVersion,
110
+ scalaOrganization := dottyOrganization,
100
111
scalaBinaryVersion := " 2.11" ,
101
112
102
113
// sbt gets very unhappy if two projects use the same target
@@ -108,6 +119,18 @@ object Build {
108
119
libraryDependencies += " org.scala-lang" % " scala-library" % scalacVersion
109
120
)
110
121
122
+ // sbt >= 0.13.12 will automatically rewrite transitive dependencies on
123
+ // any version in any organization of scala{-library,-compiler,-reflect,p}
124
+ // to have organization `scalaOrganization` and version `scalaVersion`
125
+ // (see https://github.com/sbt/sbt/pull/2634).
126
+ // This means that we need to provide dummy artefacts for these projects,
127
+ // otherwise users will get compilation errors if they happen to transitively
128
+ // depend on one of these projects.
129
+ lazy val commonDummySettings = commonNonBootstrappedSettings ++ Seq (
130
+ crossPaths := false ,
131
+ libraryDependencies := Seq ()
132
+ )
133
+
111
134
/** Projects -------------------------------------------------------------- */
112
135
113
136
// Needed because the dotty project aggregates dotty-sbt-bridge but dotty-sbt-bridge
@@ -127,7 +150,7 @@ object Build {
127
150
`scala-library`, `scala-compiler`, `scala-reflect`, scalap).
128
151
dependsOn(`dotty-compiler`).
129
152
dependsOn(`dotty-library`).
130
- settings(commonSettings ).
153
+ settings(commonNonBootstrappedSettings ).
131
154
settings(
132
155
triggeredMessage in ThisBuild := Watched .clearWhenTriggered,
133
156
@@ -139,13 +162,13 @@ object Build {
139
162
lazy val `dotty-bootstrapped` = project.
140
163
aggregate(`dotty-library-bootstrapped`, `dotty-compiler-bootstrapped`, `dotty-doc-bootstrapped`,
141
164
dottySbtBridgeBootstrappedRef).
142
- settings(commonSettings ).
165
+ settings(commonBootstrappedSettings ).
143
166
settings(
144
167
publishArtifact := false
145
168
)
146
169
147
170
lazy val `dotty-interfaces` = project.in(file(" interfaces" )).
148
- settings(commonSettings).
171
+ settings(commonScala2Settings). // Java-only project, so this is fine
149
172
settings(
150
173
// Do not append Scala versions to the generated artifacts
151
174
crossPaths := false ,
@@ -213,19 +236,17 @@ object Build {
213
236
214
237
lazy val `dotty-doc` = project.in(file(" doc-tool" )).
215
238
dependsOn(`dotty-compiler`, `dotty-compiler` % " test->test" ).
216
- settings(commonSettings).
217
- settings(dottyDocSettings).
218
- settings(publishSettings)
239
+ settings(commonNonBootstrappedSettings).
240
+ settings(dottyDocSettings)
219
241
220
242
lazy val `dotty-doc-bootstrapped` = project.in(file(" doc-tool" )).
221
243
dependsOn(`dotty-compiler-bootstrapped`, `dotty-compiler-bootstrapped` % " test->test" ).
222
- settings(commonSettings).
223
244
settings(commonBootstrappedSettings).
224
245
settings(dottyDocSettings)
225
246
226
247
227
248
lazy val `dotty-bot` = project.in(file(" bot" )).
228
- settings(commonSettings ).
249
+ settings(commonScala2Settings ).
229
250
settings(
230
251
resourceDirectory in Test := baseDirectory.value / " test" / " resources" ,
231
252
@@ -484,7 +505,7 @@ object Build {
484
505
lazy val `dotty-compiler` = project.in(file(" compiler" )).
485
506
dependsOn(`dotty-interfaces`).
486
507
dependsOn(`dotty-library`).
487
- settings(commonSettings ).
508
+ settings(commonNonBootstrappedSettings ).
488
509
settings(dottyCompilerSettings).
489
510
settings(
490
511
// Disable scaladoc generation, it's way too slow and we'll replace it
@@ -505,7 +526,6 @@ object Build {
505
526
506
527
lazy val `dotty-compiler-bootstrapped` = project.in(file(" compiler" )).
507
528
dependsOn(`dotty-library-bootstrapped`).
508
- settings(commonSettings).
509
529
settings(commonBootstrappedSettings).
510
530
settings(dottyCompilerSettings).
511
531
settings(
@@ -522,7 +542,7 @@ object Build {
522
542
523
543
/* Contains unit tests for the scripts */
524
544
lazy val `dotty-bin-tests` = project.in(file(" bin" )).
525
- settings(commonSettings ).
545
+ settings(commonNonBootstrappedSettings ).
526
546
settings(
527
547
publishArtifact := false ,
528
548
parallelExecution in Test := false ,
@@ -540,12 +560,10 @@ object Build {
540
560
)
541
561
542
562
lazy val `dotty-library` = project.in(file(" library" )).
543
- settings(commonSettings).
544
- settings(dottyLibrarySettings).
545
- settings(publishSettings)
563
+ settings(commonNonBootstrappedSettings).
564
+ settings(dottyLibrarySettings)
546
565
547
566
lazy val `dotty-library-bootstrapped` = project.in(file(" library" )).
548
- settings(commonSettings).
549
567
settings(commonBootstrappedSettings).
550
568
settings(dottyLibrarySettings)
551
569
@@ -590,7 +608,7 @@ object Build {
590
608
591
609
lazy val `dotty-sbt-bridge` = project.in(file(" sbt-bridge" )).
592
610
dependsOn(`dotty-compiler`).
593
- settings(commonSettings ).
611
+ settings(commonNonBootstrappedSettings ).
594
612
settings(dottySbtBridgeSettings).
595
613
settings(ScriptedPlugin .scriptedSettings: _* ).
596
614
settings(
@@ -632,7 +650,6 @@ object DottyInjectedPlugin extends AutoPlugin {
632
650
633
651
lazy val `dotty-sbt-bridge-bootstrapped` = project.in(file(" sbt-bridge" )).
634
652
dependsOn(`dotty-compiler-bootstrapped`).
635
- settings(commonSettings).
636
653
settings(commonBootstrappedSettings).
637
654
settings(dottySbtBridgeSettings)
638
655
@@ -648,7 +665,7 @@ object DottyInjectedPlugin extends AutoPlugin {
648
665
*/
649
666
lazy val sjsSandbox = project.in(file(" sandbox/scalajs" )).
650
667
enablePlugins(ScalaJSPlugin ).
651
- settings(commonSettings ).
668
+ settings(commonNonBootstrappedSettings ).
652
669
settings(
653
670
/* Remove the Scala.js compiler plugin for scalac, and enable the
654
671
* Scala.js back-end of dotty instead.
@@ -681,7 +698,7 @@ object DottyInjectedPlugin extends AutoPlugin {
681
698
682
699
lazy val `dotty-bench` = project.in(file(" bench" )).
683
700
dependsOn(`dotty-compiler` % " compile->test" ).
684
- settings(commonSettings ).
701
+ settings(commonNonBootstrappedSettings ).
685
702
settings(
686
703
baseDirectory in (Test ,run) := (baseDirectory in `dotty-compiler`).value,
687
704
@@ -718,39 +735,23 @@ object DottyInjectedPlugin extends AutoPlugin {
718
735
}
719
736
)
720
737
721
-
722
- // Dummy scala-library artefact. This is useful because sbt projects
723
- // automatically depend on scalaOrganization.value % "scala-library" % scalaVersion.value
738
+ // Depend on dotty-library so that sbt projects using dotty automatically
739
+ // depend on the dotty-library
724
740
lazy val `scala-library` = project.
725
741
dependsOn(`dotty-library`).
726
- settings(commonSettings).
727
- settings(
728
- crossPaths := false
729
- )
742
+ settings(commonDummySettings)
730
743
731
- // sbt >= 0.13.12 will automatically rewrite transitive dependencies on
732
- // any version in any organization of scala{-library,-compiler,-reflect,p}
733
- // to have organization `scalaOrganization` and version `scalaVersion`
734
- // (see https://github.com/sbt/sbt/pull/2634).
735
- // This means that we need to provide dummy artefacts for these projects,
736
- // otherwise users will get compilation errors if they happen to transitively
737
- // depend on one of these projects.
738
744
lazy val `scala-compiler` = project.
739
- settings(commonSettings).
740
- settings(
741
- crossPaths := false
742
- )
745
+ settings(commonDummySettings)
743
746
lazy val `scala-reflect` = project.
744
- settings(commonSettings ).
747
+ settings(commonDummySettings ).
745
748
settings(
746
- crossPaths := false ,
747
- libraryDependencies := Seq (" org.scala-lang" % " scala-reflect" % scalaVersion.value)
749
+ libraryDependencies := Seq (" org.scala-lang" % " scala-reflect" % scalacVersion)
748
750
)
749
751
lazy val scalap = project.
750
- settings(commonSettings ).
752
+ settings(commonDummySettings ).
751
753
settings(
752
- crossPaths := false ,
753
- libraryDependencies := Seq (" org.scala-lang" % " scalap" % scalaVersion.value)
754
+ libraryDependencies := Seq (" org.scala-lang" % " scalap" % scalacVersion)
754
755
)
755
756
756
757
lazy val publishSettings = Seq (
0 commit comments