From 7d2abb80530fb548dca64e06b3ac23ea247afe79 Mon Sep 17 00:00:00 2001 From: Anatolii Kmetiuk Date: Wed, 30 Sep 2020 11:51:35 +0200 Subject: [PATCH 01/13] All artefacts renamed from dotty to scala3 packArchiveName changed to scala3- Correctly name SBT plugin Update Windows CI to use the new naming scheme --- .github/workflows/ci.yaml | 8 +- .gitignore | 2 +- build.sbt | 40 +++---- project/Build.scala | 244 +++++++++++++++++++------------------- 4 files changed, 147 insertions(+), 147 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5fb2668612e3..d736dae30718 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -93,7 +93,7 @@ jobs: - name: Test run: | - ./project/scripts/sbt ";dotty-bootstrapped/compile ;dotty-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;sbt-dotty/scripted scala2-compat/* ;configureIDE" + ./project/scripts/sbt ";scala3-bootstrapped/compile ;scala3-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;sbt-dotty/scripted scala2-compat/* ;configureIDE" ./project/scripts/bootstrapCmdTests @@ -116,7 +116,7 @@ jobs: uses: actions/checkout@v2 - name: Test - run: sbt ";dotty-bootstrapped/compile ;dotty-bootstrapped/test" + run: sbt ";scala3-bootstrapped/compile ;scala3-bootstrapped/test" shell: cmd - name: Scala.js Test @@ -298,7 +298,7 @@ jobs: - name: Publish Nightly run: | - ./project/scripts/sbtPublish ";project dotty-bootstrapped ;publishSigned ;sonatypeBundleRelease" + ./project/scripts/sbtPublish ";project scala3-bootstrapped ;publishSigned ;sonatypeBundleRelease" nightly_documentation: runs-on: [self-hosted, Linux] @@ -404,7 +404,7 @@ jobs: run: | ./project/scripts/sbt dist/packArchive sha256sum dist/target/dotty-* > dist/target/sha256sum.txt - ./project/scripts/sbtPublish ";project dotty-bootstrapped ;publishSigned ;sonatypeBundleRelease" + ./project/scripts/sbtPublish ";project scala3-bootstrapped ;publishSigned ;sonatypeBundleRelease" echo "name=RELEASE_TAG::${GITHUB_REF#*refs/tags/}" >> $GITHUB_ENV - name: Create GitHub Release diff --git a/.gitignore b/.gitignore index 11c3fb13d43f..132f395821d9 100644 --- a/.gitignore +++ b/.gitignore @@ -82,7 +82,7 @@ bench/compile.txt # The vscode app for testing vscode-dotty/.vscode-test -community-build/dotty-bootstrapped.version +community-build/scala3-bootstrapped.version community-build/sbt-dotty-sbt # Vulpix output files diff --git a/build.sbt b/build.sbt index 28559cb1c4a9..01c513c6d465 100644 --- a/build.sbt +++ b/build.sbt @@ -1,26 +1,26 @@ -val dotty = Build.dotty -val `dotty-bootstrapped` = Build.`dotty-bootstrapped` -val `dotty-interfaces` = Build.`dotty-interfaces` -val `dotty-doc` = Build.`dotty-doc` -val `dotty-doc-bootstrapped` = Build.`dotty-doc-bootstrapped` -val `dotty-compiler` = Build.`dotty-compiler` -val `dotty-compiler-bootstrapped` = Build.`dotty-compiler-bootstrapped` -val `dotty-library` = Build.`dotty-library` -val `dotty-library-bootstrapped` = Build.`dotty-library-bootstrapped` -val `dotty-library-bootstrappedJS` = Build.`dotty-library-bootstrappedJS` -val `dotty-sbt-bridge` = Build.`dotty-sbt-bridge` -val `dotty-sbt-bridge-tests` = Build.`dotty-sbt-bridge-tests` -val `dotty-staging` = Build.`dotty-staging` -val `dotty-tasty-inspector` = Build.`dotty-tasty-inspector` -val `dotty-language-server` = Build.`dotty-language-server` -val `dotty-bench` = Build.`dotty-bench` -val `dotty-bench-bootstrapped` = Build.`dotty-bench-bootstrapped` +val scala3 = Build.scala3 +val `scala3-bootstrapped` = Build.`scala3-bootstrapped` +val `scala3-interfaces` = Build.`scala3-interfaces` +val `scala3-doc` = Build.`scala3-doc` +val `scala3-doc-bootstrapped` = Build.`scala3-doc-bootstrapped` +val `scala3-compiler` = Build.`scala3-compiler` +val `scala3-compiler-bootstrapped` = Build.`scala3-compiler-bootstrapped` +val `scala3-library` = Build.`scala3-library` +val `scala3-library-bootstrapped` = Build.`scala3-library-bootstrapped` +val `scala3-library-bootstrappedJS` = Build.`scala3-library-bootstrappedJS` +val `scala3-sbt-bridge` = Build.`scala3-sbt-bridge` +val `scala3-sbt-bridge-tests` = Build.`scala3-sbt-bridge-tests` +val `scala3-staging` = Build.`scala3-staging` +val `scala3-tasty-inspector` = Build.`scala3-tasty-inspector` +val `scala3-language-server` = Build.`scala3-language-server` +val `scala3-bench` = Build.`scala3-bench` +val `scala3-bench-bootstrapped` = Build.`scala3-bench-bootstrapped` val `tasty-core` = Build.`tasty-core` val `tasty-core-bootstrapped` = Build.`tasty-core-bootstrapped` val `tasty-core-scala2` = Build.`tasty-core-scala2` -val `dotty-tastydoc` = Build.`dotty-tastydoc` -val `dotty-tastydoc-input` = Build.`dotty-tastydoc-input` -val `dotty-bench-run` = Build.`dotty-bench-run` +val `scala3-tastydoc` = Build.`scala3-tastydoc` +val `scala3-tastydoc-input` = Build.`scala3-tastydoc-input` +val `scala3-bench-run` = Build.`scala3-bench-run` val `scala-library` = Build.`scala-library` val `scala-compiler` = Build.`scala-compiler` val `scala-reflect` = Build.`scala-reflect` diff --git a/project/Build.scala b/project/Build.scala index 10a29512152e..1d1009d751c7 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -76,7 +76,7 @@ object Build { case Bootstrapped => "2.13.3" } - val dottyOrganization = "ch.epfl.lamp" + val dottyOrganization = "org.scala-lang" val dottyGithubUrl = "https://github.com/lampepfl/dotty" @@ -158,7 +158,7 @@ object Build { // Override `runCode` from sbt-dotty to use the language-server and // vscode extension from the source repository of dotty instead of a // published version. - runCode := (run in `dotty-language-server`).toTask("").value, + runCode := (run in `scala3-language-server`).toTask("").value, // Avoid various sbt craziness involving classloaders and parallelism fork in run := true, @@ -277,19 +277,19 @@ object Build { scalaVersion := dottyNonBootstrappedVersion, scalaCompilerBridgeBinaryJar := { - Some((packageBin in (`dotty-sbt-bridge`, Compile)).value) + Some((packageBin in (`scala3-sbt-bridge`, Compile)).value) }, // Use the same name as the non-bootstrapped projects for the artifacts. // Remove the `js` suffix because JS artifacts are published using their special crossVersion. // The order of the two `stripSuffix`es is important, so that - // dotty-library-bootstrappedjs becomes dotty-library. + // scala3-library-bootstrappedjs becomes scala3-library. moduleName ~= { _.stripSuffix("js").stripSuffix("-bootstrapped") }, // Enforce that the only Scala 2 classfiles we unpickle come from scala-library /* scalacOptions ++= { - val cp = (dependencyClasspath in `dotty-library` in Compile).value + val cp = (dependencyClasspath in `scala3-library` in Compile).value val scalaLib = findArtifactPath(cp, "scala-library") Seq("-Yscala2-unpickler", scalaLib) }, @@ -301,7 +301,7 @@ object Build { // Compile using the non-bootstrapped and non-published dotty managedScalaInstance := false, scalaInstance := { - val externalNonBootstrappedDeps = externalDependencyClasspath.in(`dotty-doc`, Compile).value + val externalNonBootstrappedDeps = externalDependencyClasspath.in(`scala3-doc`, Compile).value val scalaLibrary = findArtifact(externalNonBootstrappedDeps, "scala-library") // IMPORTANT: We need to use actual jars to form the ScalaInstance and not @@ -310,10 +310,10 @@ object Build { // however this is only implemented on jars, directories are never // invalidated. val tastyCore = packageBin.in(`tasty-core`, Compile).value - val dottyLibrary = packageBin.in(`dotty-library`, Compile).value - val dottyInterfaces = packageBin.in(`dotty-interfaces`, Compile).value - val dottyCompiler = packageBin.in(`dotty-compiler`, Compile).value - val dottyDoc = packageBin.in(`dotty-doc`, Compile).value + val dottyLibrary = packageBin.in(`scala3-library`, Compile).value + val dottyInterfaces = packageBin.in(`scala3-interfaces`, Compile).value + val dottyCompiler = packageBin.in(`scala3-compiler`, Compile).value + val dottyDoc = packageBin.in(`scala3-doc`, Compile).value val allJars = Seq(tastyCore, dottyLibrary, dottyInterfaces, dottyCompiler, dottyDoc) ++ externalNonBootstrappedDeps.map(_.data) @@ -332,8 +332,8 @@ object Build { lazy val commonBenchmarkSettings = Seq( mainClass in (Jmh, run) := Some("dotty.tools.benchmarks.Bench"), // custom main for jmh:run - javaOptions += "-DBENCH_COMPILER_CLASS_PATH=" + Attributed.data((fullClasspath in (`dotty-bootstrapped`, Compile)).value).mkString("", File.pathSeparator, ""), - javaOptions += "-DBENCH_CLASS_PATH=" + Attributed.data((fullClasspath in (`dotty-library-bootstrapped`, Compile)).value).mkString("", File.pathSeparator, "") + javaOptions += "-DBENCH_COMPILER_CLASS_PATH=" + Attributed.data((fullClasspath in (`scala3-bootstrapped`, Compile)).value).mkString("", File.pathSeparator, ""), + javaOptions += "-DBENCH_CLASS_PATH=" + Attributed.data((fullClasspath in (`scala3-library-bootstrapped`, Compile)).value).mkString("", File.pathSeparator, "") ) // sbt >= 0.13.12 will automatically rewrite transitive dependencies on @@ -350,7 +350,7 @@ object Build { /** Projects -------------------------------------------------------------- */ - val dottyCompilerBootstrappedRef = LocalProject("dotty-compiler-bootstrapped") + val dottyCompilerBootstrappedRef = LocalProject("scala3-compiler-bootstrapped") /** External dependencies we may want to put on the compiler classpath. */ def externalCompilerClasspathTask: Def.Initialize[Task[Def.Classpath]] = @@ -361,17 +361,17 @@ object Build { // The root project: // - aggregates other projects so that "compile", "test", etc are run on all projects at once. - // - publishes its own empty artifact "dotty" that depends on "dotty-library" and "dotty-compiler", + // - publishes its own empty artifact "dotty" that depends on "scala3-library" and "scala3-compiler", // this is only necessary for compatibility with sbt which currently hardcodes the "dotty" artifact name - lazy val dotty = project.in(file(".")).asDottyRoot(NonBootstrapped) - lazy val `dotty-bootstrapped` = project.asDottyRoot(Bootstrapped) + lazy val scala3 = project.in(file(".")).asDottyRoot(NonBootstrapped) + lazy val `scala3-bootstrapped` = project.asDottyRoot(Bootstrapped) - lazy val `dotty-interfaces` = project.in(file("interfaces")). + lazy val `scala3-interfaces` = project.in(file("interfaces")). settings(commonJavaSettings) private lazy val dottydocClasspath = Def.task { - val jars = (packageAll in `dotty-compiler`).value - val dottyLib = jars("dotty-library") + val jars = (packageAll in `scala3-compiler`).value + val dottyLib = jars("scala3-library") val otherDeps = (dependencyClasspath in Compile).value.map(_.data).mkString(File.pathSeparator) val externalDeps = externalCompilerClasspathTask.value dottyLib + File.pathSeparator + findArtifactPath(externalDeps, "scala-library") @@ -400,7 +400,7 @@ object Build { def dottyDocSettings(implicit mode: Mode) = Seq( connectInput in run := true, - javaOptions ++= (javaOptions in `dotty-compiler`).value, + javaOptions ++= (javaOptions in `scala3-compiler`).value, javaOptions += "-Xss3m", @@ -421,7 +421,7 @@ object Build { "-project", "Dotty", "-project-version", dottyVersion, "-project-url", dottyGithubUrl, - "-project-logo", "dotty-logo.svg", + "-project-logo", "scala3-logo.svg", "-classpath", dottydocClasspath.value, "-Yerased-terms" ) ++ dottydocExtraArgs @@ -438,12 +438,12 @@ object Build { }.evaluated, ) - lazy val `dotty-doc` = project.in(file("doc-tool")).asDottyDoc(NonBootstrapped) - lazy val `dotty-doc-bootstrapped` = project.in(file("doc-tool")).asDottyDoc(Bootstrapped) + lazy val `scala3-doc` = project.in(file("doc-tool")).asDottyDoc(NonBootstrapped) + lazy val `scala3-doc-bootstrapped` = project.in(file("doc-tool")).asDottyDoc(Bootstrapped) def dottyDoc(implicit mode: Mode): Project = mode match { - case NonBootstrapped => `dotty-doc` - case Bootstrapped => `dotty-doc-bootstrapped` + case NonBootstrapped => `scala3-doc` + case Bootstrapped => `scala3-doc-bootstrapped` } /** Find an artifact with the given `name` in `classpath` */ @@ -456,7 +456,7 @@ object Build { def findArtifactPath(classpath: Def.Classpath, name: String): String = findArtifact(classpath, name).getAbsolutePath - // Settings shared between dotty-compiler and dotty-compiler-bootstrapped + // Settings shared between scala3-compiler and scala3-compiler-bootstrapped lazy val commonDottyCompilerSettings = Seq( // set system in/out for repl connectInput in run := true, @@ -523,9 +523,9 @@ object Build { Seq( "-Ddotty.tests.dottyCompilerManagedSources=" + managedSrcDir, - "-Ddotty.tests.classes.dottyInterfaces=" + jars("dotty-interfaces"), - "-Ddotty.tests.classes.dottyLibrary=" + jars("dotty-library"), - "-Ddotty.tests.classes.dottyCompiler=" + jars("dotty-compiler"), + "-Ddotty.tests.classes.dottyInterfaces=" + jars("scala3-interfaces"), + "-Ddotty.tests.classes.dottyLibrary=" + jars("scala3-library"), + "-Ddotty.tests.classes.dottyCompiler=" + jars("scala3-compiler"), "-Ddotty.tests.classes.tastyCore=" + jars("tasty-core"), "-Ddotty.tests.classes.compilerInterface=" + findArtifactPath(externalDeps, "compiler-interface"), "-Ddotty.tests.classes.scalaLibrary=" + findArtifactPath(externalDeps, "scala-library"), @@ -575,7 +575,7 @@ object Build { val jars = packageAll.value val scalaLib = findArtifactPath(externalDeps, "scala-library") - val dottyLib = jars("dotty-library") + val dottyLib = jars("scala3-library") def run(args: List[String]): Unit = { val fullArgs = insertClasspathInArgs(args, List(".", dottyLib, scalaLib).mkString(File.pathSeparator)) @@ -589,10 +589,10 @@ object Build { } else if (args.contains("-with-compiler")) { val args1 = args.filter(_ != "-with-compiler") val asm = findArtifactPath(externalDeps, "scala-asm") - val dottyCompiler = jars("dotty-compiler") - val dottyStaging = jars("dotty-staging") - val dottyTastyInspector = jars("dotty-tasty-inspector") - val dottyInterfaces = jars("dotty-interfaces") + val dottyCompiler = jars("scala3-compiler") + val dottyStaging = jars("scala3-staging") + val dottyTastyInspector = jars("scala3-tasty-inspector") + val dottyInterfaces = jars("scala3-interfaces") val tastyCore = jars("tasty-core") run(insertClasspathInArgs(args1, List(dottyCompiler, dottyInterfaces, asm, dottyStaging, dottyTastyInspector, tastyCore).mkString(File.pathSeparator))) } else run(args) @@ -642,8 +642,8 @@ object Build { val externalDeps = externalCompilerClasspathTask.value val jars = packageAll.value val scalaLib = findArtifactPath(externalDeps, "scala-library") - val dottyLib = jars("dotty-library") - val dottyCompiler = jars("dotty-compiler") + val dottyLib = jars("scala3-library") + val dottyCompiler = jars("scala3-compiler") val args0: List[String] = spaceDelimited("").parsed.toList val decompile = args0.contains("-decompile") val printTasty = args0.contains("-print-tasty") @@ -666,9 +666,9 @@ object Build { if (scalaVersion.value == referenceVersion) { log.error("-with-compiler should only be used with a bootstrapped compiler") } - val dottyInterfaces = jars("dotty-interfaces") - val dottyStaging = jars("dotty-staging") - val dottyTastyInspector = jars("dotty-tasty-inspector") + val dottyInterfaces = jars("scala3-interfaces") + val dottyStaging = jars("scala3-staging") + val dottyTastyInspector = jars("scala3-tasty-inspector") val tastyCore = jars("tasty-core") val asm = findArtifactPath(externalDeps, "scala-asm") extraClasspath ++= Seq(dottyCompiler, dottyInterfaces, asm, dottyStaging, dottyTastyInspector, tastyCore) @@ -690,15 +690,15 @@ object Build { packageAll := Def.taskDyn { // Use a dynamic task to avoid loops when loading the settings Def.task { Map( - "dotty-interfaces" -> packageBin.in(`dotty-interfaces`, Compile).value, - "dotty-compiler" -> packageBin.in(Compile).value, + "scala3-interfaces" -> packageBin.in(`scala3-interfaces`, Compile).value, + "scala3-compiler" -> packageBin.in(Compile).value, "tasty-core" -> packageBin.in(`tasty-core`, Compile).value, - // NOTE: Using dotty-library-bootstrapped here is intentional: when + // NOTE: Using scala3-library-bootstrapped here is intentional: when // running the compiler, we should always have the bootstrapped // library on the compiler classpath since the non-bootstrapped one // may not be binary-compatible. - "dotty-library" -> packageBin.in(`dotty-library-bootstrapped`, Compile).value + "scala3-library" -> packageBin.in(`scala3-library-bootstrapped`, Compile).value ).mapValues(_.getAbsolutePath) } }.value, @@ -716,15 +716,15 @@ object Build { javaOptions ++= { val jars = packageAll.value Seq( - "-Ddotty.tests.classes.dottyStaging=" + jars("dotty-staging"), - "-Ddotty.tests.classes.dottyTastyInspector=" + jars("dotty-tasty-inspector"), + "-Ddotty.tests.classes.dottyStaging=" + jars("scala3-staging"), + "-Ddotty.tests.classes.dottyTastyInspector=" + jars("scala3-tasty-inspector"), ) }, packageAll := { - packageAll.in(`dotty-compiler`).value ++ Seq( - "dotty-compiler" -> packageBin.in(Compile).value.getAbsolutePath, - "dotty-staging" -> packageBin.in(LocalProject("dotty-staging"), Compile).value.getAbsolutePath, - "dotty-tasty-inspector" -> packageBin.in(LocalProject("dotty-tasty-inspector"), Compile).value.getAbsolutePath, + packageAll.in(`scala3-compiler`).value ++ Seq( + "scala3-compiler" -> packageBin.in(Compile).value.getAbsolutePath, + "scala3-staging" -> packageBin.in(LocalProject("scala3-staging"), Compile).value.getAbsolutePath, + "scala3-tasty-inspector" -> packageBin.in(LocalProject("scala3-tasty-inspector"), Compile).value.getAbsolutePath, "tasty-core" -> packageBin.in(LocalProject("tasty-core-bootstrapped"), Compile).value.getAbsolutePath, ) } @@ -733,15 +733,15 @@ object Build { def dottyCompilerSettings(implicit mode: Mode): sbt.Def.SettingsDefinition = if (mode == NonBootstrapped) nonBootstrapedDottyCompilerSettings else bootstrapedDottyCompilerSettings - lazy val `dotty-compiler` = project.in(file("compiler")).asDottyCompiler(NonBootstrapped) - lazy val `dotty-compiler-bootstrapped` = project.in(file("compiler")).asDottyCompiler(Bootstrapped) + lazy val `scala3-compiler` = project.in(file("compiler")).asDottyCompiler(NonBootstrapped) + lazy val `scala3-compiler-bootstrapped` = project.in(file("compiler")).asDottyCompiler(Bootstrapped) def dottyCompiler(implicit mode: Mode): Project = mode match { - case NonBootstrapped => `dotty-compiler` - case Bootstrapped => `dotty-compiler-bootstrapped` + case NonBootstrapped => `scala3-compiler` + case Bootstrapped => `scala3-compiler-bootstrapped` } - // Settings shared between dotty-library, dotty-library-bootstrapped and dotty-library-bootstrappedJS + // Settings shared between scala3-library, scala3-library-bootstrapped and scala3-library-bootstrappedJS lazy val dottyLibrarySettings = Seq( scalacOptions in Compile ++= Seq( // Needed so that the library sources are visible when `dotty.tools.dotc.core.Definitions#init` is called @@ -751,12 +751,12 @@ object Build { ), ) - lazy val `dotty-library` = project.in(file("library")).asDottyLibrary(NonBootstrapped) - lazy val `dotty-library-bootstrapped`: Project = project.in(file("library")).asDottyLibrary(Bootstrapped) + lazy val `scala3-library` = project.in(file("library")).asDottyLibrary(NonBootstrapped) + lazy val `scala3-library-bootstrapped`: Project = project.in(file("library")).asDottyLibrary(Bootstrapped) def dottyLibrary(implicit mode: Mode): Project = mode match { - case NonBootstrapped => `dotty-library` - case Bootstrapped => `dotty-library-bootstrapped` + case NonBootstrapped => `scala3-library` + case Bootstrapped => `scala3-library-bootstrapped` } /** The dotty standard library compiled with the Scala.js back-end, to produce @@ -768,16 +768,16 @@ object Build { * included in this project, and hence available to Dotty.js projects. More * will be added in the future as things are confirmed to be supported. */ - lazy val `dotty-library-bootstrappedJS`: Project = project.in(file("library-js")). + lazy val `scala3-library-bootstrappedJS`: Project = project.in(file("library-js")). asDottyLibrary(Bootstrapped). enablePlugins(MyScalaJSPlugin). settings( libraryDependencies += ("org.scala-js" %% "scalajs-library" % scalaJSVersion).withDottyCompat(scalaVersion.value), unmanagedSourceDirectories in Compile := - (unmanagedSourceDirectories in (`dotty-library-bootstrapped`, Compile)).value, + (unmanagedSourceDirectories in (`scala3-library-bootstrapped`, Compile)).value, - // Make sure `dotty-bootstrapped/test` doesn't fail on this project for no reason + // Make sure `scala3-bootstrapped/test` doesn't fail on this project for no reason test in Test := {}, testOnly in Test := {}, ) @@ -795,29 +795,29 @@ object Build { case Bootstrapped => `tasty-core-bootstrapped` } - lazy val `dotty-staging` = project.in(file("staging")). + lazy val `scala3-staging` = project.in(file("staging")). withCommonSettings(Bootstrapped). // We want the compiler to be present in the compiler classpath when compiling this project but not - // when compiling a project that depends on dotty-staging (see sbt-dotty/sbt-test/sbt-dotty/quoted-example-project), + // when compiling a project that depends on scala3-staging (see sbt-dotty/sbt-test/sbt-dotty/quoted-example-project), // but we always need it to be present on the JVM classpath at runtime. dependsOn(dottyCompiler(Bootstrapped) % "provided; compile->runtime; test->test"). settings(commonBootstrappedSettings). settings( - javaOptions := (javaOptions in `dotty-compiler-bootstrapped`).value + javaOptions := (javaOptions in `scala3-compiler-bootstrapped`).value ) - lazy val `dotty-tasty-inspector` = project.in(file("tasty-inspector")). + lazy val `scala3-tasty-inspector` = project.in(file("tasty-inspector")). withCommonSettings(Bootstrapped). // We want the compiler to be present in the compiler classpath when compiling this project but not - // when compiling a project that depends on dotty-tasty-inspector (see sbt-dotty/sbt-test/sbt-dotty/tasty-inspector-example-project), + // when compiling a project that depends on scala3-tasty-inspector (see sbt-dotty/sbt-test/sbt-dotty/tasty-inspector-example-project), // but we always need it to be present on the JVM classpath at runtime. dependsOn(dottyCompiler(Bootstrapped) % "provided; compile->runtime; test->test"). settings(commonBootstrappedSettings). settings( - javaOptions := (javaOptions in `dotty-compiler-bootstrapped`).value + javaOptions := (javaOptions in `scala3-compiler-bootstrapped`).value ) - lazy val `dotty-sbt-bridge` = project.in(file("sbt-bridge/src")). + lazy val `scala3-sbt-bridge` = project.in(file("sbt-bridge/src")). // We cannot depend on any bootstrapped project to compile the bridge, since the // bridge is needed to compile these projects. dependsOn(dottyDoc(NonBootstrapped) % Provided). @@ -831,14 +831,14 @@ object Build { // Referring to the other project using a string avoids an infinite loop // when sbt reads the settings. - test in Test := (test in (LocalProject("dotty-sbt-bridge-tests"), Test)).value, + test in Test := (test in (LocalProject("scala3-sbt-bridge-tests"), Test)).value, libraryDependencies += Dependencies.`compiler-interface` % Provided ) // We use a separate project for the bridge tests since they can only be run // with the bootstrapped library on the classpath. - lazy val `dotty-sbt-bridge-tests` = project.in(file("sbt-bridge/test")). + lazy val `scala3-sbt-bridge-tests` = project.in(file("sbt-bridge/test")). dependsOn(dottyCompiler(Bootstrapped) % Test). settings(commonBootstrappedSettings). settings( @@ -852,7 +852,7 @@ object Build { // libraryDependencies += (Dependencies.`zinc-api-info` % Test).withDottyCompat(scalaVersion.value) ) - lazy val `dotty-language-server` = project.in(file("language-server")). + lazy val `scala3-language-server` = project.in(file("language-server")). dependsOn(dottyCompiler(Bootstrapped)). settings(commonBootstrappedSettings). settings( @@ -866,7 +866,7 @@ object Build { ), // Work around https://github.com/eclipse/lsp4j/issues/295 dependencyOverrides += "org.eclipse.xtend" % "org.eclipse.xtend.lib" % "2.16.0", - javaOptions := (javaOptions in `dotty-compiler-bootstrapped`).value, + javaOptions := (javaOptions in `scala3-compiler-bootstrapped`).value, run := Def.inputTaskDyn { val inputArgs = spaceDelimited("").parsed @@ -886,12 +886,12 @@ object Build { }.dependsOn(compile in (`vscode-dotty`, Compile)).evaluated ). settings( - ideTestsCompilerVersion := (version in `dotty-compiler`).value, + ideTestsCompilerVersion := (version in `scala3-compiler`).value, ideTestsCompilerArguments := Seq(), ideTestsDependencyClasspath := { - val dottyLib = (classDirectory in `dotty-library-bootstrapped` in Compile).value + val dottyLib = (classDirectory in `scala3-library-bootstrapped` in Compile).value val scalaLib = - (dependencyClasspath in `dotty-library-bootstrapped` in Compile) + (dependencyClasspath in `scala3-library-bootstrapped` in Compile) .value .map(_.data) .filter(_.getName.matches("scala-library.*\\.jar")) @@ -919,7 +919,7 @@ object Build { */ lazy val sjsSandbox = project.in(file("sandbox/scalajs")). enablePlugins(MyScalaJSPlugin). - dependsOn(`dotty-library-bootstrappedJS`). + dependsOn(`scala3-library-bootstrappedJS`). settings( // Required to run Scala.js tests. fork in Test := false, @@ -936,7 +936,7 @@ object Build { */ lazy val sjsJUnitTests = project.in(file("tests/sjs-junit")). enablePlugins(MyScalaJSPlugin). - dependsOn(`dotty-library-bootstrappedJS`). + dependsOn(`scala3-library-bootstrappedJS`). settings( scalacOptions --= Seq("-Xfatal-warnings", "-deprecation"), @@ -1074,17 +1074,17 @@ object Build { ) lazy val sjsCompilerTests = project.in(file("sjs-compiler-tests")). - dependsOn(`dotty-compiler` % "test->test"). + dependsOn(`scala3-compiler` % "test->test"). settings( commonNonBootstrappedSettings, // Change the baseDirectory when running the tests baseDirectory in Test := baseDirectory.value.getParentFile, - javaOptions ++= (javaOptions in `dotty-compiler`).value, + javaOptions ++= (javaOptions in `scala3-compiler`).value, javaOptions ++= { - val externalJSDeps = (externalDependencyClasspath in (`dotty-library-bootstrappedJS`, Compile)).value - val dottyLibraryJSJar = (packageBin in (`dotty-library-bootstrappedJS`, Compile)).value.getAbsolutePath + val externalJSDeps = (externalDependencyClasspath in (`scala3-library-bootstrappedJS`, Compile)).value + val dottyLibraryJSJar = (packageBin in (`scala3-library-bootstrappedJS`, Compile)).value.getAbsolutePath Seq( "-Ddotty.tests.classes.dottyLibraryJS=" + dottyLibraryJSJar, @@ -1093,21 +1093,21 @@ object Build { }, ) - lazy val `dotty-bench` = project.in(file("bench")).asDottyBench(NonBootstrapped) - lazy val `dotty-bench-bootstrapped` = project.in(file("bench")).asDottyBench(Bootstrapped) - lazy val `dotty-bench-run` = project.in(file("bench-run")).asDottyBench(Bootstrapped) + lazy val `scala3-bench` = project.in(file("bench")).asDottyBench(NonBootstrapped) + lazy val `scala3-bench-bootstrapped` = project.in(file("bench")).asDottyBench(Bootstrapped) + lazy val `scala3-bench-run` = project.in(file("bench-run")).asDottyBench(Bootstrapped) - lazy val `dotty-tastydoc` = project.in(file("tastydoc")).asDottyTastydoc(Bootstrapped) - lazy val `dotty-tastydoc-input` = project.in(file("tastydoc/input")).asDottyTastydocInput(Bootstrapped) + lazy val `scala3-tastydoc` = project.in(file("tastydoc")).asDottyTastydoc(Bootstrapped) + lazy val `scala3-tastydoc-input` = project.in(file("tastydoc/input")).asDottyTastydocInput(Bootstrapped) - // Depend on dotty-library so that sbt projects using dotty automatically - // depend on the dotty-library + // Depend on scala3-library so that sbt projects using dotty automatically + // depend on the scala3-library lazy val `scala-library` = project. - dependsOn(`dotty-library-bootstrapped`). + dependsOn(`scala3-library-bootstrapped`). settings(commonDummySettings). settings( // Need a direct dependency on the real scala-library even though we indirectly - // depend on it via dotty-library, because sbt may rewrite dependencies + // depend on it via scala3-library, because sbt may rewrite dependencies // (see https://github.com/sbt/sbt/pull/2634), but won't rewrite the direct // dependencies of scala-library (see https://github.com/sbt/sbt/pull/2897) libraryDependencies += "org.scala-lang" % "scala-library" % stdlibVersion(Bootstrapped) @@ -1128,7 +1128,7 @@ object Build { // sbt plugin to use Dotty in your own build, see - // https://github.com/lampepfl/dotty-example-project for usage. + // https://github.com/lampepfl/scala3-example-project for usage. lazy val `sbt-dotty` = project.in(file("sbt-dotty")). enablePlugins(SbtPlugin). settings(commonSettings). @@ -1156,18 +1156,18 @@ object Build { }, scriptedBufferLog := true, scripted := scripted.dependsOn( - publishLocal in `dotty-sbt-bridge`, - publishLocal in `dotty-interfaces`, - publishLocal in `dotty-compiler-bootstrapped`, - publishLocal in `dotty-library-bootstrapped`, - publishLocal in `dotty-library-bootstrappedJS`, + publishLocal in `scala3-sbt-bridge`, + publishLocal in `scala3-interfaces`, + publishLocal in `scala3-compiler-bootstrapped`, + publishLocal in `scala3-library-bootstrapped`, + publishLocal in `scala3-library-bootstrappedJS`, publishLocal in `tasty-core-bootstrapped`, - publishLocal in `dotty-staging`, - publishLocal in `dotty-tasty-inspector`, + publishLocal in `scala3-staging`, + publishLocal in `scala3-tasty-inspector`, publishLocal in `scala-library`, publishLocal in `scala-reflect`, - publishLocal in `dotty-doc-bootstrapped`, - publishLocal in `dotty-bootstrapped` // Needed because sbt currently hardcodes the dotty artifact + publishLocal in `scala3-doc-bootstrapped`, + publishLocal in `scala3-bootstrapped` // Needed because sbt currently hardcodes the dotty artifact ).evaluated ) @@ -1182,7 +1182,7 @@ object Build { val buildSbtFile = baseDirectory.value / "out" / "build.sbt" IO.write(buildSbtFile, s"""scalaVersion := "$publishedDottyVersion"""") - val dottyPluginSbtFile = baseDirectory.value / "out" / "dotty-plugin.sbt" + val dottyPluginSbtFile = baseDirectory.value / "out" / "scala3-plugin.sbt" IO.write(dottyPluginSbtFile, s"""addSbtPlugin("$dottyOrganization" % "$sbtDottyName" % "$publishedSbtDottyVersion")""") Seq(buildSbtFile, dottyPluginSbtFile) @@ -1224,30 +1224,30 @@ object Build { }.dependsOn(compile in Compile).evaluated ) - val prepareCommunityBuild = taskKey[Unit]("Publish local the compiler and the sbt plugin. Also store the versions of the published local artefacts in two files, community-build/{dotty-bootstrapped.version,sbt-dotty-sbt}.") + val prepareCommunityBuild = taskKey[Unit]("Publish local the compiler and the sbt plugin. Also store the versions of the published local artefacts in two files, community-build/{scala3-bootstrapped.version,sbt-dotty-sbt}.") lazy val `community-build` = project.in(file("community-build")). dependsOn(dottyLibrary(Bootstrapped)). settings(commonBootstrappedSettings). settings( prepareCommunityBuild := { - (publishLocal in `dotty-sbt-bridge`).value - (publishLocal in `dotty-interfaces`).value + (publishLocal in `scala3-sbt-bridge`).value + (publishLocal in `scala3-interfaces`).value (publishLocal in `scala-library`).value (publishLocal in `scala-reflect`).value (publishLocal in `tasty-core-bootstrapped`).value - (publishLocal in `dotty-library-bootstrapped`).value - (publishLocal in `dotty-doc-bootstrapped`).value - (publishLocal in `dotty-compiler-bootstrapped`).value + (publishLocal in `scala3-library-bootstrapped`).value + (publishLocal in `scala3-doc-bootstrapped`).value + (publishLocal in `scala3-compiler-bootstrapped`).value (publishLocal in `sbt-dotty`).value - (publishLocal in `dotty-bootstrapped`).value - (publishLocal in `dotty-library-bootstrappedJS`).value - // (publishLocal in `dotty-staging`).value + (publishLocal in `scala3-bootstrapped`).value + (publishLocal in `scala3-library-bootstrappedJS`).value + // (publishLocal in `scala3-staging`).value val pluginText = s"""updateOptions in Global ~= (_.withLatestSnapshots(false)) |addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "$sbtDottyVersion")""".stripMargin IO.write(baseDirectory.value / "sbt-dotty-sbt", pluginText) - IO.write(baseDirectory.value / "dotty-bootstrapped.version", dottyVersion) + IO.write(baseDirectory.value / "scala3-bootstrapped.version", dottyVersion) }, testOptions in Test += Tests.Argument( TestFrameworks.JUnit, @@ -1353,7 +1353,7 @@ object Build { publishArtifact := false, packGenerateMakefile := false, packExpandedClasspath := true, - packArchiveName := "dotty-" + dottyVersion + packArchiveName := "scala3-" + dottyVersion ) lazy val dist = project.asDist(Bootstrapped) @@ -1365,27 +1365,27 @@ object Build { // FIXME: we do not aggregate `bin` because its tests delete jars, thus breaking other tests def asDottyRoot(implicit mode: Mode): Project = project.withCommonSettings. - aggregate(`dotty-interfaces`, dottyLibrary, dottyCompiler, tastyCore, dottyDoc, `dotty-sbt-bridge`). + aggregate(`scala3-interfaces`, dottyLibrary, dottyCompiler, tastyCore, dottyDoc, `scala3-sbt-bridge`). bootstrappedAggregate(`scala-library`, `scala-compiler`, `scala-reflect`, scalap, - `dotty-language-server`, `dotty-staging`, `dotty-tasty-inspector`, `dotty-tastydoc`, - `dotty-library-bootstrappedJS`). + `scala3-language-server`, `scala3-staging`, `scala3-tasty-inspector`, `scala3-tastydoc`, + `scala3-library-bootstrappedJS`). dependsOn(tastyCore). dependsOn(dottyCompiler). dependsOn(dottyLibrary). nonBootstrappedSettings( - addCommandAlias("run", "dotty-compiler/run"), + addCommandAlias("run", "scala3-compiler/run"), // Clean everything by default - addCommandAlias("clean", ";dotty/clean;dotty-bootstrapped/clean"), + addCommandAlias("clean", ";dotty/clean;scala3-bootstrapped/clean"), // `publishLocal` on the non-bootstrapped compiler does not produce a // working distribution (it can't in general, since there's no guarantee // that the non-bootstrapped library is compatible with the // non-bootstrapped compiler), so publish the bootstrapped one by // default. - addCommandAlias("publishLocal", "dotty-bootstrapped/publishLocal"), + addCommandAlias("publishLocal", "scala3-bootstrapped/publishLocal"), ) def asDottyCompiler(implicit mode: Mode): Project = project.withCommonSettings. - dependsOn(`dotty-interfaces`). + dependsOn(`scala3-interfaces`). dependsOn(dottyLibrary). dependsOn(tastyCore). settings(dottyCompilerSettings) @@ -1413,9 +1413,9 @@ object Build { enablePlugins(JmhPlugin) def asDottyTastydoc(implicit mode: Mode): Project = project.withCommonSettings. - aggregate(`dotty-tastydoc-input`). + aggregate(`scala3-tastydoc-input`). dependsOn(dottyCompiler). - dependsOn(`dotty-tasty-inspector`). + dependsOn(`scala3-tasty-inspector`). settings(commonDocSettings) def asDottyTastydocInput(implicit mode: Mode): Project = project.withCommonSettings. @@ -1424,7 +1424,7 @@ object Build { def asDist(implicit mode: Mode): Project = project. enablePlugins(PackPlugin). withCommonSettings. - dependsOn(`dotty-interfaces`, dottyCompiler, dottyLibrary, tastyCore, `dotty-staging`, `dotty-tasty-inspector`, dottyDoc). + dependsOn(`scala3-interfaces`, dottyCompiler, dottyLibrary, tastyCore, `scala3-staging`, `scala3-tasty-inspector`, dottyDoc). settings(commonDistSettings). bootstrappedSettings( target := baseDirectory.value / "target" // override setting in commonBootstrappedSettings From a77d70a3c74820d4db1f69dc3426fdaec11dcec3 Mon Sep 17 00:00:00 2001 From: Anatolii Kmetiuk Date: Wed, 30 Sep 2020 15:15:24 +0200 Subject: [PATCH 02/13] =?UTF-8?q?Set=20version=20to=203.0.0-M1=20=E2=80=93?= =?UTF-8?q?=20Dotty=20becomes=20Scala=203=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/Build.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Build.scala b/project/Build.scala index 1d1009d751c7..fb8fc876297e 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -55,7 +55,7 @@ object MyScalaJSPlugin extends AutoPlugin { object Build { val referenceVersion = "0.27.0-RC1" - val baseVersion = "0.28.0" + val baseVersion = "3.0.0-M1" val baseSbtDottyVersion = "0.4.3" // Versions used by the vscode extension to create a new project From ccf4f8824f410028daefa9780465c7538a72a006 Mon Sep 17 00:00:00 2001 From: Anatolii Kmetiuk Date: Wed, 30 Sep 2020 15:16:26 +0200 Subject: [PATCH 03/13] Dotty SBT plugin updated to work with Scala 3 Read latest nightly metadata from the scala3-compiler artefact Co-authored-by: Guillaume Martres Properly set binary version for Scala 3 Fetch Dotty nightlies correctly --- .../dotty/tools/sbtplugin/DottyPlugin.scala | 52 +++++++++++++------ 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala b/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala index 4c9dffdc034f..2861685e09a3 100644 --- a/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala +++ b/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala @@ -35,7 +35,14 @@ object DottyPlugin extends AutoPlugin { // get latest nightly version from maven def fetchSource(version: String): (scala.io.BufferedSource, String) = - try Source.fromURL(s"https://repo1.maven.org/maven2/ch/epfl/lamp/dotty_$version/maven-metadata.xml") -> version + try { + val url = + if (version.startsWith("0")) + s"https://repo1.maven.org/maven2/ch/epfl/lamp/dotty-compiler_$version/maven-metadata.xml" + else + s"https://repo1.maven.org/maven2/org/scala-lang/scala3-compiler_$version/maven-metadata.xml" + Source.fromURL(url) -> version + } catch { case t: java.io.FileNotFoundException => val major :: minor :: Nil = version.split('.').toList if (minor.toInt <= 0) throw t @@ -92,7 +99,7 @@ object DottyPlugin extends AutoPlugin { */ def withDottyCompat(scalaVersion: String): ModuleID = { val name = moduleID.name - if (name != "dotty" && name != "dotty-library" && name != "dotty-compiler") + if (name != "scala3" && name != "scala3-library" && name != "scala3-compiler") moduleID.crossVersion match { case binary: librarymanagement.Binary => val compatVersion = @@ -167,6 +174,14 @@ object DottyPlugin extends AutoPlugin { // https://github.com/sbt/sbt/issues/3110 val Def = sbt.Def + + private def scala3Artefact(version: String, name: String) = + if (version.startsWith("0.")) s"dotty-$name" + else if (version.startsWith("3.")) s"scala3-$name" + else throw new RuntimeException( + s"Cannot construct a Scala 3 artefact name $name for a non-Scala3 " + + s"scala version ${version}") + override def projectSettings: Seq[Setting[_]] = { Seq( isDotty := scalaVersion.value.startsWith("0.") || scalaVersion.value.startsWith("3."), @@ -195,8 +210,10 @@ object DottyPlugin extends AutoPlugin { }, scalaOrganization := { - if (isDotty.value) + if (scalaVersion.value.startsWith("0.")) "ch.epfl.lamp" + else if (scalaVersion.value.startsWith("3.")) + "org.scala-lang" else scalaOrganization.value }, @@ -212,14 +229,14 @@ object DottyPlugin extends AutoPlugin { scalaCompilerBridgeBinaryJar := Def.settingDyn { if (isDotty.value) Def.task { val updateReport = fetchArtifactsOf( - scalaOrganization.value % "dotty-sbt-bridge" % scalaVersion.value, + scalaOrganization.value % scala3Artefact(scalaVersion.value, "sbt-bridge") % scalaVersion.value, dependencyResolution.value, scalaModuleInfo.value, updateConfiguration.value, (unresolvedWarningConfiguration in update).value, streams.value.log, ) - Option(getJar(updateReport, scalaOrganization.value, "dotty-sbt-bridge", scalaVersion.value)) + Option(getJar(updateReport, scalaOrganization.value, scala3Artefact(scalaVersion.value, "sbt-bridge"), scalaVersion.value)) } else Def.task { None: Option[File] @@ -228,10 +245,15 @@ object DottyPlugin extends AutoPlugin { // Needed for RCs publishing scalaBinaryVersion := { - if (isDotty.value) - scalaVersion.value.split("\\.").take(2).mkString(".") - else - scalaBinaryVersion.value + scalaVersion.value.split("[\\.-]").toList match { + case "0" :: minor :: _ => s"0.$minor" + case "3" :: minor :: patch :: suffix => + s"3.$minor.$patch" + (suffix match { + case milestone :: _ => s"-$milestone" + case Nil => "" + }) + case _ => scalaBinaryVersion.value + } }, // We want: @@ -326,7 +348,7 @@ object DottyPlugin extends AutoPlugin { // ... instead, we'll fetch the compiler and its dependencies ourselves. scalaInstance := Def.taskDyn { if (isDotty.value) - dottyScalaInstanceTask("dotty-compiler") + dottyScalaInstanceTask(scala3Artefact(scalaVersion.value, "compiler")) else Def.valueStrict { scalaInstance.taskValue } }.value, @@ -334,7 +356,7 @@ object DottyPlugin extends AutoPlugin { // We need more stuff on the classpath to run the `doc` task. scalaInstance in doc := Def.taskDyn { if (isDotty.value) - dottyScalaInstanceTask("dotty-doc") + dottyScalaInstanceTask(scala3Artefact(scalaVersion.value, "doc")) else Def.valueStrict { (scalaInstance in doc).taskValue } }.value, @@ -343,8 +365,8 @@ object DottyPlugin extends AutoPlugin { libraryDependencies ++= { if (isDotty.value && autoScalaLibrary.value) { val name = - if (isDottyJS.value) "dotty-library_sjs1" - else "dotty-library" + if (isDottyJS.value) scala3Artefact(scalaVersion.value, "library_sjs1") + else scala3Artefact(scalaVersion.value, "library") Seq(scalaOrganization.value %% name % scalaVersion.value) } else Seq() @@ -479,9 +501,9 @@ object DottyPlugin extends AutoPlugin { val scalaLibraryJar = getJar(updateReport, "org.scala-lang", "scala-library", revision = AllPassFilter) val dottyLibraryJar = getJar(updateReport, - scalaOrganization.value, s"dotty-library_${scalaBinaryVersion.value}", scalaVersion.value) + scalaOrganization.value, scala3Artefact(scalaVersion.value, s"library_${scalaBinaryVersion.value}"), scalaVersion.value) val compilerJar = getJar(updateReport, - scalaOrganization.value, s"dotty-compiler_${scalaBinaryVersion.value}", scalaVersion.value) + scalaOrganization.value, scala3Artefact(scalaVersion.value, s"compiler_${scalaBinaryVersion.value}"), scalaVersion.value) val allJars = getJars(updateReport, AllPassFilter, AllPassFilter, AllPassFilter) From 8c4b56dd16c6039d2bf6ea21a5ac638e0c524174 Mon Sep 17 00:00:00 2001 From: Anatolii Kmetiuk Date: Wed, 30 Sep 2020 15:51:50 +0200 Subject: [PATCH 04/13] Don't publish artefacts for the root project Fix #9024: Don't publish empty compat jars Delete dummy projects --- build.sbt | 4 ---- project/Build.scala | 49 ++++----------------------------------------- 2 files changed, 4 insertions(+), 49 deletions(-) diff --git a/build.sbt b/build.sbt index 01c513c6d465..e4cd3adb6286 100644 --- a/build.sbt +++ b/build.sbt @@ -21,10 +21,6 @@ val `tasty-core-scala2` = Build.`tasty-core-scala2` val `scala3-tastydoc` = Build.`scala3-tastydoc` val `scala3-tastydoc-input` = Build.`scala3-tastydoc-input` val `scala3-bench-run` = Build.`scala3-bench-run` -val `scala-library` = Build.`scala-library` -val `scala-compiler` = Build.`scala-compiler` -val `scala-reflect` = Build.`scala-reflect` -val scalap = Build.scalap val dist = Build.dist val `community-build` = Build.`community-build` diff --git a/project/Build.scala b/project/Build.scala index fb8fc876297e..7f50e2ec0589 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -336,18 +336,6 @@ object Build { javaOptions += "-DBENCH_CLASS_PATH=" + Attributed.data((fullClasspath in (`scala3-library-bootstrapped`, Compile)).value).mkString("", File.pathSeparator, "") ) - // sbt >= 0.13.12 will automatically rewrite transitive dependencies on - // any version in any organization of scala{-library,-compiler,-reflect,p} - // to have organization `scalaOrganization` and version `scalaVersion` - // (see https://github.com/sbt/sbt/pull/2634). - // This means that we need to provide dummy artefacts for these projects, - // otherwise users will get compilation errors if they happen to transitively - // depend on one of these projects. - lazy val commonDummySettings = commonBootstrappedSettings ++ Seq( - crossPaths := false, - libraryDependencies := Seq() - ) - /** Projects -------------------------------------------------------------- */ val dottyCompilerBootstrappedRef = LocalProject("scala3-compiler-bootstrapped") @@ -1100,33 +1088,6 @@ object Build { lazy val `scala3-tastydoc` = project.in(file("tastydoc")).asDottyTastydoc(Bootstrapped) lazy val `scala3-tastydoc-input` = project.in(file("tastydoc/input")).asDottyTastydocInput(Bootstrapped) - // Depend on scala3-library so that sbt projects using dotty automatically - // depend on the scala3-library - lazy val `scala-library` = project. - dependsOn(`scala3-library-bootstrapped`). - settings(commonDummySettings). - settings( - // Need a direct dependency on the real scala-library even though we indirectly - // depend on it via scala3-library, because sbt may rewrite dependencies - // (see https://github.com/sbt/sbt/pull/2634), but won't rewrite the direct - // dependencies of scala-library (see https://github.com/sbt/sbt/pull/2897) - libraryDependencies += "org.scala-lang" % "scala-library" % stdlibVersion(Bootstrapped) - ) - - lazy val `scala-compiler` = project. - settings(commonDummySettings) - lazy val `scala-reflect` = project. - settings(commonDummySettings). - settings( - libraryDependencies := Seq("org.scala-lang" % "scala-reflect" % stdlibVersion(Bootstrapped)) - ) - lazy val scalap = project. - settings(commonDummySettings). - settings( - libraryDependencies := Seq("org.scala-lang" % "scalap" % stdlibVersion(Bootstrapped)) - ) - - // sbt plugin to use Dotty in your own build, see // https://github.com/lampepfl/scala3-example-project for usage. lazy val `sbt-dotty` = project.in(file("sbt-dotty")). @@ -1164,8 +1125,6 @@ object Build { publishLocal in `tasty-core-bootstrapped`, publishLocal in `scala3-staging`, publishLocal in `scala3-tasty-inspector`, - publishLocal in `scala-library`, - publishLocal in `scala-reflect`, publishLocal in `scala3-doc-bootstrapped`, publishLocal in `scala3-bootstrapped` // Needed because sbt currently hardcodes the dotty artifact ).evaluated @@ -1233,8 +1192,6 @@ object Build { prepareCommunityBuild := { (publishLocal in `scala3-sbt-bridge`).value (publishLocal in `scala3-interfaces`).value - (publishLocal in `scala-library`).value - (publishLocal in `scala-reflect`).value (publishLocal in `tasty-core-bootstrapped`).value (publishLocal in `scala3-library-bootstrapped`).value (publishLocal in `scala3-doc-bootstrapped`).value @@ -1366,8 +1323,7 @@ object Build { // FIXME: we do not aggregate `bin` because its tests delete jars, thus breaking other tests def asDottyRoot(implicit mode: Mode): Project = project.withCommonSettings. aggregate(`scala3-interfaces`, dottyLibrary, dottyCompiler, tastyCore, dottyDoc, `scala3-sbt-bridge`). - bootstrappedAggregate(`scala-library`, `scala-compiler`, `scala-reflect`, scalap, - `scala3-language-server`, `scala3-staging`, `scala3-tasty-inspector`, `scala3-tastydoc`, + bootstrappedAggregate(`scala3-language-server`, `scala3-staging`, `scala3-tasty-inspector`, `scala3-tastydoc`, `scala3-library-bootstrappedJS`). dependsOn(tastyCore). dependsOn(dottyCompiler). @@ -1382,6 +1338,9 @@ object Build { // non-bootstrapped compiler), so publish the bootstrapped one by // default. addCommandAlias("publishLocal", "scala3-bootstrapped/publishLocal"), + ). + settings( + publish / skip := true ) def asDottyCompiler(implicit mode: Mode): Project = project.withCommonSettings. From fcdc666cc2f9cd7488802254e566dd537512d9f4 Mon Sep 17 00:00:00 2001 From: Anatolii Kmetiuk Date: Fri, 2 Oct 2020 12:28:00 +0200 Subject: [PATCH 05/13] Dotty IDE plugin supports Scala 3 --- .../tools/sbtplugin/DottyIDEPlugin.scala | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/sbt-dotty/src/dotty/tools/sbtplugin/DottyIDEPlugin.scala b/sbt-dotty/src/dotty/tools/sbtplugin/DottyIDEPlugin.scala index 5583fb508dfb..653accb21076 100644 --- a/sbt-dotty/src/dotty/tools/sbtplugin/DottyIDEPlugin.scala +++ b/sbt-dotty/src/dotty/tools/sbtplugin/DottyIDEPlugin.scala @@ -41,7 +41,7 @@ object DottyIDEPlugin extends AutoPlugin { } private def isDottyVersion(version: String) = - version.startsWith("0.") + version.startsWith("0.") || version.startsWith("3.") /** Return a new state derived from `state` such that scalaVersion returns `newScalaVersion` in all @@ -234,10 +234,22 @@ object DottyIDEPlugin extends AutoPlugin { // IDE plugins to parse JSON. val dlsVersion = dottyVersion .replace("-nonbootstrapped", "") // The language server is only published bootstrapped - val dlsBinaryVersion = dlsVersion.split("\\.").take(2).mkString(".") + val dlsBinaryVersion = dlsVersion.split("[\\.-]").toList match { + case "0" :: minor :: _ => s"0.$minor" + case "3" :: minor :: patch :: suffix => + s"3.$minor.$patch" + (suffix match { + case milestone :: _ => s"-$milestone" + case Nil => "" + }) + case _ => throw new RuntimeException( + s"Version $dlsVersion is not a Scala 3 version.") + } val pwArtifact = new PrintWriter(artifactFile) try { - pwArtifact.println(s"ch.epfl.lamp:dotty-language-server_${dlsBinaryVersion}:${dlsVersion}") + if (dottyVersion.startsWith("0.")) + pwArtifact.println(s"ch.epfl.lamp:dotty-language-server_${dlsBinaryVersion}:${dlsVersion}") + else + pwArtifact.println(s"org.scala-lang:scala3-language-server_${dlsBinaryVersion}:${dlsVersion}") } finally { pwArtifact.close() } @@ -285,7 +297,15 @@ object DottyIDEPlugin extends AutoPlugin { // doesn't work for empty projects. val isScalaProject = ( // Our `dotty-library` project is a Scala project - (projectName.startsWith("dotty-library") || depClasspath.exists(_.getAbsolutePath.contains("dotty-library"))) + ( + projectName.startsWith("dotty-library") || + projectName.startsWith("scala3-library") || + depClasspath.exists { d => + val absolutePath = d.getAbsolutePath + absolutePath.contains("dotty-library") || + absolutePath.contains("scala3-library") + } + ) && depClasspath.exists(_.getAbsolutePath.contains("scala-library")) ) From af63b0404e51866ac20748d4e2c42245f08c1ae7 Mon Sep 17 00:00:00 2001 From: Anatolii Kmetiuk Date: Thu, 15 Oct 2020 11:26:56 +0200 Subject: [PATCH 06/13] Update CB projects --- community-build/community-projects/PPrint | 2 +- community-build/community-projects/ScalaPB | 2 +- community-build/community-projects/cats-effect-2 | 2 +- community-build/community-projects/fansi | 2 +- community-build/community-projects/geny | 2 +- community-build/community-projects/munit | 2 +- community-build/community-projects/os-lib | 2 +- community-build/community-projects/requests-scala | 2 +- community-build/community-projects/scalacheck | 2 +- community-build/community-projects/scalatest | 2 +- community-build/community-projects/scalatestplus-scalacheck | 2 +- community-build/community-projects/scodec | 2 +- community-build/community-projects/scodec-bits | 2 +- community-build/community-projects/sourcecode | 2 +- community-build/community-projects/stdLib213 | 2 +- community-build/community-projects/upickle | 2 +- community-build/community-projects/utest | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/community-build/community-projects/PPrint b/community-build/community-projects/PPrint index 46eb82399a8d..73353ed34649 160000 --- a/community-build/community-projects/PPrint +++ b/community-build/community-projects/PPrint @@ -1 +1 @@ -Subproject commit 46eb82399a8df75aff26048245cfba36d09ade54 +Subproject commit 73353ed34649c24ed9c82da768c0391edc4faab6 diff --git a/community-build/community-projects/ScalaPB b/community-build/community-projects/ScalaPB index 6b9a00dec5ba..32513251893d 160000 --- a/community-build/community-projects/ScalaPB +++ b/community-build/community-projects/ScalaPB @@ -1 +1 @@ -Subproject commit 6b9a00dec5bad0e3be70f3666127158657d47b9c +Subproject commit 32513251893d583e0502b39d08613903e9f0f9eb diff --git a/community-build/community-projects/cats-effect-2 b/community-build/community-projects/cats-effect-2 index 4af6f4367d44..68905c4d87de 160000 --- a/community-build/community-projects/cats-effect-2 +++ b/community-build/community-projects/cats-effect-2 @@ -1 +1 @@ -Subproject commit 4af6f4367d4466d4900d17dc0ad1e1fda989fad9 +Subproject commit 68905c4d87de0ab020caf306ea384d972fa296df diff --git a/community-build/community-projects/fansi b/community-build/community-projects/fansi index 2b6c6a95102c..d4a43cf0fbd6 160000 --- a/community-build/community-projects/fansi +++ b/community-build/community-projects/fansi @@ -1 +1 @@ -Subproject commit 2b6c6a95102c8578fd647035a2777c63b67371fe +Subproject commit d4a43cf0fbd6c26773a3164d3139c6f642f59da6 diff --git a/community-build/community-projects/geny b/community-build/community-projects/geny index d1ef855f9f34..88b58dd3d62c 160000 --- a/community-build/community-projects/geny +++ b/community-build/community-projects/geny @@ -1 +1 @@ -Subproject commit d1ef855f9f34d44145c802d0a033903a3f777749 +Subproject commit 88b58dd3d62c8a759657e00dc833a036c815355f diff --git a/community-build/community-projects/munit b/community-build/community-projects/munit index d3a77a8ac8b1..daa6fc0959d6 160000 --- a/community-build/community-projects/munit +++ b/community-build/community-projects/munit @@ -1 +1 @@ -Subproject commit d3a77a8ac8b1c4900a79011a7ad988712af67d72 +Subproject commit daa6fc0959d64abcbff095290ba87e816557fe07 diff --git a/community-build/community-projects/os-lib b/community-build/community-projects/os-lib index f1dc9f277cb0..dff1e85f4dd7 160000 --- a/community-build/community-projects/os-lib +++ b/community-build/community-projects/os-lib @@ -1 +1 @@ -Subproject commit f1dc9f277cb0a6458f3d34d6abc3c09ac2882dfb +Subproject commit dff1e85f4dd7452b5b3b42c76548cb294a3b81ce diff --git a/community-build/community-projects/requests-scala b/community-build/community-projects/requests-scala index 7b34ad46432a..f77fcd0f8540 160000 --- a/community-build/community-projects/requests-scala +++ b/community-build/community-projects/requests-scala @@ -1 +1 @@ -Subproject commit 7b34ad46432a0064ceb804426771a17b217aed5e +Subproject commit f77fcd0f8540db014a6d0ac3ca4bf90b06920659 diff --git a/community-build/community-projects/scalacheck b/community-build/community-projects/scalacheck index a715860a25ad..b980c99ed96c 160000 --- a/community-build/community-projects/scalacheck +++ b/community-build/community-projects/scalacheck @@ -1 +1 @@ -Subproject commit a715860a25ad6d2c6e1ae17e8baa13ded427cdf0 +Subproject commit b980c99ed96c1b93483bb4a72a2e36548b7bbe12 diff --git a/community-build/community-projects/scalatest b/community-build/community-projects/scalatest index 70c08e1b6312..41b745c72861 160000 --- a/community-build/community-projects/scalatest +++ b/community-build/community-projects/scalatest @@ -1 +1 @@ -Subproject commit 70c08e1b63125b149ea5e6f5a34d8a0bb3b78b9f +Subproject commit 41b745c72861e25fd0bcba03d2cfaf9237096050 diff --git a/community-build/community-projects/scalatestplus-scalacheck b/community-build/community-projects/scalatestplus-scalacheck index 349d6d8c9367..fb66f0cfa9ca 160000 --- a/community-build/community-projects/scalatestplus-scalacheck +++ b/community-build/community-projects/scalatestplus-scalacheck @@ -1 +1 @@ -Subproject commit 349d6d8c936738a685fe3644d35a46d214b95034 +Subproject commit fb66f0cfa9ca4bf7abe2c32fef83d0b6f1a157d2 diff --git a/community-build/community-projects/scodec b/community-build/community-projects/scodec index 5de8baee3794..ca8a034b3acc 160000 --- a/community-build/community-projects/scodec +++ b/community-build/community-projects/scodec @@ -1 +1 @@ -Subproject commit 5de8baee379463996e9837e39a462ca8e1e33c45 +Subproject commit ca8a034b3acc14ad0db93fad87c191a22de0ffbf diff --git a/community-build/community-projects/scodec-bits b/community-build/community-projects/scodec-bits index 61bddaee1e8b..61a0b9fc2fff 160000 --- a/community-build/community-projects/scodec-bits +++ b/community-build/community-projects/scodec-bits @@ -1 +1 @@ -Subproject commit 61bddaee1e8bceb155fc8f1861200464c485d819 +Subproject commit 61a0b9fc2ffff9686207a0c2f15ca1377a3302d3 diff --git a/community-build/community-projects/sourcecode b/community-build/community-projects/sourcecode index 45215149cc2c..265d237ba3f9 160000 --- a/community-build/community-projects/sourcecode +++ b/community-build/community-projects/sourcecode @@ -1 +1 @@ -Subproject commit 45215149cc2c895f9c156dc36f586be623453684 +Subproject commit 265d237ba3f97f7f05d309e26d5f0103f49e70c4 diff --git a/community-build/community-projects/stdLib213 b/community-build/community-projects/stdLib213 index f0a82ae836e0..47aa43534da7 160000 --- a/community-build/community-projects/stdLib213 +++ b/community-build/community-projects/stdLib213 @@ -1 +1 @@ -Subproject commit f0a82ae836e0df41cd418580b1b708cc2ee745d3 +Subproject commit 47aa43534da7a59127fb8a93f8e7364e3d0eed8a diff --git a/community-build/community-projects/upickle b/community-build/community-projects/upickle index 47e602e405f1..e425399f42eb 160000 --- a/community-build/community-projects/upickle +++ b/community-build/community-projects/upickle @@ -1 +1 @@ -Subproject commit 47e602e405f180c7973966bd21d82c80f5cbab46 +Subproject commit e425399f42eb505db92044053687c322bb5cfe5f diff --git a/community-build/community-projects/utest b/community-build/community-projects/utest index 2536c12247e8..b0b565e1be62 160000 --- a/community-build/community-projects/utest +++ b/community-build/community-projects/utest @@ -1 +1 @@ -Subproject commit 2536c12247e80090377d21181b5ae5cd43ced8ee +Subproject commit b0b565e1be6211f2f75b7fe7f1c025f973ab7c40 From 9d5a51f411bd91939581bb72617d17f2b0267b5d Mon Sep 17 00:00:00 2001 From: Anatolii Kmetiuk Date: Tue, 6 Oct 2020 16:12:51 +0200 Subject: [PATCH 07/13] Rename binaries from e.g. dotc to scalac Rename projects & binaries in project/scripts Fix scala3-doc name in scalad Rename scalar to scala --- .gitignore | 3 ++- bin/{dotc => scala} | 2 +- bin/{dotd => scalac} | 2 +- bin/{dotr => scalad} | 2 +- bin/test/TestScripts.scala | 34 ++++++++++++------------- dist/bin/common | 10 ++++---- dist/bin/{dotr => scala} | 6 ++--- dist/bin/{dotc => scalac} | 0 dist/bin/{dotd => scalad} | 4 +-- project/Build.scala | 18 ++++++------- project/scripts/bootstrapCmdTests | 42 +++++++++++++++---------------- project/scripts/cmdTests | 42 +++++++++++++++---------------- project/scripts/genDocs | 2 +- 13 files changed, 84 insertions(+), 83 deletions(-) rename bin/{dotc => scala} (60%) rename bin/{dotd => scalac} (60%) rename bin/{dotr => scalad} (60%) rename dist/bin/{dotr => scala} (91%) rename dist/bin/{dotc => scalac} (100%) rename dist/bin/{dotd => scalad} (97%) diff --git a/.gitignore b/.gitignore index 132f395821d9..bd03847585d5 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,7 @@ local.sbt # npm node_modules -# VS Code +# VS Code .vscode/ # Metals .bloop/ @@ -87,3 +87,4 @@ community-build/sbt-dotty-sbt # Vulpix output files *.check.out +!/dist/bin/ diff --git a/bin/dotc b/bin/scala similarity index 60% rename from bin/dotc rename to bin/scala index 34d5f08b6130..66ec9a5774c7 100755 --- a/bin/dotc +++ b/bin/scala @@ -2,4 +2,4 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >& /dev/null && pwd)/.." -"$ROOT/bin/common" "$ROOT/dist/target/pack/bin/dotc" "$@" +"$ROOT/bin/common" "$ROOT/dist/target/pack/bin/scala" "$@" diff --git a/bin/dotd b/bin/scalac similarity index 60% rename from bin/dotd rename to bin/scalac index 9079a88c63aa..faeb48d92d87 100755 --- a/bin/dotd +++ b/bin/scalac @@ -2,4 +2,4 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >& /dev/null && pwd)/.." -"$ROOT/bin/common" "$ROOT/dist/target/pack/bin/dotd" "$@" +"$ROOT/bin/common" "$ROOT/dist/target/pack/bin/scalac" "$@" diff --git a/bin/dotr b/bin/scalad similarity index 60% rename from bin/dotr rename to bin/scalad index a449b1488898..43693684ea70 100755 --- a/bin/dotr +++ b/bin/scalad @@ -2,4 +2,4 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >& /dev/null && pwd)/.." -"$ROOT/bin/common" "$ROOT/dist/target/pack/bin/dotr" "$@" +"$ROOT/bin/common" "$ROOT/dist/target/pack/bin/scalad" "$@" diff --git a/bin/test/TestScripts.scala b/bin/test/TestScripts.scala index f3eab3607797..bada140580fc 100644 --- a/bin/test/TestScripts.scala +++ b/bin/test/TestScripts.scala @@ -45,53 +45,53 @@ class TestScripts { @Before def buildUp = deletePackages @After def tearDown = deletePackages - /** bin/dotc script should be able to build hello world and successfully - * execute it using dotr + /** bin/scalac script should be able to build hello world and successfully + * execute it using scala */ @Test def buildAndRunHelloWorld = doUnlessWindows { - val (retDotc, dotcOutput) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala") + val (retDotc, dotcOutput) = executeScript("./bin/scalac ./tests/pos/HelloWorld.scala") - // Check correct output of building and running dotc + // Check correct output of building and running scalac assert( retDotc == 0, - s"bin/dotc script did not run properly. Output:$lineSep$dotcOutput" + s"bin/scalac script did not run properly. Output:$lineSep$dotcOutput" ) - val (retDotr, dotrOutput) = executeScript("./bin/dotr HelloWorld") + val (retDotr, dotrOutput) = executeScript("./bin/scala HelloWorld") assert( retDotr == 0 && dotrOutput == "hello world\n", s"Running hello world exited with status: $retDotr and output: $dotrOutput" ) } - /** bin/dotc script should be able to detect changes in dotty sources and + /** bin/scalac script should be able to detect changes in dotty sources and * rebuild dotty if needed */ @Test def rebuildIfNecessary = doUnlessWindows { - val (retFirstBuild, out1) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala") - assert(retFirstBuild == 0, s"building dotc failed: $out1") + val (retFirstBuild, out1) = executeScript("./bin/scalac ./tests/pos/HelloWorld.scala") + assert(retFirstBuild == 0, s"building scalac failed: $out1") // Create a new file to force rebuild new JFile("./compiler/src/dotty/tools/dotc/Dummy.scala").createNewFile() - val (retSecondBuild, output) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala") + val (retSecondBuild, output) = executeScript("./bin/scalac ./tests/pos/HelloWorld.scala") assert( retSecondBuild == 0 && output.contains("rebuilding"), s"Rebuilding the tool should result in jar files being rebuilt. Status: $retSecondBuild, output:$lineSep$output") } - /** if no changes to dotty, dotc script should be fast */ + /** if no changes to dotty, scalac script should be fast */ @Test def beFastOnNoChanges = doUnlessWindows { - val (retFirstBuild, _) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala") - assert(retFirstBuild == 0, "building dotc failed") + val (retFirstBuild, _) = executeScript("./bin/scalac ./tests/pos/HelloWorld.scala") + assert(retFirstBuild == 0, "building scalac failed") - val (ret, output) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala") + val (ret, output) = executeScript("./bin/scalac ./tests/pos/HelloWorld.scala") assert( ret == 0 && !output.contains("rebuilding"), s"Project recompiled when it didn't need to be. Status $ret, output:$lineSep$output") } - /** dotc script should work after corrupting .packages */ + /** scalac script should work after corrupting .packages */ @Test def reCreatesPackagesIfNecessary = doUnlessWindows { import java.nio.file.{Paths, Files} import java.nio.charset.StandardCharsets @@ -104,8 +104,8 @@ class TestScripts { Files.write(Paths.get("./.packages"), contents.getBytes(StandardCharsets.UTF_8)) - val (retFirstBuild, output) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala") + val (retFirstBuild, output) = executeScript("./bin/scalac ./tests/pos/HelloWorld.scala") assert(output.contains(".packages file corrupted")) - assert(retFirstBuild == 0, "building dotc failed") + assert(retFirstBuild == 0, "building scalac failed") } } diff --git a/dist/bin/common b/dist/bin/common index 0ee5dae27619..ddf949b11a04 100755 --- a/dist/bin/common +++ b/dist/bin/common @@ -104,11 +104,11 @@ find_lib () { fi } -DOTTY_COMP=$(find_lib "*dotty-compiler*") -DOTTY_INTF=$(find_lib "*dotty-interfaces*") -DOTTY_LIB=$(find_lib "*dotty-library*") -DOTTY_STAGING=$(find_lib "*dotty-staging*") -DOTTY_TASTY_INSPECTOR=$(find_lib "*dotty-tasty-inspector*") +DOTTY_COMP=$(find_lib "*scala3-compiler*") +DOTTY_INTF=$(find_lib "*scala3-interfaces*") +DOTTY_LIB=$(find_lib "*scala3-library*") +DOTTY_STAGING=$(find_lib "*scala3-staging*") +DOTTY_TASTY_INSPECTOR=$(find_lib "*scala3-tasty-inspector*") TASTY_CORE=$(find_lib "*tasty-core*") SCALA_ASM=$(find_lib "*scala-asm*") SCALA_LIB=$(find_lib "*scala-library*") diff --git a/dist/bin/dotr b/dist/bin/scala similarity index 91% rename from dist/bin/dotr rename to dist/bin/scala index edbabfe7e3db..a00ab14a7fac 100755 --- a/dist/bin/dotr +++ b/dist/bin/scala @@ -89,8 +89,8 @@ if [ $execute_repl == true ] || ([ $execute_run == false ] && [ $options_indicat if [ "$CLASS_PATH" ]; then cp_arg="-classpath \"$CLASS_PATH\"" fi - echo "Starting dotty REPL..." - eval "\"$PROG_HOME/bin/dotc\" $cp_arg ${java_options[@]} -repl ${residual_args[@]}" + echo "Starting scala3 REPL..." + eval "\"$PROG_HOME/bin/scalac\" $cp_arg ${java_options[@]} -repl ${residual_args[@]}" elif [ $execute_repl == true ] || [ ${#residual_args[@]} -ne 0 ]; then cp_arg="$DOTTY_LIB$PSEP$SCALA_LIB" if [ -z "$CLASS_PATH" ]; then @@ -99,7 +99,7 @@ elif [ $execute_repl == true ] || [ ${#residual_args[@]} -ne 0 ]; then cp_arg+="$PSEP$CLASS_PATH" fi if [ "$class_path_count" -gt 1 ]; then - echo "warning: multiple classpaths are found, dotr only use the last one." + echo "warning: multiple classpaths are found, scala only use the last one." fi if [ $with_compiler == true ]; then cp_arg+="$PSEP$DOTTY_COMP$PSEP$TASTY_CORE$PSEP$DOTTY_INTF$PSEP$SCALA_ASM$PSEP$DOTTY_STAGING$PSEP$DOTTY_TASTY_INSPECTOR" diff --git a/dist/bin/dotc b/dist/bin/scalac similarity index 100% rename from dist/bin/dotc rename to dist/bin/scalac diff --git a/dist/bin/dotd b/dist/bin/scalad similarity index 97% rename from dist/bin/dotd rename to dist/bin/scalad index 5c9c6287097a..bc0378af956e 100755 --- a/dist/bin/dotd +++ b/dist/bin/scalad @@ -29,8 +29,8 @@ fi source "$PROG_HOME/bin/common" -# Set dotty-doc dep: -DOTTY_DOC_LIB=$(find_lib "*dotty-doc*") +# Set scala3-doc dep: +DOTTY_DOC_LIB=$(find_lib "*scala3-doc*") # Set flexmark deps: FLEXMARK_LIBS="" diff --git a/project/Build.scala b/project/Build.scala index 7f50e2ec0589..c88f1d25c0ab 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -114,11 +114,11 @@ object Build { // Spawns a repl with the correct classpath val repl = inputKey[Unit]("run the REPL with correct classpath") - // Used to compile files similar to ./bin/dotc script - val dotc = inputKey[Unit]("run the compiler using the correct classpath, or the user supplied classpath") + // Used to compile files similar to ./bin/scalac script + val scalac = inputKey[Unit]("run the compiler using the correct classpath, or the user supplied classpath") - // Used to run binaries similar to ./bin/dotr script - val dotr = inputKey[Unit]("run compiled binary using the correct classpath, or the user supplied classpath") + // Used to run binaries similar to ./bin/scala script + val scala = inputKey[Unit]("run compiled binary using the correct classpath, or the user supplied classpath") // Compiles the documentation and static site val genDocs = inputKey[Unit]("run dottydoc to generate static documentation site") @@ -557,7 +557,7 @@ object Build { } }.evaluated, - dotr := { + scala := { val args: List[String] = spaceDelimited("").parsed.toList val externalDeps = externalCompilerClasspathTask.value val jars = packageAll.value @@ -571,7 +571,7 @@ object Build { } if (args.isEmpty) { - println("Couldn't run `dotr` without args. Use `repl` to run the repl or add args to run the dotty application") + println("Couldn't run `scala` without args. Use `repl` to run the repl or add args to run the dotty application") } else if (scalaLib == "") { println("Couldn't find scala-library on classpath, please run using script in bin dir instead") } else if (args.contains("-with-compiler")) { @@ -586,8 +586,8 @@ object Build { } else run(args) }, - run := dotc.evaluated, - dotc := runCompilerMain().evaluated, + run := scalac.evaluated, + scalac := runCompilerMain().evaluated, repl := runCompilerMain(repl = true).evaluated, /* Add the sources of scalajs-ir. @@ -1021,7 +1021,7 @@ object Build { ( (dir / "shared/src/test/scala" ** (("*.scala": FileFilter) -- "ReflectiveCallTest.scala" // uses many forms of structural calls that are not allowed in Scala 3 anymore - -- "EnumerationTest.scala" // scala.Enumeration support for Scala.js is not implemented in dotc (yet) + -- "EnumerationTest.scala" // scala.Enumeration support for Scala.js is not implemented in scalac (yet) )).get ++ (dir / "shared/src/test/require-sam" ** "*.scala").get diff --git a/project/scripts/bootstrapCmdTests b/project/scripts/bootstrapCmdTests index 8aa518eddd7f..22f9b658dfd8 100755 --- a/project/scripts/bootstrapCmdTests +++ b/project/scripts/bootstrapCmdTests @@ -5,41 +5,41 @@ set -e source $(dirname $0)/cmdTestsCommon.inc.sh # check that benchmarks can run -"$SBT" "dotty-bench/jmh:run 1 1 tests/pos/alias.scala" +"$SBT" "scala3-bench/jmh:run 1 1 tests/pos/alias.scala" # The above is here as it relies on the bootstrapped library. -"$SBT" "dotty-bench-bootstrapped/jmh:run 1 1 tests/pos/alias.scala" -"$SBT" "dotty-bench-bootstrapped/jmh:run 1 1 -with-compiler compiler/src/dotty/tools/dotc/core/Types.scala" +"$SBT" "scala3-bench-bootstrapped/jmh:run 1 1 tests/pos/alias.scala" +"$SBT" "scala3-bench-bootstrapped/jmh:run 1 1 -with-compiler compiler/src/dotty/tools/dotc/core/Types.scala" -echo "testing scala.quoted.Expr.run from sbt dotr" -"$SBT" ";dotty-compiler-bootstrapped/dotc -with-compiler tests/run-staging/quote-run.scala; dotty-compiler-bootstrapped/dotr -with-compiler Test" > "$tmp" +echo "testing scala.quoted.Expr.run from sbt scala" +"$SBT" ";scala3-compiler-bootstrapped/scalac -with-compiler tests/run-staging/quote-run.scala; scala3-compiler-bootstrapped/scala -with-compiler Test" > "$tmp" grep -qe "val a: scala.Int = 3" "$tmp" -# setup for `dotc`/`dotr` script tests +# setup for `scalac`/`scala` script tests "$SBT" dist/pack -# check that `dotc` compiles and `dotr` runs it -echo "testing ./bin/dotc and ./bin/dotr" +# check that `scalac` compiles and `scala` runs it +echo "testing ./bin/scalac and ./bin/scala" clear_out "$OUT" -./bin/dotc "$SOURCE" -d "$OUT" -./bin/dotr -classpath "$OUT" "$MAIN" > "$tmp" +./bin/scalac "$SOURCE" -d "$OUT" +./bin/scala -classpath "$OUT" "$MAIN" > "$tmp" test "$EXPECTED_OUTPUT" = "$(cat "$tmp")" -# check that `dotc` and `dotr` works for staging +# check that `scalac` and `scala` works for staging clear_out "$OUT" -./bin/dotc tests/run-staging/i4044f.scala -d "$OUT" -./bin/dotr -with-compiler -classpath "$OUT" Test > "$tmp" -./bin/dotd -project Staging -siteroot "$OUT" "tests/run-staging/i4044f.scala" +./bin/scalac tests/run-staging/i4044f.scala -d "$OUT" +./bin/scala -with-compiler -classpath "$OUT" Test > "$tmp" +./bin/scalad -project Staging -siteroot "$OUT" "tests/run-staging/i4044f.scala" -# check that `dotc -from-tasty` compiles and `dotr` runs it -echo "testing ./bin/dotc -from-tasty and dotr -classpath" +# check that `scalac -from-tasty` compiles and `scala` runs it +echo "testing ./bin/scalac -from-tasty and scala -classpath" clear_out "$OUT1" -./bin/dotc -from-tasty -classpath "$OUT" -d "$OUT1" "$MAIN" -./bin/dotr -classpath "$OUT1" "$MAIN" > "$tmp" +./bin/scalac -from-tasty -classpath "$OUT" -d "$OUT1" "$MAIN" +./bin/scala -classpath "$OUT1" "$MAIN" > "$tmp" test "$EXPECTED_OUTPUT" = "$(cat "$tmp")" -# echo ":quit" | ./dist/target/pack/bin/dotr # not supported by CI +# echo ":quit" | ./dist/target/pack/bin/scala # not supported by CI -echo "testing ./bin/dotd" +echo "testing ./bin/scalad" clear_out "$OUT" -./bin/dotd -project Hello -siteroot "$OUT" "$SOURCE" +./bin/scalad -project Hello -siteroot "$OUT" "$SOURCE" diff --git a/project/scripts/cmdTests b/project/scripts/cmdTests index 0b6e5a889d3c..48a4299f9fe3 100755 --- a/project/scripts/cmdTests +++ b/project/scripts/cmdTests @@ -2,44 +2,44 @@ source $(dirname $0)/cmdTestsCommon.inc.sh -# check that `sbt dotc` compiles and `sbt dotr` runs it -echo "testing sbt dotc and dotr" -"$SBT" ";dotc $SOURCE -d $OUT ;dotr -classpath $OUT $MAIN" > "$tmp" +# check that `sbt scalac` compiles and `sbt scala` runs it +echo "testing sbt scalac and scala" +"$SBT" ";scalac $SOURCE -d $OUT ;scala -classpath $OUT $MAIN" > "$tmp" grep -qe "$EXPECTED_OUTPUT" "$tmp" -# check that `sbt dotc` compiles and `sbt dotr` runs it -echo "testing sbt dotc -from-tasty and dotr -classpath" +# check that `sbt scalac` compiles and `sbt scala` runs it +echo "testing sbt scalac -from-tasty and scala -classpath" clear_out "$OUT" -"$SBT" ";dotc $SOURCE -d $OUT ;dotc -from-tasty -classpath $OUT -d $OUT1 $MAIN ;dotr -classpath $OUT1 $MAIN" > "$tmp" +"$SBT" ";scalac $SOURCE -d $OUT ;scalac -from-tasty -classpath $OUT -d $OUT1 $MAIN ;scala -classpath $OUT1 $MAIN" > "$tmp" grep -qe "$EXPECTED_OUTPUT" "$tmp" -echo "testing sbt dotc -from-tasty from a jar and dotr -classpath" +echo "testing sbt scalac -from-tasty from a jar and scala -classpath" clear_out "$OUT" -"$SBT" ";dotc -d $OUT/out.jar $SOURCE ;dotc -from-tasty -d $OUT1 $OUT/out.jar ;dotr -classpath $OUT1 $MAIN" > "$tmp" +"$SBT" ";scalac -d $OUT/out.jar $SOURCE ;scalac -from-tasty -d $OUT1 $OUT/out.jar ;scala -classpath $OUT1 $MAIN" > "$tmp" grep -qe "$EXPECTED_OUTPUT" "$tmp" -# check that `sbt dotc -decompile` runs -echo "testing sbt dotc -decompile" -"$SBT" ";dotc -decompile -color:never -classpath $OUT $MAIN" > "$tmp" +# check that `sbt scalac -decompile` runs +echo "testing sbt scalac -decompile" +"$SBT" ";scalac -decompile -color:never -classpath $OUT $MAIN" > "$tmp" grep -qe "def main(args: scala.Array\[scala.Predef.String\]): scala.Unit =" "$tmp" -echo "testing sbt dotc -decompile from file" -"$SBT" ";dotc -decompile -color:never -classpath $OUT $OUT/$TASTY" > "$tmp" +echo "testing sbt scalac -decompile from file" +"$SBT" ";scalac -decompile -color:never -classpath $OUT $OUT/$TASTY" > "$tmp" grep -qe "def main(args: scala.Array\[scala.Predef.String\]): scala.Unit =" "$tmp" -echo "testing sbt dotr with no -classpath" +echo "testing sbt scala with no -classpath" clear_out "$OUT" -"$SBT" ";dotc $SOURCE ; dotr $MAIN" > "$tmp" +"$SBT" ";scalac $SOURCE ; scala $MAIN" > "$tmp" grep -qe "$EXPECTED_OUTPUT" "$tmp" echo "testing loading tasty from .tasty file in jar" clear_out "$OUT" -"$SBT" ";dotc -d $OUT/out.jar $SOURCE; dotc -decompile -classpath $OUT/out.jar -color:never $MAIN" > "$tmp" +"$SBT" ";scalac -d $OUT/out.jar $SOURCE; scalac -decompile -classpath $OUT/out.jar -color:never $MAIN" > "$tmp" grep -qe "def main(args: scala.Array\[scala.Predef.String\]): scala.Unit =" "$tmp" -echo "testing sbt dotc with suspension" +echo "testing sbt scalac with suspension" clear_out "$OUT" -"$SBT" "dotty-compiler-bootstrapped/dotc -d $OUT tests/pos-macros/macros-in-same-project-1/Bar.scala tests/pos-macros/macros-in-same-project-1/Foo.scala" > "$tmp" +"$SBT" "scala3-compiler-bootstrapped/scalac -d $OUT tests/pos-macros/macros-in-same-project-1/Bar.scala tests/pos-macros/macros-in-same-project-1/Foo.scala" > "$tmp" # check that missing source file does not crash message rendering echo "testing that missing source file does not crash message rendering" @@ -47,16 +47,16 @@ clear_out "$OUT" clear_out "$OUT1" cp tests/neg/i6371/A_1.scala $OUT/A.scala cp tests/neg/i6371/B_2.scala $OUT/B.scala -"$SBT" "dotc $OUT/A.scala -d $OUT1" +"$SBT" "scalac $OUT/A.scala -d $OUT1" rm $OUT/A.scala -"$SBT" "dotc -classpath $OUT1 -d $OUT1 $OUT/B.scala" > "$tmp" 2>&1 || echo "ok" +"$SBT" "scalac -classpath $OUT1 -d $OUT1 $OUT/B.scala" > "$tmp" 2>&1 || echo "ok" grep -qe "B.scala:2:7" "$tmp" ## Disabled because of flakeyness, should be changed to not depend on sbt # echo "running Vulpix meta test" # tmp=$(mktemp) -# if "$SBT" "dotty-compiler/testOnly dotty.tools.vulpix.VulpixMetaTests" > "$tmp" 2>&1; then +# if "$SBT" "scala3-compiler/testOnly dotty.tools.vulpix.VulpixMetaTests" > "$tmp" 2>&1; then # cat "$tmp" # echo "failed: sbt exited without error on VulpixMetaTests, these tests are expected to fail" # exit -1 diff --git a/project/scripts/genDocs b/project/scripts/genDocs index 2e0a4a12f81d..ec4cfddca037 100755 --- a/project/scripts/genDocs +++ b/project/scripts/genDocs @@ -25,7 +25,7 @@ git checkout "$GIT_HEAD" ### Generate the current snapshot of the website ### # this command will generate docs in $PWD/docs/_site SBT="$SCRIPT_DIR/sbt" -"$SBT" "dotty-bootstrapped/genDocs $GENDOC_EXTRA_ARGS" +"$SBT" "scala3-bootstrapped/genDocs $GENDOC_EXTRA_ARGS" # make sure that the previous command actually succeeded if [ ! -d "$SITE_OUT_DIR" ]; then From 17e978b5c10754843e9ca133c1d1e5870b7d9ade Mon Sep 17 00:00:00 2001 From: Anatolii Kmetiuk Date: Tue, 6 Oct 2020 18:07:42 +0200 Subject: [PATCH 08/13] Rename version file in the community build tests --- community-build/src/scala/dotty/communitybuild/projects.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/community-build/src/scala/dotty/communitybuild/projects.scala b/community-build/src/scala/dotty/communitybuild/projects.scala index bb6c99d29898..3856ce4e8b22 100644 --- a/community-build/src/scala/dotty/communitybuild/projects.scala +++ b/community-build/src/scala/dotty/communitybuild/projects.scala @@ -7,7 +7,7 @@ import java.nio.charset.StandardCharsets.UTF_8 lazy val communitybuildDir: Path = Paths.get(sys.props("user.dir")) lazy val compilerVersion: String = - val file = communitybuildDir.resolve("dotty-bootstrapped.version") + val file = communitybuildDir.resolve("scala3-bootstrapped.version") new String(Files.readAllBytes(file), UTF_8) lazy val sbtPluginFilePath: String = From d7fa69f27c7edc8673cd951b29a30e752bff63d9 Mon Sep 17 00:00:00 2001 From: Anatolii Kmetiuk Date: Fri, 9 Oct 2020 14:44:05 +0200 Subject: [PATCH 09/13] Update artefact names in SBT tests Fix the plugin name in dotty-knowledge-17 SBT test --- sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/build.sbt | 4 ++-- .../sbt-test/sbt-dotty/analyzer-plugin/changes/plugin.sbt | 6 +++--- .../sbt-test/sbt-dotty/analyzer-plugin/changes/retain.sbt | 6 +++--- sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/build.sbt | 4 ++-- .../sbt-test/sbt-dotty/compiler-plugin/changes/build.sbt | 8 ++++---- .../sbt-test/sbt-dotty/dotty-knowledge.i17/build.sbt | 2 +- sbt-dotty/sbt-test/sbt-dotty/i7897/build.sbt | 2 +- .../sbt-test/sbt-dotty/i7897/changes/build-no-fork.sbt | 2 +- .../sbt-test/sbt-dotty/quoted-example-project/build.sbt | 2 +- sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/test | 2 +- .../sbt-dotty/tasty-inspector-example-project/build.sbt | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/build.sbt b/sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/build.sbt index 088b6065932d..f060fd40a4d4 100644 --- a/sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/build.sbt +++ b/sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/build.sbt @@ -5,11 +5,11 @@ lazy val plugin = project .settings( name := "init-checker", version := "0.0.1", - organization := "ch.epfl.lamp", + organization := "org.scala-lang", scalaVersion := dottyVersion, libraryDependencies ++= Seq( - "ch.epfl.lamp" %% "dotty-compiler" % scalaVersion.value % "provided" + "org.scala-lang" %% "scala3-compiler" % scalaVersion.value % "provided" ) ) diff --git a/sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/changes/plugin.sbt b/sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/changes/plugin.sbt index 934a20f0f8e8..b88d69fb321e 100644 --- a/sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/changes/plugin.sbt +++ b/sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/changes/plugin.sbt @@ -5,11 +5,11 @@ lazy val plugin = project .settings( name := "init-checker", version := "0.0.1", - organization := "ch.epfl.lamp", + organization := "org.scala-lang", scalaVersion := dottyVersion, libraryDependencies ++= Seq( - "ch.epfl.lamp" %% "dotty-compiler" % scalaVersion.value % "provided" + "org.scala-lang" %% "scala3-compiler" % scalaVersion.value % "provided" ) ) @@ -23,6 +23,6 @@ lazy val app = project .in(file("app")) .settings( scalaVersion := dottyVersion, - addCompilerPlugin("ch.epfl.lamp" %% "init-checker" % "0.0.1") + addCompilerPlugin("org.scala-lang" %% "init-checker" % "0.0.1") ) .dependsOn(lib) diff --git a/sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/changes/retain.sbt b/sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/changes/retain.sbt index b88c32a95a2c..45db1708d90c 100644 --- a/sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/changes/retain.sbt +++ b/sbt-dotty/sbt-test/sbt-dotty/analyzer-plugin/changes/retain.sbt @@ -5,11 +5,11 @@ lazy val plugin = project .settings( name := "init-checker", version := "0.0.1", - organization := "ch.epfl.lamp", + organization := "org.scala-lang", scalaVersion := dottyVersion, libraryDependencies ++= Seq( - "ch.epfl.lamp" %% "dotty-compiler" % scalaVersion.value % "provided" + "org.scala-lang" %% "scala3-compiler" % scalaVersion.value % "provided" ) ) @@ -24,6 +24,6 @@ lazy val app = project .settings( scalaVersion := dottyVersion, scalacOptions += "-Yretain-trees", - addCompilerPlugin("ch.epfl.lamp" %% "init-checker" % "0.0.1") + addCompilerPlugin("org.scala-lang" %% "init-checker" % "0.0.1") ) .dependsOn(lib) diff --git a/sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/build.sbt b/sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/build.sbt index 9cb90384cffe..70bee151efb6 100644 --- a/sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/build.sbt +++ b/sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/build.sbt @@ -5,7 +5,7 @@ lazy val plugin = project .settings( name := "dividezero", version := "0.0.1", - organization := "ch.epfl.lamp", + organization := "org.scala-lang", scalaVersion := dottyVersion, scalacOptions ++= Seq( @@ -13,7 +13,7 @@ lazy val plugin = project ), libraryDependencies ++= Seq( - "ch.epfl.lamp" %% "dotty-compiler" % scalaVersion.value % "provided" + "org.scala-lang" %% "scala3-compiler" % scalaVersion.value % "provided" ) ) diff --git a/sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/changes/build.sbt b/sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/changes/build.sbt index 1c44853ecce4..6e7bcb894308 100644 --- a/sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/changes/build.sbt +++ b/sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/changes/build.sbt @@ -5,11 +5,11 @@ lazy val plugin = project .settings( name := "dividezero", version := "0.0.1", - organization := "ch.epfl.lamp", + organization := "org.scala-lang", scalaVersion := dottyVersion, libraryDependencies ++= Seq( - "ch.epfl.lamp" %% "dotty" % scalaVersion.value % "provided" + "org.scala-lang" %% "dotty" % scalaVersion.value % "provided" ) ) @@ -17,12 +17,12 @@ lazy val app = project .in(file("app")) .settings( scalaVersion := dottyVersion, - addCompilerPlugin("ch.epfl.lamp" %% "dividezero" % "0.0.1") + addCompilerPlugin("org.scala-lang" %% "dividezero" % "0.0.1") ) lazy val appOk = project .in(file("appOk")) .settings( scalaVersion := dottyVersion, - addCompilerPlugin("ch.epfl.lamp" %% "dividezero" % "0.0.1") + addCompilerPlugin("org.scala-lang" %% "dividezero" % "0.0.1") ) \ No newline at end of file diff --git a/sbt-dotty/sbt-test/sbt-dotty/dotty-knowledge.i17/build.sbt b/sbt-dotty/sbt-test/sbt-dotty/dotty-knowledge.i17/build.sbt index 108f70f83cca..e2257ff8296d 100644 --- a/sbt-dotty/sbt-test/sbt-dotty/dotty-knowledge.i17/build.sbt +++ b/sbt-dotty/sbt-test/sbt-dotty/dotty-knowledge.i17/build.sbt @@ -3,7 +3,7 @@ val dottyVersion = "0.22.0-RC1" lazy val root = project .in(file(".")) .settings( - name := "dotty-simple", + name := "scala3-simple", version := "0.1.0", scalaVersion := dottyVersion, diff --git a/sbt-dotty/sbt-test/sbt-dotty/i7897/build.sbt b/sbt-dotty/sbt-test/sbt-dotty/i7897/build.sbt index 0f1833c230ab..c9ebd0b08d97 100644 --- a/sbt-dotty/sbt-test/sbt-dotty/i7897/build.sbt +++ b/sbt-dotty/sbt-test/sbt-dotty/i7897/build.sbt @@ -1,5 +1,5 @@ scalaVersion := sys.props("plugin.scalaVersion") -libraryDependencies += "ch.epfl.lamp" %% "dotty-staging" % scalaVersion.value +libraryDependencies += "org.scala-lang" %% "scala3-staging" % scalaVersion.value fork := true diff --git a/sbt-dotty/sbt-test/sbt-dotty/i7897/changes/build-no-fork.sbt b/sbt-dotty/sbt-test/sbt-dotty/i7897/changes/build-no-fork.sbt index 802dff0748fe..ee40eef57124 100644 --- a/sbt-dotty/sbt-test/sbt-dotty/i7897/changes/build-no-fork.sbt +++ b/sbt-dotty/sbt-test/sbt-dotty/i7897/changes/build-no-fork.sbt @@ -1,5 +1,5 @@ scalaVersion := sys.props("plugin.scalaVersion") -libraryDependencies += "ch.epfl.lamp" %% "dotty-staging" % scalaVersion.value +libraryDependencies += "org.scala-lang" %% "scala3-staging" % scalaVersion.value fork := false diff --git a/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/build.sbt b/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/build.sbt index 5021215a4ac0..41d03bdfd0fb 100644 --- a/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/build.sbt +++ b/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/build.sbt @@ -1,6 +1,6 @@ scalaVersion := sys.props("plugin.scalaVersion") libraryDependencies ++= Seq( - "ch.epfl.lamp" %% "dotty-staging" % scalaVersion.value, + "org.scala-lang" %% "scala3-staging" % scalaVersion.value, "com.novocode" % "junit-interface" % "0.11" % "test" ) diff --git a/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/test b/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/test index ec42d25a874f..1aaea11a805a 100644 --- a/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/test +++ b/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/test @@ -2,4 +2,4 @@ > test $ copy-file src/changes/Hello.scala src/main/scala/hello/Hello.scala # -> compile FIXME: it succeeds, but should not (?) -# it should not compile because the compiler should not be on the compiler classpath when depending on dotty-staging +# it should not compile because the compiler should not be on the compiler classpath when depending on scala3-staging diff --git a/sbt-dotty/sbt-test/sbt-dotty/tasty-inspector-example-project/build.sbt b/sbt-dotty/sbt-test/sbt-dotty/tasty-inspector-example-project/build.sbt index 9169f4809813..1ae5c4e3a590 100644 --- a/sbt-dotty/sbt-test/sbt-dotty/tasty-inspector-example-project/build.sbt +++ b/sbt-dotty/sbt-test/sbt-dotty/tasty-inspector-example-project/build.sbt @@ -10,6 +10,6 @@ lazy val app = project .in(file("app")) .settings( scalaVersion := dottyVersion, - libraryDependencies += "ch.epfl.lamp" %% "dotty-tasty-inspector" % scalaVersion.value, + libraryDependencies += "org.scala-lang" %% "scala3-tasty-inspector" % scalaVersion.value, ) .dependsOn(lib) From 03d57489cf502db4f1e1a68449e8adc5481de846 Mon Sep 17 00:00:00 2001 From: Anatolii Kmetiuk Date: Tue, 13 Oct 2020 16:04:10 +0200 Subject: [PATCH 10/13] Set the secrets in the CI for the org.scala-lang organization --- .github/workflows/ci.yaml | 8 ++++---- project/Build.scala | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d736dae30718..57eefaa9f528 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -262,8 +262,8 @@ jobs: NIGHTLYBUILD: yes PGP_PW: ${{ secrets.PGP_PW }} # PGP passphrase PGP_SECRET: ${{ secrets.PGP_SECRET }} # Export your private and public PGP key to an *.asc file, take the file's contents as a string - SONATYPE_PW: ${{ secrets.SONATYPE_PW }} - SONATYPE_USER: ${{ secrets.SONATYPE_USER }} + SONATYPE_PW: ${{ secrets.SONATYPE_PW_ORGSCALALANG }} + SONATYPE_USER: ${{ secrets.SONATYPE_USER_ORGSCALALANG }} steps: - name: Checkout cleanup script @@ -366,8 +366,8 @@ jobs: RELEASEBUILD: yes PGP_PW: ${{ secrets.PGP_PW }} # PGP passphrase PGP_SECRET: ${{ secrets.PGP_SECRET }} # Export your private and public PGP key to an *.asc file, take the file's contents as a string - SONATYPE_PW: ${{ secrets.SONATYPE_PW }} - SONATYPE_USER: ${{ secrets.SONATYPE_USER }} + SONATYPE_PW: ${{ secrets.SONATYPE_PW_ORGSCALALANG }} + SONATYPE_USER: ${{ secrets.SONATYPE_USER_ORGSCALALANG }} steps: - name: Checkout cleanup script diff --git a/project/Build.scala b/project/Build.scala index c88f1d25c0ab..3fa9eb08433f 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1096,6 +1096,7 @@ object Build { settings( name := sbtDottyName, version := sbtDottyVersion, + organization := "ch.epfl.lamp", // Keep in sync with inject-sbt-dotty.sbt libraryDependencies ++= Seq( Dependencies.`jackson-databind`, From d9824693ae742323388ce58ef3dcc69f7b3aaf56 Mon Sep 17 00:00:00 2001 From: Anatolii Kmetiuk Date: Tue, 13 Oct 2020 16:10:49 +0200 Subject: [PATCH 11/13] Remove outdated features list from the front page --- docs/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/index.html b/docs/index.html index bcccf08c4dbc..ce55dbe02167 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,4 +6,3 @@ --- {% include logo-page.html %} {% include getting-started.html %} -{% include features.html %} From d1235d4bf97fc42b8454d00e652ebeaf316cc143 Mon Sep 17 00:00:00 2001 From: Anatolii Kmetiuk Date: Wed, 14 Oct 2020 15:29:14 +0200 Subject: [PATCH 12/13] Replace dotr -> scala and dotd -> scalad in the docs Replace dotc -> scalac in the docs --- docs/_includes/getting-started.html | 4 ++-- docs/docs/contributing/debug-tests.md | 8 +++---- docs/docs/contributing/debugging.md | 24 +++++++++---------- docs/docs/contributing/getting-started.md | 10 ++++---- docs/docs/contributing/testing.md | 8 +++---- docs/docs/contributing/workflow.md | 12 +++++----- docs/docs/internals/core-data-structures.md | 10 ++++---- docs/docs/internals/dotc-scalac.md | 6 ++--- docs/docs/internals/overall-structure.md | 8 +++---- docs/docs/internals/periods.md | 8 +++---- .../changed-features/compiler-plugins.md | 4 ++-- .../docs/reference/features-classification.md | 2 +- .../reference/metaprogramming/macros-spec.md | 2 +- .../docs/reference/metaprogramming/staging.md | 6 ++--- .../metaprogramming/tasty-inspect.md | 4 ++-- docs/docs/reference/new-types/match-types.md | 2 +- docs/docs/usage/getting-started.md | 16 ++++++------- 17 files changed, 67 insertions(+), 67 deletions(-) diff --git a/docs/_includes/getting-started.html b/docs/_includes/getting-started.html index cb7167a814eb..a0ad8e7f4c71 100644 --- a/docs/_includes/getting-started.html +++ b/docs/_includes/getting-started.html @@ -8,9 +8,9 @@

Try Dotty

If you are a Linux or Windows user, download the latest release. Optionally add path of the folder bin/ to the system environment variable PATH.

Now you can compile Scala source code:

-
dotc hello.scala
+
scalac hello.scala
-

To start the REPL, run: dotr.

+

To start the REPL, run: scala.

Or, you can try Dotty in your browser with Scastie.

diff --git a/docs/docs/contributing/debug-tests.md b/docs/docs/contributing/debug-tests.md index 89a220e9c0dd..7ca7f4e2a405 100644 --- a/docs/docs/contributing/debug-tests.md +++ b/docs/docs/contributing/debug-tests.md @@ -15,13 +15,13 @@ Both are usually pre-installed on macOS and linux distributions. First, compile the file `tests/debug/while.scala`: ```shell -$ dotc tests/debug/while.scala +$ scalac tests/debug/while.scala ``` Second, run the compiled class with debugging enabled (suppose the main class is `Test`): ```shell -$ dotr -d Test +$ scala -d Test ``` Third, start JDB: @@ -83,13 +83,13 @@ compiler/test/debug/Gen tests/debug/while.scala > robot First, compile the file `tests/debug/while.scala`: ```shell -$ dotc tests/debug/while.scala +$ scalac tests/debug/while.scala ``` Second, run the compiled class with debugging enabled: ```shell -$ dotr -d Test +$ scala -d Test ``` Finally, run the expect script: diff --git a/docs/docs/contributing/debugging.md b/docs/docs/contributing/debugging.md index 6b52a88b2b95..1eb9d2b29986 100644 --- a/docs/docs/contributing/debugging.md +++ b/docs/docs/contributing/debugging.md @@ -32,7 +32,7 @@ object Playground { } ``` -Then, you can debug Dotty by compiling this file via `dotc ../issues/Playground.scala` (from the SBT console) and collecting various debug output in process. This section documents techniques you can use to collect the debug info. +Then, you can debug Dotty by compiling this file via `scalac ../issues/Playground.scala` (from the SBT console) and collecting various debug output in process. This section documents techniques you can use to collect the debug info. [This](https://github.com/lampepfl/dotty/blob/10526a7d0aa8910729b6036ee51942e05b71abf6/compiler/src/dotty/tools/dotc/typer/Typer.scala#L2231) is the entry point to the Typer. The job of the Typer is to take an untyped tree, compute its type and turn it into a typed tree by attaching the type information to that tree. We will use this entry point to practice debugging techniques. E.g.: @@ -46,7 +46,7 @@ Then, you can debug Dotty by compiling this file via `dotc ../issues/Playground. Then: ```shell -dotc ../issues/Playground.scala +scalac ../issues/Playground.scala ``` The techniques discussed below can be tried out in place of `println("Hello Debug")` in that location. They are of course applicable throughout the codebase. @@ -70,9 +70,9 @@ if (tree.show == """println("Hello World")""") The intention above is to output an extended debug info on a tree that matches a particular human-readable representation. However, because of the color characters, the comparison will fail. -To disable color output from `show`, run `dotc` as follows: +To disable color output from `show`, run `scalac` as follows: -`dotc -color:never ../issues/Playground.scala` +`scalac -color:never ../issues/Playground.scala` ## Reporting as a non-intrusive println Consider you want to debug the `tree` that goes into `assertPositioned(tree)` in the `typed` method. You can do: @@ -94,19 +94,19 @@ assertPositioned(tree.reporting(s"Tree is: $result")) To print out the trees you are compiling after the FrontEnd (scanner, parser, namer, typer) phases: ```shell -dotc -Xprint:typer ../issues/Playground.scala +scalac -Xprint:typer ../issues/Playground.scala ``` To print out the trees after Frontend and CollectSuperCalls phases: ```shell -dotc -Xprint:typer,collectSuperCalls ../issues/Playground.scala +scalac -Xprint:typer,collectSuperCalls ../issues/Playground.scala ``` To print out the trees after all phases: ```shell -dotc -Xprint:all ../issues/Playground.scala +scalac -Xprint:all ../issues/Playground.scala ``` To find out the list of all the phases and their names, check out [this](https://github.com/lampepfl/dotty/blob/10526a7d0aa8910729b6036ee51942e05b71abf6/compiler/src/dotty/tools/dotc/Compiler.scala#L34) line in `Compiler.scala`. Each `Phase` object has `phaseName` defined on it, this is the phase name. @@ -119,7 +119,7 @@ object Foo object Foo ``` -Clearly we cannot define an object `Foo` twice. Now compile it as follows: `dotc -Ydebug-error ../issues/Playground.scala` (use whatever path you saved it under). The result will be as follows: +Clearly we cannot define an object `Foo` twice. Now compile it as follows: `scalac -Ydebug-error ../issues/Playground.scala` (use whatever path you saved it under). The result will be as follows: ```scala -- Error: ../issues/Playground.scala:2:0 --------------------------------------- @@ -173,7 +173,7 @@ val YprintPos: Setting[Boolean] = BooleanSetting("-Yprint-pos", "show tree posit And is to be used as: ```scala -dotc -Yprint-pos ../issues/Playground.scala +scalac -Yprint-pos ../issues/Playground.scala ``` If used, all the trees output with `show` or via `-Xprint:typer` will also have positions attached to them, e.g.: @@ -204,7 +204,7 @@ package @ { Every [Positioned](https://github.com/lampepfl/dotty/blob/10526a7d0aa8910729b6036ee51942e05b71abf6/compiler/src/dotty/tools/dotc/ast/Positioned.scala) (a parent class of `Tree`) object has a `uniqueId` field. It is an integer that is unique for that tree and doesn't change from compile run to compile run. You can output these IDs from any printer (such as the ones used by `.show` and `-Xprint`) via `-Yshow-tree-ids` flag, e.g.: ```shell -dotc -Xprint:typer -Yshow-tree-ids ../issues/Playground.scala +scalac -Xprint:typer -Yshow-tree-ids ../issues/Playground.scala ``` Gives: @@ -229,7 +229,7 @@ package #1047 { You can then use these IDs to locate the creation site of a given tree using that ID via `-Ydebug-tree-with-id`, e.g.: ```shell -dotc -Ydebug-tree-with-id 1049 ../issues/Playground.scala +scalac -Ydebug-tree-with-id 1049 ../issues/Playground.scala ``` When the tree with the correspond id is allocated, the following prompt will appear: @@ -363,4 +363,4 @@ trace.force(i"typing $tree", typr, show = true) { // ... ``` ### Reporter -Defined in [Reporter.scala](https://github.com/lampepfl/dotty/blob/10526a7d0aa8910729b6036ee51942e05b71abf6/compiler/src/dotty/tools/dotc/reporting/Reporter.scala). Enables calls such as `report.log`. To enable, run dotc with `-Ylog:typer` option. +Defined in [Reporter.scala](https://github.com/lampepfl/dotty/blob/10526a7d0aa8910729b6036ee51942e05b71abf6/compiler/src/dotty/tools/dotc/reporting/Reporter.scala). Enables calls such as `report.log`. To enable, run scalac with `-Ylog:typer` option. diff --git a/docs/docs/contributing/getting-started.md b/docs/docs/contributing/getting-started.md index 142c9282d64f..da55cf4fe09d 100644 --- a/docs/docs/contributing/getting-started.md +++ b/docs/docs/contributing/getting-started.md @@ -25,8 +25,8 @@ all be done from within sbt: ```bash $ sbt -> dotc tests/pos/HelloWorld.scala -> dotr HelloWorld +> scalac tests/pos/HelloWorld.scala +> scala HelloWorld hello world ``` @@ -41,10 +41,10 @@ and you will be able to run the corresponding commands directly from your consol ```shell # Compile code using Dotty -$ dotc tests/pos/HelloWorld.scala +$ scalac tests/pos/HelloWorld.scala # Run it with the proper classpath -$ dotr HelloWorld +$ scala HelloWorld ``` @@ -62,7 +62,7 @@ scala> or via bash: ```bash -$ dotr +$ scala ``` diff --git a/docs/docs/contributing/testing.md b/docs/docs/contributing/testing.md index cd2b6431a8de..7b1cb58fa4bc 100644 --- a/docs/docs/contributing/testing.md +++ b/docs/docs/contributing/testing.md @@ -9,9 +9,9 @@ Running all tests in Dotty is as simple as: $ sbt test ``` -Specifically, `sbt test` runs all tests that do _not_ require a bootstrapped -compiler. In practice, this means that it runs all compilation tests meeting -this criterion, as well as all non-compiler tests. +Specifically, `sbt test` runs all tests that do _not_ require a bootstrapped +compiler. In practice, this means that it runs all compilation tests meeting +this criterion, as well as all non-compiler tests. The entire suite of tests can be run using the bootstrapped compiler as follows: @@ -87,7 +87,7 @@ Test output dumped in: tests/playground/neg/Sample.check.out To create a checkfile for a test, you can do one of the following: - Create a dummy checkfile with a random content, run the test, and, when it fails, use the `mv` command reported by the test to replace the dummy checkfile with the actual output. -- Manually compile the file you are testing with `dotc` and copy-paste whatever console output the compiler produces to the checkfile. +- Manually compile the file you are testing with `scalac` and copy-paste whatever console output the compiler produces to the checkfile. ## Integration tests These tests are Scala source files expected to compile with Dotty (pos tests), diff --git a/docs/docs/contributing/workflow.md b/docs/docs/contributing/workflow.md index f847cb708be0..ee2853c6dfaf 100644 --- a/docs/docs/contributing/workflow.md +++ b/docs/docs/contributing/workflow.md @@ -6,19 +6,19 @@ title: Workflow Check [Getting Started](getting-started.md) for instructions on how to obtain the source code of dotty. This document details common workflow patterns when working with Dotty. -## Compiling files with dotc ## +## Compiling files with scalac ## As we have seen you can compile a test file either from sbt: ```bash $ sbt -> dotc +> scalac ``` or from terminal: ```bash -$ dotc +$ scalac ``` Here are some useful debugging ``: @@ -60,7 +60,7 @@ u: dotty.tools.dotc.core.Types.Type = TypeBounds(TypeRef(ThisType(TypeRef(NoPref ``` ## Pretty-printing ## -Many objects in the dotc compiler implement a `Showable` trait (e.g. `Tree`, +Many objects in the scalac compiler implement a `Showable` trait (e.g. `Tree`, `Symbol`, `Type`). These objects may be prettyprinted using the `.show` method @@ -70,8 +70,8 @@ The basics of working with Dotty codebase are documented [here](https://dotty.ep | Command | Description | |------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------| -| `dotc ../issues/Playground.scala` | Compile the given file – path relative to the Dotty directory. Output the compiled class files to the Dotty directory itself. | -| `dotr Playground` | Run the compiled class `Playground`. Dotty directory is on classpath by default. | +| `scalac ../issues/Playground.scala` | Compile the given file – path relative to the Dotty directory. Output the compiled class files to the Dotty directory itself. | +| `scala Playground` | Run the compiled class `Playground`. Dotty directory is on classpath by default. | | `repl` | Start REPL | | `testOnly dotty.tools.dotc.CompilationTests -- *pos` | Run test (method) `pos` from `CompilationTests` suite. | | `testCompilation sample` | In all test suites, run test files containing the word `sample` in their title. | diff --git a/docs/docs/internals/core-data-structures.md b/docs/docs/internals/core-data-structures.md index 623114aa3270..d42a24f0e426 100644 --- a/docs/docs/internals/core-data-structures.md +++ b/docs/docs/internals/core-data-structures.md @@ -19,7 +19,7 @@ by tne A symbol refers to a definition in a source program. Traditionally, compilers store context-dependent data in a _symbol table_. The symbol then is the central reference to address context-dependent - data. But for `dotc`'s requirements it turns out that symbols are + data. But for `scalac`'s requirements it turns out that symbols are both too little and too much for this task. Too little: The attributes of a symbol depend on the phase. Examples: @@ -32,23 +32,23 @@ a trait). So a functional compiler, a `Symbol` by itself met mean much. Instead we are more interested in the attributes of a symbol at a given phase. -`dotc` has a concept for "attributes of a symbol at +`scalac` has a concept for "attributes of a symbol at Too much: If a symbol is used to refer to a definition in another compilation unit, we get problems for incremental recompilation. The unit containing the symbol might be changed and recompiled, which might mean that the definition referred to by the symbol is deleted or changed. This leads to the problem of stale symbols that refer to -definitions that no longer exist in this form. `scalac` tried to +definitions that no longer exist in this form. Scala 2 compiler tried to address this problem by _rebinding_ symbols appearing in certain cross module references, but it turned out to be too difficult to do this -reliably for all kinds of references. `dotc` attacks the problem at +reliably for all kinds of references. Scala 3 compiler attacks the problem at the root instead. The fundamental problem is that symbols are too specific to serve as a cross-module reference in a system with incremental compilation. They refer to a particular definition, but that definition may not persist unchanged after an edit. -`dotc` uses instead a different approach: A cross module reference is +`scalac` uses instead a different approach: A cross module reference is always type, either a `TermRef` or ` TypeRef`. A reference type contains a prefix type and a name. The definition the type refers to is established dynamically based on these fields. diff --git a/docs/docs/internals/dotc-scalac.md b/docs/docs/internals/dotc-scalac.md index 8949d9cf1f9a..a8de3bfff00e 100644 --- a/docs/docs/internals/dotc-scalac.md +++ b/docs/docs/internals/dotc-scalac.md @@ -44,14 +44,14 @@ only be applied if an implicit `Context` is in scope. ### Symbol ### * `Symbol` instances have a `SymDenotation` -* Most symbol properties in scalac are now in the denotation (in dotc) +* Most symbol properties in the Scala 2 compiler are now in the denotation (in the Scala 3 compiler). Most of the `isFooBar` properties in scalac don't exist anymore in dotc. Use flag tests instead, for example: ```scala -if (sym.isPackageClass) // scalac -if (sym is Flags.PackageClass) // dotc (*) +if (sym.isPackageClass) // Scala 2 +if (sym is Flags.PackageClass) // Scala 3 (*) ``` `(*)` Symbols are implicitly converted to their denotation, see above. Each diff --git a/docs/docs/internals/overall-structure.md b/docs/docs/internals/overall-structure.md index 6b3765471be1..190dfe5814f6 100644 --- a/docs/docs/internals/overall-structure.md +++ b/docs/docs/internals/overall-structure.md @@ -20,7 +20,7 @@ classes, [Compiler] and [Run]. Package Structure ----------------- -Most functionality of `dotc` is implemented in subpackages of `dotc`. Here's a +Most functionality of `scalac` is implemented in subpackages of `dotc`. Here's a list of sub-packages and their focus. ``` @@ -44,10 +44,10 @@ list of sub-packages and their focus. Contexts -------- -`dotc` has almost no global state (the only significant bit of global state is +`scalac` has almost no global state (the only significant bit of global state is the name table, which is used to hash strings into unique names). Instead, all essential bits of information that can vary over a compiler run are collected -in a [Context]. Most methods in `dotc` take a `Context` value as an implicit +in a [Context]. Most methods in `scalac` take a `Context` value as an implicit parameter. Contexts give a convenient way to customize values in some part of the @@ -88,7 +88,7 @@ a problem. Compiler Phases --------------- -Seen from a temporal perspective, the `dotc` compiler consists of a list of +Seen from a temporal perspective, the `scalac` compiler consists of a list of phases. The current list of phases is specified in class [Compiler] as follows: ```scala diff --git a/docs/docs/internals/periods.md b/docs/docs/internals/periods.md index 05123298617c..46241da0bb17 100644 --- a/docs/docs/internals/periods.md +++ b/docs/docs/internals/periods.md @@ -3,14 +3,14 @@ layout: doc-page title: "Dotc's concept of time" --- -Conceptually, the `dotc` compiler's job is to maintain views of various +Conceptually, the `scalac` compiler's job is to maintain views of various artifacts associated with source code at all points in time. But what is -*time* for `dotc`? In fact, it is a combination of compiler runs and compiler +*time* for `scalac`? In fact, it is a combination of compiler runs and compiler phases. The *hours* of the compiler's clocks are measured in compiler [runs]. Every run creates a new hour, which follows all the compiler runs (hours) that happened -before. `dotc` is designed to be used as an incremental compiler that can +before. `scalac` is designed to be used as an incremental compiler that can support incremental builds, as well as interactions in an IDE and a REPL. This means that new runs can occur quite frequently. At the extreme, every keystroke in an editor or REPL can potentially launch a new compiler run, so @@ -32,7 +32,7 @@ lower-level JVM view. There are different ways to deal with this. Many compilers change the type of a symbol destructively according to the "current phase". Another, more functional approach might be to have different symbols representing the same definition at different phases, which each symbol -carrying a different immutable type. `dotc` employs yet another scheme, which +carrying a different immutable type. `scalac` employs yet another scheme, which is inspired by functional reactive programming (FRP): Symbols carry not a single type, but a function from compiler phase to type. So the type of a symbol is a time-indexed function, where time ranges over compiler phases. diff --git a/docs/docs/reference/changed-features/compiler-plugins.md b/docs/docs/reference/changed-features/compiler-plugins.md index 92cb75e0d6bf..7cd178a2927d 100644 --- a/docs/docs/reference/changed-features/compiler-plugins.md +++ b/docs/docs/reference/changed-features/compiler-plugins.md @@ -25,10 +25,10 @@ _standard plugins_ in Dotty. In terms of features, they are similar to ## Using Compiler Plugins -Both standard and research plugins can be used with `dotc` by adding the `-Xplugin:` option: +Both standard and research plugins can be used with `scalac` by adding the `-Xplugin:` option: ```shell -dotc -Xplugin:pluginA.jar -Xplugin:pluginB.jar Test.scala +scalac -Xplugin:pluginA.jar -Xplugin:pluginB.jar Test.scala ``` The compiler will examine the jar provided, and look for a property file named diff --git a/docs/docs/reference/features-classification.md b/docs/docs/reference/features-classification.md index 1b74cde065c9..c0018549ac27 100644 --- a/docs/docs/reference/features-classification.md +++ b/docs/docs/reference/features-classification.md @@ -197,6 +197,6 @@ The new type-checking and inference algorithms are the essential core of the new Some existing programs will break and, given the complex nature of type inference, it will not always be clear what change caused the breakage and how to fix it. -In our experience, macros and changes in type and implicit argument inference together cause the large majority of problems encountered when porting existing code to Scala 3. The latter source of problems could be addressed systematically by a tool that added all inferred types and implicit arguments to a Scala 2 source code file. Most likely such a tool would be implemented as a Scala 2 compiler plugin. The resulting code would have a greatly increased likelihood to compile under Scala 3, but would often be bulky to the point of being unreadable. A second part of the rewriting tool should then selectively and iteratively remove type and implicit annotations that were synthesized by the first part as long as they compile under Scala 3. This second part could be implemented as a program that invokes the Scala 3 compiler `dotc` programmatically. +In our experience, macros and changes in type and implicit argument inference together cause the large majority of problems encountered when porting existing code to Scala 3. The latter source of problems could be addressed systematically by a tool that added all inferred types and implicit arguments to a Scala 2 source code file. Most likely such a tool would be implemented as a Scala 2 compiler plugin. The resulting code would have a greatly increased likelihood to compile under Scala 3, but would often be bulky to the point of being unreadable. A second part of the rewriting tool should then selectively and iteratively remove type and implicit annotations that were synthesized by the first part as long as they compile under Scala 3. This second part could be implemented as a program that invokes the Scala 3 compiler `scalac` programmatically. Several people have proposed such a tool for some time now. I believe it is time we find the will and the resources to actually implement it. \ No newline at end of file diff --git a/docs/docs/reference/metaprogramming/macros-spec.md b/docs/docs/reference/metaprogramming/macros-spec.md index 9129bd00b5fe..456e530eeeb4 100644 --- a/docs/docs/reference/metaprogramming/macros-spec.md +++ b/docs/docs/reference/metaprogramming/macros-spec.md @@ -21,7 +21,7 @@ In addition, an identifier `$x` starting with a `$` that appears inside a quoted expression or type is treated as a splice `${x}` and a quoted identifier `'x` that appears inside a splice is treated as a quote `'{x}` -### Implementation in `dotc` +### Implementation in `scalac` Quotes and splices are primitive forms in the generated abstract syntax trees. Top-level splices are eliminated during macro expansion while typing. On the diff --git a/docs/docs/reference/metaprogramming/staging.md b/docs/docs/reference/metaprogramming/staging.md index 1a64d698093c..ec0537b62e81 100644 --- a/docs/docs/reference/metaprogramming/staging.md +++ b/docs/docs/reference/metaprogramming/staging.md @@ -87,11 +87,11 @@ In case you prefer to create the project on your own, make sure to define the fo libraryDependencies += "ch.epfl.lamp" %% "dotty-staging" % scalaVersion.value ``` -and in case you use `dotc`/`dotr` directly, then use the `-with-compiler` flag for both: +and in case you use `scalac`/`scala` directly, then use the `-with-compiler` flag for both: ```shell -dotc -with-compiler -d out Test.scala -dotr -with-compiler -classpath out Test +scalac -with-compiler -d out Test.scala +scala -with-compiler -classpath out Test ``` ## Example diff --git a/docs/docs/reference/metaprogramming/tasty-inspect.md b/docs/docs/reference/metaprogramming/tasty-inspect.md index fc2764d8dd18..78f6741c00ab 100644 --- a/docs/docs/reference/metaprogramming/tasty-inspect.md +++ b/docs/docs/reference/metaprogramming/tasty-inspect.md @@ -46,8 +46,8 @@ Note that if we need to run the main (in the example below defined in an object compilation we need to make the compiler available to the runtime: ```shell -dotc -d out Test.scala -dotr -with-compiler -classpath out Test +scalac -d out Test.scala +scala -with-compiler -classpath out Test ``` diff --git a/docs/docs/reference/new-types/match-types.md b/docs/docs/reference/new-types/match-types.md index 50563243d5ce..4d4753325d3a 100644 --- a/docs/docs/reference/new-types/match-types.md +++ b/docs/docs/reference/new-types/match-types.md @@ -212,7 +212,7 @@ def g[X]: L[X] = ??? | subtype LazyRef(Test.L[Int]) <:< Int ``` -Internally, `dotc` detects these cycles by turning selected stack overflows into +Internally, `scalac` detects these cycles by turning selected stack overflows into type errors. If there is a stack overflow during subtyping, the exception will be caught and turned into a compile-time error that indicates a trace of the subtype tests that caused the overflow without showing a full stack trace. diff --git a/docs/docs/usage/getting-started.md b/docs/docs/usage/getting-started.md index cf9faf835d29..41e019169a70 100644 --- a/docs/docs/usage/getting-started.md +++ b/docs/docs/usage/getting-started.md @@ -37,28 +37,28 @@ Start using the Dotty IDE in any Dotty project by following the ### Standalone installation Releases are available for download on the [Releases Section](https://github.com/lampepfl/dotty/releases) -of the Dotty repository. Releases include three executables: `dotc` the Dotty compiler, -`dotd` the [Dotty Documentation tool](./dottydoc.md) and `dotr` the Dotty REPL. +of the Dotty repository. Releases include three executables: `scalac` the Dotty compiler, +`scalad` the [Dotty Documentation tool](./dottydoc.md) and `scala` the Dotty REPL. ``` . └── bin -    ├── dotc -    ├── dotd -    └── dotr +    ├── scalac +    ├── scalad +    └── scala ``` Add these executables to your `PATH` and you will be able to run the corresponding commands directly from your console: ```bash # Compile code using Dotty -$ dotc HelloWorld.scala +$ scalac HelloWorld.scala # Run it with the proper classpath -$ dotr HelloWorld +$ scala HelloWorld # Start a Dotty REPL -$ dotr +$ scala Starting dotty REPL... scala> ``` From 96f78295fe6b4cdd387065fe5aa57d6c6a25148c Mon Sep 17 00:00:00 2001 From: Anatolii Kmetiuk Date: Thu, 15 Oct 2020 16:23:12 +0200 Subject: [PATCH 13/13] Fix clean command Co-authored-by: Guillaume Martres --- project/Build.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Build.scala b/project/Build.scala index 3fa9eb08433f..97f111b77f78 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1332,7 +1332,7 @@ object Build { nonBootstrappedSettings( addCommandAlias("run", "scala3-compiler/run"), // Clean everything by default - addCommandAlias("clean", ";dotty/clean;scala3-bootstrapped/clean"), + addCommandAlias("clean", ";scala3/clean;scala3-bootstrapped/clean"), // `publishLocal` on the non-bootstrapped compiler does not produce a // working distribution (it can't in general, since there's no guarantee // that the non-bootstrapped library is compatible with the