Skip to content

Commit ffbca37

Browse files
Remove scala-backend submodule
1 parent 703932a commit ffbca37

File tree

8 files changed

+6
-151
lines changed

8 files changed

+6
-151
lines changed

.gitmodules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
[submodule "scala-backend"]
2-
path = scala-backend
3-
url = https://github.com/lampepfl/scala.git
4-
branch = sharing-backend
51
[submodule "scala2-library"]
62
path = scala2-library
73
url = https://github.com/lampepfl/scala.git

.vscode-template/settings.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
"**/target/": true,
1212
"community-build/community-projects": true,
1313
"scala2-library/{doc,docs,lib,META-INF,scripts,spec,test,tools}/": true, // only allow scala-backend/src
14-
"scala2-library/src/[abcefimprs]*": true, // only allow scala-backend/src/library
15-
"scala-backend/{doc,docs,lib,META-INF,scripts,spec,test,tools}/": true, // only allow scala-backend/src
16-
"scala-backend/src/[abefilmprs]*": true, // only allow scala-backend/src/compiler
17-
"scala-backend/src/scala/reflect/": true,
18-
"scala-backend/src/scala/tools/{ant,cmd,reflect,util}*": true,
19-
"scala-backend/src/scala/tools/nsc/*.scala": true,
20-
"scala-backend/src/scala/tools/nsc/[aijrstu]*": true // only allow scala-backend/src/scala/tools/nsc/backend
14+
"scala2-library/src/[abcefimprs]*": true
2115
}
2216
}

compiler/src/scala/tools/nsc/io/package.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ package scala.tools.nsc
66
* Our backend is based on the Scala 2.11 GenBCode backend and modified so that
77
* it compiles both with dotty and scalac, since the backend uses
88
* scala.tools.nsc.io.*, we need to also provide it.
9-
*
10-
* See http://dotty.epfl.ch/docs/contributing/backend.html for more information.
119
*/
1210
package object io {
1311
type AbstractFile = dotty.tools.io.AbstractFile

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

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import scala.concurrent.duration._
1515
import vulpix._
1616
import dotty.tools.io.JFile
1717

18-
1918
class CompilationTests extends ParallelTesting {
2019
import ParallelTesting._
2120
import TestConfiguration._
@@ -239,25 +238,11 @@ class CompilationTests extends ParallelTesting {
239238
val compilerDir = Paths.get("compiler/src")
240239
val compilerSources = sources(Files.walk(compilerDir))
241240

242-
val backendDir = Paths.get("scala-backend/src/compiler/scala/tools/nsc/backend")
243-
val backendJvmDir = Paths.get("scala-backend/src/compiler/scala/tools/nsc/backend/jvm")
244241
val scalaJSIRDir = Paths.get("compiler/target/scala-2.12/src_managed/main/scalajs-ir-src/org/scalajs/ir")
242+
val scalaJSIRSources = sources(Files.list(scalaJSIRDir))
245243

246-
// NOTE: Keep these exclusions synchronized with the ones in the sbt build (Build.scala)
247-
val backendExcluded =
248-
List("JavaPlatform.scala", "Platform.scala", "ScalaPrimitives.scala")
249-
val backendJvmExcluded =
250-
List("BCodeICodeCommon.scala", "GenASM.scala", "GenBCode.scala", "ScalacBackendInterface.scala", "BackendStats.scala", "BCodeAsmEncode.scala")
251-
252-
val backendSources =
253-
sources(Files.list(backendDir), excludedFiles = backendExcluded)
254-
val backendJvmSources =
255-
sources(Files.list(backendJvmDir), excludedFiles = backendJvmExcluded)
256-
val scalaJSIRSources =
257-
sources(Files.list(scalaJSIRDir))
258-
259-
val dotty1 = compileList("dotty", compilerSources ++ backendSources ++ backendJvmSources ++ scalaJSIRSources, opt)(dotty1Group)
260-
val dotty2 = compileList("dotty", compilerSources ++ backendSources ++ backendJvmSources ++ scalaJSIRSources, opt)(dotty2Group)
244+
val dotty1 = compileList("dotty", compilerSources ++ scalaJSIRSources, opt)(dotty1Group)
245+
val dotty2 = compileList("dotty", compilerSources ++ scalaJSIRSources, opt)(dotty2Group)
261246

262247
val tests = {
263248
lib.keepOutput :: dotty1.keepOutput :: {
@@ -273,8 +258,8 @@ class CompilationTests extends ParallelTesting {
273258
compileShallowFilesInDir("compiler/src/dotty/tools/dotc/transform", opt) +
274259
compileShallowFilesInDir("compiler/src/dotty/tools/dotc/typer", opt) +
275260
compileShallowFilesInDir("compiler/src/dotty/tools/dotc/util", opt) +
276-
compileList("shallow-backend", backendSources, opt) +
277-
compileList("shallow-backend-jvm", backendJvmSources, opt) +
261+
compileShallowFilesInDir("compiler/src/scala/tools/nsc/backend", opt) +
262+
compileShallowFilesInDir("compiler/src/scala/tools/nsc/backend/jvm", opt) +
278263
compileList("shallow-scalajs-ir", scalaJSIRSources, opt)
279264
}.keepOutput :: Nil
280265
}.map(_.checkCompile())

docs/docs/contributing/backend.md

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

docs/sidebar.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@ sidebar:
145145
url: docs/contributing/intellij-idea.html
146146
- title: Testing
147147
url: docs/contributing/testing.html
148-
- title: Working with the Backend
149-
url: docs/contributing/backend.html
150148
- title: Internals
151149
subsection:
152150
- title: Backend

project/Build.scala

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -464,48 +464,6 @@ object Build {
464464

465465
// Settings shared between dotty-compiler and dotty-compiler-bootstrapped
466466
lazy val commonDottyCompilerSettings = Seq(
467-
468-
// The scala-backend folder is a git submodule that contains a fork of the Scala 2.11
469-
// compiler developed at https://github.com/lampepfl/scala/tree/sharing-backend.
470-
// We do not compile the whole submodule, only the part of the Scala 2.11 GenBCode backend
471-
// that we reuse for dotty.
472-
// See http://dotty.epfl.ch/docs/contributing/backend.html for more information.
473-
//
474-
// NOTE: We link (or copy if symbolic links are not supported) these sources in
475-
// the current project using `sourceGenerators` instead of simply
476-
// referencing them using `unmanagedSourceDirectories` because the latter
477-
// breaks some IDEs.
478-
sourceGenerators in Compile += Def.task {
479-
val outputDir = (sourceManaged in Compile).value
480-
481-
val submoduleCompilerDir = baseDirectory.value / ".." / "scala-backend" / "src" / "compiler"
482-
val backendDir = submoduleCompilerDir / "scala" / "tools" / "nsc" / "backend"
483-
val allScalaFiles = GlobFilter("*.scala")
484-
485-
// NOTE: Keep these exclusions synchronized with the ones in the tests (CompilationTests.scala)
486-
val files = ((backendDir *
487-
(allScalaFiles - "JavaPlatform.scala" - "Platform.scala" - "ScalaPrimitives.scala")) +++
488-
(backendDir / "jvm") *
489-
(allScalaFiles - "BCodeICodeCommon.scala" - "GenASM.scala" - "GenBCode.scala" - "ScalacBackendInterface.scala" - "BackendStats.scala")
490-
).get
491-
492-
val pairs = files.pair(sbt.Path.rebase(submoduleCompilerDir, outputDir))
493-
494-
try {
495-
pairs.foreach { case (src, dst) =>
496-
sbt.IO.createDirectory(dst.getParentFile)
497-
if (!dst.exists)
498-
Files.createSymbolicLink(/*link = */ dst.toPath, /*existing = */src.toPath)
499-
}
500-
} catch {
501-
case _: UnsupportedOperationException | _: FileSystemException =>
502-
// If the OS doesn't support symbolic links, copy the directory instead.
503-
sbt.IO.copy(pairs, CopyOptions(overwrite = true, preserveLastModified = true, preserveExecutable = true))
504-
}
505-
506-
pairs.map(_._2)
507-
}.taskValue,
508-
509467
// set system in/out for repl
510468
connectInput in run := true,
511469
outputStrategy := Some(StdoutOutput),

scala-backend

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

0 commit comments

Comments
 (0)