Skip to content

Commit 0af8c1e

Browse files
Merge pull request #7953 from dotty-staging/upgrade/sbt-1.3.6
Upgrade to sbt 1.3.6, release sbt-dotty 0.4.0
2 parents e7e364a + 6333954 commit 0af8c1e

File tree

22 files changed

+157
-123
lines changed

22 files changed

+157
-123
lines changed

.drone.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ steps:
2727

2828
- name: test
2929
pull: default
30-
image: lampepfl/dotty:2019-10-17
30+
image: lampepfl/dotty:2020-01-09
3131
depends_on: [ clone ]
3232
commands:
3333
- cp -R . /tmp/1/ && cd /tmp/1/
@@ -36,16 +36,16 @@ steps:
3636

3737
- name: test_bootstrapped
3838
pull: default
39-
image: lampepfl/dotty:2019-10-17
39+
image: lampepfl/dotty:2020-01-09
4040
depends_on: [ clone ]
4141
commands:
4242
- cp -R . /tmp/2/ && cd /tmp/2/
43-
- ./project/scripts/sbt ";dotty-bootstrapped/compile ;dotty-bootstrapped/test ;dotty-staging/test ;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test"
43+
- ./project/scripts/sbt ";dotty-bootstrapped/compile ;dotty-bootstrapped/test ;dotty-staging/test ;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test ;configureIDE"
4444
- ./project/scripts/bootstrapCmdTests
4545

4646
- name: community_build
4747
pull: default
48-
image: lampepfl/dotty:2019-10-17
48+
image: lampepfl/dotty:2020-01-09
4949
depends_on: [ clone ]
5050
commands:
5151
- cp -R . /tmp/3/ && cd /tmp/3/
@@ -55,7 +55,7 @@ steps:
5555

5656
- name: test_sbt
5757
pull: default
58-
image: lampepfl/dotty:2019-10-17
58+
image: lampepfl/dotty:2020-01-09
5959
depends_on: [ clone ]
6060
commands:
6161
- cp -R . /tmp/4/ && cd /tmp/4/
@@ -67,7 +67,7 @@ steps:
6767

6868
- name: test_java11
6969
pull: default
70-
image: lampepfl/dotty:2019-10-17
70+
image: lampepfl/dotty:2020-01-09
7171
depends_on: [ clone ]
7272
commands:
7373
- export PATH="/usr/lib/jvm/java-11-openjdk-amd64/bin:$PATH"
@@ -80,7 +80,7 @@ steps:
8080

8181
- name: documentation
8282
pull: default
83-
image: lampepfl/dotty:2019-10-17
83+
image: lampepfl/dotty:2020-01-09
8484
depends_on:
8585
- test
8686
- test_bootstrapped
@@ -99,7 +99,7 @@ steps:
9999

100100
- name: publish_nightly
101101
pull: default
102-
image: lampepfl/dotty:2019-10-17
102+
image: lampepfl/dotty:2020-01-09
103103
depends_on:
104104
- test
105105
- test_bootstrapped
@@ -126,7 +126,7 @@ steps:
126126

127127
- name: publish_release
128128
pull: default
129-
image: lampepfl/dotty:2019-10-17
129+
image: lampepfl/dotty:2020-01-09
130130
depends_on:
131131
- test
132132
- test_bootstrapped
@@ -169,7 +169,7 @@ steps:
169169

170170
- name: publish_sbt_release
171171
pull: default
172-
image: lampepfl/dotty:2019-10-17
172+
image: lampepfl/dotty:2020-01-09
173173
depends_on:
174174
- test
175175
- test_bootstrapped
Submodule scalap updated 1 file
Submodule stdLib213 updated 2361 files

community-build/project/build.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ final case class SbtCommunityProject(project: String, sbtTestCommand: String,
100100
case Some(ivyHome) => List(s"-Dsbt.ivy.home=$ivyHome")
101101
case _ => Nil
102102
extraSbtArgs ++ sbtProps ++ List(
103-
"-sbt-version", "1.2.7",
103+
"-sbt-version", "1.3.6",
104104
s"--addPluginSbtFile=$sbtPluginFilePath")
105105

106106
object projects

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import org.junit.Assert._
77
import org.junit.Assume._
88
import org.junit.experimental.categories.Category
99

10+
import java.io.File
1011
import java.nio.file._
1112
import java.util.stream.{ Stream => JStream }
1213
import scala.collection.JavaConverters._
@@ -197,45 +198,50 @@ class CompilationTests extends ParallelTesting {
197198
*/
198199
@Test def tastyBootstrap: Unit = {
199200
implicit val testGroup: TestGroup = TestGroup("tastyBootstrap/tests")
201+
val libGroup = TestGroup("tastyBootstrap/lib")
202+
val tastyCoreGroup = TestGroup("tastyBootstrap/tastyCore")
200203
val dotty1Group = TestGroup("tastyBootstrap/dotty1")
201204
val dotty2Group = TestGroup("tastyBootstrap/dotty2")
202-
val libGroup = TestGroup("tastyBootstrap/lib")
203205

204206
// Make sure that the directory is clean
205207
dotty.tools.io.Directory(defaultOutputDir + "tastyBootstrap").deleteRecursively()
206208

207-
val sep = java.io.File.pathSeparator
208-
209209
val opt = TestFlags(
210-
// compile with bootstrapped library on cp:
211-
defaultOutputDir + libGroup + "/src/" + sep +
212-
// as well as bootstrapped compiler:
213-
defaultOutputDir + dotty1Group + "/dotty/" + sep +
214-
// and the other compiler dependenies:
215-
Properties.compilerInterface + sep + Properties.scalaLibrary + sep + Properties.scalaAsm + sep +
216-
Properties.dottyInterfaces + sep + Properties.tastyCore + sep + Properties.jlineTerminal + sep +
217-
Properties.jlineReader,
210+
List(
211+
// compile with bootstrapped library on cp:
212+
defaultOutputDir + libGroup + "/lib/",
213+
// and bootstrapped tasty-core:
214+
defaultOutputDir + tastyCoreGroup + "/tastyCore/",
215+
// as well as bootstrapped compiler:
216+
defaultOutputDir + dotty1Group + "/dotty1/",
217+
// and the other compiler dependencies:
218+
Properties.compilerInterface, Properties.scalaLibrary, Properties.scalaAsm,
219+
Properties.dottyInterfaces, Properties.jlineTerminal, Properties.jlineReader,
220+
).mkString(File.pathSeparator),
218221
Array("-Ycheck-reentrant", "-Yemit-tasty-in-class")
219222
)
220223

221224
val libraryDirs = List(Paths.get("library/src"), Paths.get("library/src-bootstrapped"))
222225
val librarySources = libraryDirs.flatMap(sources(_))
223226

224227
val lib =
225-
compileList("src", librarySources,
228+
compileList("lib", librarySources,
226229
defaultOptions.and("-Ycheck-reentrant",
227230
"-Yerased-terms", // support declaration of scala.compiletime.erasedValue
228231
// "-strict", // TODO: re-enable once we allow : @unchecked in pattern definitions. Right now, lots of narrowing pattern definitions fail.
229232
"-priorityclasspath", defaultOutputDir))(libGroup)
230233

234+
val tastyCoreSources = sources(Paths.get("tasty/src"))
235+
val tastyCore = compileList("tastyCore", tastyCoreSources, opt)(tastyCoreGroup)
236+
231237
val compilerSources = sources(Paths.get("compiler/src"))
232238
val compilerManagedSources = sources(Properties.dottyCompilerManagedSources)
233239

234-
val dotty1 = compileList("dotty", compilerSources ++ compilerManagedSources, opt)(dotty1Group)
235-
val dotty2 = compileList("dotty", compilerSources ++ compilerManagedSources, opt)(dotty2Group)
240+
val dotty1 = compileList("dotty1", compilerSources ++ compilerManagedSources, opt)(dotty1Group)
241+
val dotty2 = compileList("dotty2", compilerSources ++ compilerManagedSources, opt)(dotty2Group)
236242

237243
val tests = {
238-
lib.keepOutput :: dotty1.keepOutput :: aggregateTests(
244+
lib.keepOutput :: tastyCore.keepOutput :: dotty1.keepOutput :: aggregateTests(
239245
dotty2,
240246
compileShallowFilesInDir("compiler/src/dotty/tools", opt),
241247
compileShallowFilesInDir("compiler/src/dotty/tools/dotc", opt),
@@ -255,9 +261,10 @@ class CompilationTests extends ParallelTesting {
255261
}.map(_.checkCompile())
256262

257263
def assertExists(path: String) = assertTrue(Files.exists(Paths.get(path)))
258-
assertExists(s"out/$dotty1Group/dotty/")
259-
assertExists(s"out/$dotty2Group/dotty/")
260-
assertExists(s"out/$libGroup/src/")
264+
assertExists(s"out/$libGroup/lib/")
265+
assertExists(s"out/$tastyCoreGroup/tastyCore/")
266+
assertExists(s"out/$dotty1Group/dotty1/")
267+
assertExists(s"out/$dotty2Group/dotty2/")
261268
compileList("idempotency", List("tests/idempotency/BootstrapChecker.scala", "tests/idempotency/IdempotencyCheck.scala"), defaultOptions).checkRuns()
262269

263270
tests.foreach(_.delete())

project/Build.scala

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,18 @@ object MyScalaJSPlugin extends AutoPlugin {
5454

5555
// Typecheck the Scala.js IR found on the classpath
5656
scalaJSLinkerConfig ~= (_.withCheckIR(true)),
57+
58+
// Exclude all these projects from `configureIDE/launchIDE` since they
59+
// take time to compile, print a bunch of warnings, and are rarely edited.
60+
excludeFromIDE := true
5761
)
5862
}
5963

6064
object Build {
61-
val referenceVersion = "0.21.0-RC1"
65+
val referenceVersion = "0.22.0-bin-20200114-193f7de-NIGHTLY"
6266

6367
val baseVersion = "0.22.0"
64-
val baseSbtDottyVersion = "0.3.5"
68+
val baseSbtDottyVersion = "0.4.0"
6569

6670
// Versions used by the vscode extension to create a new project
6771
// This should be the latest published releases.
@@ -192,6 +196,11 @@ object Build {
192196
state
193197
},
194198

199+
// Turn off the sbt supershell because it can mangle the output of some tasks
200+
// (see https://github.com/sbt/sbt/issues/5122, https://github.com/sbt/sbt/issues/5352)
201+
// and in general I find it more distracting than helpful anyway.
202+
useSuperShell := false,
203+
195204
// Credentials to release to Sonatype
196205
credentials ++= (
197206
for {
@@ -730,16 +739,18 @@ object Build {
730739
case Bootstrapped => `dotty-compiler-bootstrapped`
731740
}
732741

733-
// Settings shared between dotty-library and dotty-library-bootstrapped
742+
// Settings shared between dotty-library, dotty-library-bootstrapped and dotty-library-bootstrappedJS
734743
lazy val dottyLibrarySettings = Seq(
735-
// Needed so that the library sources are visible when `dotty.tools.dotc.core.Definitions#init` is called
736-
scalacOptions in Compile ++= Seq("-sourcepath", (sourceDirectories in Compile).value.map(_.getAbsolutePath).distinct.mkString(File.pathSeparator)),
744+
scalacOptions in Compile ++= Seq(
745+
// Needed so that the library sources are visible when `dotty.tools.dotc.core.Definitions#init` is called
746+
"-sourcepath", (sourceDirectories in Compile).value.map(_.getAbsolutePath).distinct.mkString(File.pathSeparator),
747+
// support declaration of scala.compiletime.erasedValue
748+
"-Yerased-terms"
749+
),
737750
)
738751

739752
lazy val `dotty-library` = project.in(file("library")).asDottyLibrary(NonBootstrapped)
740753
lazy val `dotty-library-bootstrapped`: Project = project.in(file("library")).asDottyLibrary(Bootstrapped)
741-
// TODO: move -Yerased-terms to dottyLibrarySettings on reference compiler update
742-
.settings(scalacOptions in Compile += "-Yerased-terms") // support declaration of scala.compiletime.erasedValue
743754

744755
def dottyLibrary(implicit mode: Mode): Project = mode match {
745756
case NonBootstrapped => `dotty-library`
@@ -761,7 +772,6 @@ object Build {
761772
settings(
762773
unmanagedSourceDirectories in Compile :=
763774
(unmanagedSourceDirectories in (`dotty-library-bootstrapped`, Compile)).value,
764-
scalacOptions += "-Yerased-terms", // support declaration of scala.compiletime.erasedValue
765775
)
766776

767777
lazy val tastyCoreSettings = Seq(
@@ -1109,8 +1119,6 @@ object Build {
11091119
version := "0.1.17-snapshot", // Keep in sync with package.json
11101120
autoScalaLibrary := false,
11111121
publishArtifact := false,
1112-
includeFilter in unmanagedSources := NothingFilter | "*.ts" | "**.json",
1113-
watchSources in Global ++= (unmanagedSources in Compile).value,
11141122
resourceGenerators in Compile += Def.task {
11151123
// Resources that will be copied when bootstrapping a new project
11161124
val buildSbtFile = baseDirectory.value / "out" / "build.sbt"

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.2.7
1+
sbt.version=1.3.6
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
scalaVersion := sys.props("plugin.scalaVersion")
2+
3+
libraryDependencies += "ch.epfl.lamp" %% "dotty-staging" % scalaVersion.value
4+
5+
fork := true
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
scalaVersion := sys.props("plugin.scalaVersion")
2+
3+
libraryDependencies += "ch.epfl.lamp" %% "dotty-staging" % scalaVersion.value
4+
5+
fork := false
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import scala.quoted._, staging._
2+
3+
given Toolbox = Toolbox.make(getClass.getClassLoader)
4+
5+
val f: Array[Int] => Int = run {
6+
val stagedSum: Expr[Array[Int] => Int] = '{ (arr: Array[Int]) => 6 }
7+
println(stagedSum.show)
8+
stagedSum
9+
}
10+
11+
object Main {
12+
def main(args: Array[String]): Unit =
13+
f.apply(Array(1, 2, 3)) // Returns 6
14+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
> run
2+
$ copy-file changes/build-no-fork.sbt build.sbt
3+
> reload
4+
> run

sbt-dotty/sbt-test/source-dependencies/relative-source-error/changes/absolute.sbt

Lines changed: 0 additions & 1 deletion
This file was deleted.

sbt-dotty/sbt-test/source-dependencies/relative-source-error/changes/relative.sbt

Lines changed: 0 additions & 1 deletion
This file was deleted.

sbt-dotty/sbt-test/source-dependencies/relative-source-error/project/DottyInjectedPlugin.scala

Lines changed: 0 additions & 12 deletions
This file was deleted.

sbt-dotty/sbt-test/source-dependencies/relative-source-error/src/A.scala

Lines changed: 0 additions & 1 deletion
This file was deleted.

sbt-dotty/sbt-test/source-dependencies/relative-source-error/test

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)