From f0473038f0b5506e926f171e601ee0bfd70cc034 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Wed, 24 Sep 2025 19:05:21 +0200 Subject: [PATCH 1/2] chore: drop dependency management in the CB --- .github/workflows/ci.yaml | 2 +- build.sbt | 1 - .../communitybuild/CommunityBuildRunner.scala | 2 - .../scala/dotty/communitybuild/projects.scala | 97 ++----------------- project/Build.scala | 44 +-------- .../inter-project-transitive-dep/build.sbt | 23 ----- .../project/ThisTestPlugin.scala | 33 ------- .../project/plugins.sbt | 2 - .../inter-project-transitive-dep/test | 10 -- .../multiple-deps/build.sbt | 26 ----- .../project/ThisTestPlugin.scala | 33 ------- .../multiple-deps/project/plugins.sbt | 2 - .../sbt-community-build/multiple-deps/test | 11 --- .../sbt-community-build/scalajs/build.sbt | 32 ------ .../scalajs/project/ThisTestPlugin.scala | 33 ------- .../scalajs/project/plugins.sbt | 3 - .../sbt-test/sbt-community-build/scalajs/test | 13 --- .../sbt-community-build/single-dep/build.sbt | 16 --- .../single-dep/project/ThisTestPlugin.scala | 33 ------- .../single-dep/project/plugins.sbt | 2 - .../sbt-community-build/single-dep/test | 10 -- .../transitive-dep/build.sbt | 23 ----- .../project/ThisTestPlugin.scala | 33 ------- .../transitive-dep/project/plugins.sbt | 2 - .../sbt-community-build/transitive-dep/test | 13 --- .../sbtplugin/CommunityBuildPlugin.scala | 86 ---------------- 26 files changed, 9 insertions(+), 576 deletions(-) delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/inter-project-transitive-dep/build.sbt delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/inter-project-transitive-dep/project/ThisTestPlugin.scala delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/inter-project-transitive-dep/project/plugins.sbt delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/inter-project-transitive-dep/test delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/multiple-deps/build.sbt delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/multiple-deps/project/ThisTestPlugin.scala delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/multiple-deps/project/plugins.sbt delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/multiple-deps/test delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/scalajs/build.sbt delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/scalajs/project/ThisTestPlugin.scala delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/scalajs/project/plugins.sbt delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/scalajs/test delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/single-dep/build.sbt delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/single-dep/project/ThisTestPlugin.scala delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/single-dep/project/plugins.sbt delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/single-dep/test delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/transitive-dep/build.sbt delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/transitive-dep/project/ThisTestPlugin.scala delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/transitive-dep/project/plugins.sbt delete mode 100644 sbt-community-build/sbt-test/sbt-community-build/transitive-dep/test delete mode 100644 sbt-community-build/src/dotty/communitybuild/sbtplugin/CommunityBuildPlugin.scala diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 432f1fa5e738..953fa83aebe4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -390,7 +390,7 @@ jobs: run: cp -vf .github/workflows/repositories /root/.sbt/ ; true - name: Test sbt - run: ./project/scripts/sbt "sbt-test/scripted; sbt-community-build/scripted" + run: ./project/scripts/sbt "sbt-test/scripted" publish_release: permissions: diff --git a/build.sbt b/build.sbt index 59b20bb241f5..3af7481b4467 100644 --- a/build.sbt +++ b/build.sbt @@ -47,7 +47,6 @@ val `dist-win-x86_64` = Build.`dist-win-x86_64` val `dist-linux-x86_64` = Build.`dist-linux-x86_64` val `dist-linux-aarch64` = Build.`dist-linux-aarch64` val `community-build` = Build.`community-build` -val `sbt-community-build` = Build.`sbt-community-build` val `scala3-presentation-compiler` = Build.`scala3-presentation-compiler` val `scala3-presentation-compiler-testcases` = Build.`scala3-presentation-compiler-testcases` diff --git a/community-build/src/scala/dotty/communitybuild/CommunityBuildRunner.scala b/community-build/src/scala/dotty/communitybuild/CommunityBuildRunner.scala index 6aaaedb8a3dd..5bdba50004ff 100644 --- a/community-build/src/scala/dotty/communitybuild/CommunityBuildRunner.scala +++ b/community-build/src/scala/dotty/communitybuild/CommunityBuildRunner.scala @@ -17,8 +17,6 @@ object CommunityBuildRunner: */ extension (self: CommunityProject) def run()(using suite: CommunityBuildRunner): Unit = - self.dependencies.foreach(_.publish()) - self.testOnlyDependencies().foreach(_.publish()) suite.runProject(self) end extension diff --git a/community-build/src/scala/dotty/communitybuild/projects.scala b/community-build/src/scala/dotty/communitybuild/projects.scala index df0793b6fb2a..20cc90101eb5 100644 --- a/community-build/src/scala/dotty/communitybuild/projects.scala +++ b/community-build/src/scala/dotty/communitybuild/projects.scala @@ -30,37 +30,26 @@ def exec(projectDir: Path, binary: String, arguments: Seq[String], environment: sealed trait CommunityProject: - private var published = false - val project: String val testCommand: String val publishCommand: String val docCommand: String - val dependencies: List[CommunityProject] - val testOnlyDependencies: () => List[CommunityProject] val binaryName: String val runCommandsArgs: List[String] = Nil val environment: Map[String, String] = Map.empty final val projectDir = communitybuildDir.resolve("community-projects").resolve(project) - final def publishDependencies(): Unit = - dependencies.foreach(_.publish()) - /** Publish this project to the local Maven repository */ final def publish(): Unit = - if !published then - publishDependencies() - log(s"Publishing $project") - if publishCommand eq null then - throw RuntimeException(s"Publish command is not specified for $project. Project details:\n$this") - val exitCode = exec(projectDir, binaryName, (runCommandsArgs :+ publishCommand), environment) - if exitCode != 0 then - throw RuntimeException(s"Publish command exited with code $exitCode for project $project. Project details:\n$this") - published = true + log(s"Publishing $project") + if publishCommand eq null then + throw RuntimeException(s"Publish command is not specified for $project. Project details:\n$this") + val exitCode = exec(projectDir, binaryName, (runCommandsArgs :+ publishCommand), environment) + if exitCode != 0 then + throw RuntimeException(s"Publish command exited with code $exitCode for project $project. Project details:\n$this") final def doc(): Unit = - publishDependencies() log(s"Documenting $project") if docCommand eq null then throw RuntimeException(s"Doc command is not specified for $project. Project details:\n$this") @@ -77,8 +66,6 @@ end CommunityProject final case class MillCommunityProject( project: String, baseCommand: String, - dependencies: List[CommunityProject] = Nil, - testOnlyDependencies: () => List[CommunityProject] = () => Nil, ignoreDocs: Boolean = false ) extends CommunityProject: override val binaryName: String = "./mill" @@ -94,8 +81,6 @@ final case class SbtCommunityProject( project: String, sbtTestCommand: String, extraSbtArgs: List[String] = Nil, - dependencies: List[CommunityProject] = Nil, - testOnlyDependencies: () => List[CommunityProject] = () => Nil, sbtPublishCommand: String = null, sbtDocCommand: String = null, scalacOptions: List[String] = SbtCommunityProject.scalacOptions @@ -127,12 +112,7 @@ final case class SbtCommunityProject( val sbtProps = Option(System.getProperty("sbt.ivy.home")) match case Some(ivyHome) => List(s"-Dsbt.ivy.home=$ivyHome") case _ => Nil - extraSbtArgs ++ sbtProps ++ List( - "-sbt-version", "1.11.5", - "-Dsbt.supershell=false", - s"-Ddotty.communitybuild.dir=$communitybuildDir", - s"--addPluginSbtFile=$sbtPluginFilePath" - ) + extraSbtArgs ++ sbtProps ++ List("-sbt-version", "1.11.5", "-Dsbt.supershell=false", s"--addPluginSbtFile=$sbtPluginFilePath") object SbtCommunityProject: def scalacOptions = List( @@ -167,76 +147,64 @@ object projects: lazy val oslib = MillCommunityProject( project = "os-lib", baseCommand = s"os.jvm[$compilerVersion]", - dependencies = List(utest, sourcecode) ) lazy val oslibWatch = MillCommunityProject( project = "os-lib", baseCommand = s"os.watch[$compilerVersion]", - dependencies = List(utest, sourcecode), ignoreDocs = true ) lazy val ujson = MillCommunityProject( project = "upickle", baseCommand = s"ujson.jvm[$compilerVersion]", - dependencies = List(geny) ) lazy val upickle = MillCommunityProject( project = "upickle", baseCommand = s"upickle.jvm[$compilerVersion]", - dependencies = List(geny, utest) ) lazy val upickleCore = MillCommunityProject( project = "upickle", baseCommand = s"core.jvm[$compilerVersion]", - dependencies = List(geny, utest) ) lazy val upickleImplicits = MillCommunityProject( project = "upickle", baseCommand = s"implicits.jvm[$compilerVersion]", - dependencies = List(upickleCore, ujson) ) lazy val upack = MillCommunityProject( project = "upickle", baseCommand = s"upack.jvm[$compilerVersion]", - dependencies = List(ujson, upickleCore) ) lazy val geny = MillCommunityProject( project = "geny", baseCommand = s"geny.jvm[$compilerVersion]", - dependencies = List(utest) ) lazy val fansi = MillCommunityProject( project = "fansi", baseCommand = s"fansi.jvm[$compilerVersion]", - dependencies = List(utest, sourcecode), ignoreDocs = true ) lazy val pprint = MillCommunityProject( project = "PPrint", baseCommand = s"pprint.jvm[$compilerVersion]", - dependencies = List(fansi), ignoreDocs = true ) lazy val requests = MillCommunityProject( project = "requests-scala", baseCommand = s"requests[$compilerVersion]", - dependencies = List(geny, utest, ujson, upickleCore) ) lazy val cask = MillCommunityProject( project = "cask", baseCommand = s"cask[$compilerVersion]", - dependencies = List(utest, geny, sourcecode, pprint, upickle, upickleImplicits, upack, requests) ) lazy val scas = MillCommunityProject( @@ -272,12 +240,6 @@ object projects: ).mkString("; "), sbtPublishCommand = "scalacticDotty/publishLocal; scalatestDotty/publishLocal; scalacticDottyJS/publishLocal; scalatestDottyJS/publishLocal", sbtDocCommand = ";scalacticDotty/doc", // fails with missing type ;scalatestDotty/doc" - // cannot take signature of (test: org.scalatest.concurrent.ConductorFixture#OneArgTest): - // org.scalatest.Outcome - // Problem parsing scalatest.dotty/target/scala-3.0.0-M2/src_managed/main/org/scalatest/concurrent/ConductorFixture.scala:[602..624..3843], documentation may not be generated. - // dotty.tools.dotc.core.MissingType: - dependencies = List(scalaXml), - testOnlyDependencies = () => List(scalatestplusJunit, scalatestplusTestNG) ) lazy val scalatestplusScalacheck = SbtCommunityProject( @@ -285,21 +247,18 @@ object projects: sbtTestCommand = "scalatestPlusScalaCheckJVM/test", sbtPublishCommand = "scalatestPlusScalaCheckJVM/publishLocal", sbtDocCommand = "scalatestPlusScalaCheckJVM/doc", - dependencies = List(scalatest, scalacheck) ) lazy val scalatestplusJunit = SbtCommunityProject( project = "scalatestplus-junit", sbtTestCommand = "scalatestplus-junit/test", sbtPublishCommand = "scalatestplus-junit/publishLocal", - dependencies = List(scalatest) ) lazy val scalatestplusTestNG = SbtCommunityProject( project = "scalatestplus-testng", sbtTestCommand = "test", sbtPublishCommand = "publishLocal", - dependencies = List(scalatest) ) lazy val scalaXml = SbtCommunityProject( @@ -335,7 +294,6 @@ object projects: project = "minitest", sbtTestCommand = "test", sbtDocCommand = aggregateDoc("lawsJVM")("minitestJVM"), - dependencies = List(scalacheck) ) lazy val fastparse = SbtCommunityProject( @@ -384,7 +342,6 @@ object projects: project = "sconfig", sbtTestCommand = "sconfigJVM/test", sbtDocCommand = "sconfigJVM/doc", - dependencies = List(scalaCollectionCompat) ) lazy val zio = SbtCommunityProject( @@ -392,7 +349,6 @@ object projects: sbtTestCommand = "testJVMDotty", sbtDocCommand = forceDoc("coreJVM"), scalacOptions = "-source" :: "3.3" :: SbtCommunityProject.scalacOptions.filter(_ != "-Xcheck-macros"), - dependencies =List(izumiReflect) ) lazy val munit = SbtCommunityProject( @@ -400,7 +356,6 @@ object projects: sbtTestCommand = "testsJVM/test;testsJS/test;", sbtPublishCommand = "munitJVM/publishLocal; munitJS/publishLocal; munitScalacheckJVM/publishLocal; munitScalacheckJS/publishLocal; junit/publishLocal", sbtDocCommand = "junit/doc; munitJVM/doc", - dependencies = List(scalacheck) ) lazy val scodecBits = SbtCommunityProject( @@ -408,7 +363,6 @@ object projects: sbtTestCommand = "coreJVM/test;coreJS/test", sbtPublishCommand = "coreJVM/publishLocal;coreJS/publishLocal", sbtDocCommand = "coreJVM/doc", - dependencies = List(munit), ) lazy val scodec = SbtCommunityProject( @@ -417,7 +371,6 @@ object projects: // Adds package sbtDocCommand = "coreJVM/doc", scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"), - dependencies = List(munit, scodecBits), ) lazy val scalaParserCombinators = SbtCommunityProject( @@ -450,7 +403,6 @@ object projects: // [error] class scalaz.iteratee.Iteratee cannot be unpickled because no class file was found sbtDocCommand = forceDoc("effectJVM"), - dependencies = List(scalacheck) ) lazy val endpoints4s = SbtCommunityProject( @@ -464,14 +416,12 @@ object projects: sbtTestCommand = "ciJVM", sbtPublishCommand = "publishLocal", sbtDocCommand = ";coreJVM/doc ;lawsJVM/doc ;kernelJVM/doc", - dependencies = List(cats, coop, disciplineSpecs2, scalacheck) ) lazy val scalaParallelCollections = SbtCommunityProject( project = "scala-parallel-collections", sbtTestCommand = "test", sbtDocCommand = forceDoc("core"), - dependencies = List(scalacheck) ) lazy val scalaCollectionCompat = SbtCommunityProject( @@ -498,21 +448,18 @@ object projects: sbtTestCommand = "coreJVM/test;coreJS/test", sbtPublishCommand = "set every credentials := Nil;coreJVM/publishLocal;coreJS/publishLocal", scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"), - dependencies = List(scalacheck) ) lazy val disciplineMunit = SbtCommunityProject( project = "discipline-munit", sbtTestCommand = "coreJVM/test;coreJS/test", sbtPublishCommand = "coreJVM/publishLocal;coreJS/publishLocal", - dependencies = List(discipline, munit) ) lazy val disciplineSpecs2 = SbtCommunityProject( project = "discipline-specs2", sbtTestCommand = "test", sbtPublishCommand = "coreJVM/publishLocal;coreJS/publishLocal", - dependencies = List(discipline), scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init") ) @@ -526,7 +473,6 @@ object projects: project = "cats", sbtTestCommand = "set Global/scalaJSStage := FastOptStage;rootJVM/test;rootJS/test", sbtPublishCommand = "rootJVM/publishLocal;rootJS/publishLocal", - dependencies = List(discipline, disciplineMunit, scalacheck, simulacrumScalafixAnnotations), scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init") // disable -Ysafe-init or -Wsafe-init, due to -Xfatal-warning ) @@ -534,30 +480,24 @@ object projects: project = "cats-mtl", sbtTestCommand = "testsJVM/test;testsJS/test", sbtPublishCommand = "coreJVM/publishLocal;coreJS/publishLocal;lawsJVM/publishLocal;lawsJS/publishLocal", - dependencies = List(cats, disciplineMunit) ) lazy val coop = SbtCommunityProject( project = "coop", sbtTestCommand = "test", sbtPublishCommand = "coreJVM/publishLocal;coreJS/publishLocal", - dependencies = List(cats, catsMtl) ) - // 'Sciss/Lucre' with its dependencies: - lazy val scissEqual = SbtCommunityProject( project = "Equal", sbtTestCommand = "rootJVM/test", sbtPublishCommand = "rootJVM/publishLocal", - dependencies = List(scalatest), ) lazy val scissFingerTree = SbtCommunityProject( project = "FingerTree", sbtTestCommand = "rootJVM/test", sbtPublishCommand = "rootJVM/publishLocal", - dependencies = List(scalatest), ) lazy val scissLog = SbtCommunityProject( @@ -570,42 +510,36 @@ object projects: project = "Model", sbtTestCommand = "rootJVM/test", sbtPublishCommand = "rootJVM/publishLocal", - dependencies = List(scalatest), ) lazy val scissNumbers = SbtCommunityProject( project = "Numbers", sbtTestCommand = "rootJVM/test", sbtPublishCommand = "rootJVM/publishLocal", - dependencies = List(scalatest), ) lazy val scissSerial = SbtCommunityProject( project = "Serial", sbtTestCommand = "rootJVM/test", sbtPublishCommand = "rootJVM/publishLocal", - dependencies = List(scalatest), ) lazy val scissAsyncFile = SbtCommunityProject( project = "AsyncFile", sbtTestCommand = "rootJVM/test", sbtPublishCommand = "rootJVM/publishLocal", - dependencies = List(scissLog, scissModel, scalatest), ) lazy val scissSpan = SbtCommunityProject( project = "Span", sbtTestCommand = "rootJVM/test", sbtPublishCommand = "rootJVM/publishLocal", - dependencies = List(scissSerial, scalatest), ) lazy val scalaSTM = SbtCommunityProject( project = "scala-stm", sbtTestCommand = "rootJVM/test", sbtPublishCommand = "rootJVM/publishLocal", - dependencies = List(scalatestplusJunit), ) lazy val scissLucre = SbtCommunityProject( @@ -613,14 +547,12 @@ object projects: sbtTestCommand = "adjunctJVM/test;baseJVM/test;confluentJVM/test;coreJVM/test;dataJVM/test;exprJVM/test;geomJVM/test;lucre-bdb/test;testsJVM/test", extraSbtArgs = List("-Dde.sciss.lucre.ShortTests=true"), sbtPublishCommand = "adjunctJVM/publishLocal;baseJVM/publishLocal;confluentJVM/publishLocal;coreJVM/publishLocal;dataJVM/publishLocal;exprJVM/publishLocal;geomJVM/publishLocal;lucre-bdb/publishLocal", - dependencies = List(scalaSTM, scissAsyncFile, scissEqual, scissFingerTree, scissLog, scissModel, scissNumbers, scissSerial, scissSpan, scalatest), ) lazy val izumiReflect = SbtCommunityProject( project = "izumi-reflect", sbtTestCommand = "test", sbtPublishCommand = "publishLocal", - dependencies = List(scalatest) ) lazy val perspective = SbtCommunityProject( @@ -628,7 +560,6 @@ object projects: // No library with easy typeclasses to verify data against exist for Dotty, so no tests yet // Until then I guess this mainly serves to check that it still compiles at all sbtTestCommand = "dottyPerspectiveExamples/compile", - dependencies = List(cats) ) lazy val akka = SbtCommunityProject( @@ -643,13 +574,11 @@ object projects: "akka-actor-tests/Test/compile", ).mkString("; "), scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"), - dependencies = List(scalatest, scalatestplusJunit, scalatestplusScalacheck) ) lazy val monocle = SbtCommunityProject( project = "Monocle", sbtTestCommand = "coreJVM/test; macrosJVM/test; testJVM/test", - dependencies = List(cats, munit, discipline, disciplineMunit) ) lazy val protoquill = SbtCommunityProject( @@ -657,7 +586,6 @@ object projects: extraSbtArgs = List("-Dcommunity=true", "-DcommunityRemote=true", "-Dquill.macro.stdout=true"), sbtTestCommand = "runCommunityBuild", sbtPublishCommand = "publishLocal", - dependencies = List(scalatest), scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Xcheck-macros") :+ "-language:implicitConversions", // disabled -Xcheck-macros, due to bug in macro ) @@ -665,28 +593,24 @@ object projects: project = "onnx-scala", sbtTestCommand = "test", sbtPublishCommand = "publishLocal", - dependencies = List(scalatest) ) lazy val playJson = SbtCommunityProject( project = "play-json", sbtTestCommand = "test", sbtPublishCommand = "publishLocal", - dependencies = List(scalatest, scalatestplusScalacheck), ) lazy val munitCatsEffect = SbtCommunityProject( project = "munit-cats-effect", sbtTestCommand = "ce3JVM/test; ce3JS/test", sbtPublishCommand = "ce3JVM/publishLocal; ce3JS/publishLocal", - dependencies = List(munit, catsEffect3) ) lazy val scalacheckEffect = SbtCommunityProject( project = "scalacheck-effect", sbtTestCommand = "test", sbtPublishCommand = "publishLocal", - dependencies = List(cats, catsEffect3, munit, scalacheck) ) lazy val fs2 = SbtCommunityProject( @@ -694,28 +618,24 @@ object projects: sbtTestCommand = "coreJVM/test; coreJS/test", // io/test requires JDK9+ sbtPublishCommand = "coreJVM/publishLocal; coreJS/publishLocal", scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"), - dependencies = List(cats, catsEffect3, munitCatsEffect, scalacheckEffect, scodecBits) ) lazy val libretto = SbtCommunityProject( project = "libretto", sbtTestCommand = "core/test; examples/compile", sbtPublishCommand = "core/publishLocal; examples/publishLocal", - dependencies = List(scalatest) ) lazy val jacksonModuleScala = SbtCommunityProject( project = "jackson-module-scala", sbtTestCommand = "test", sbtPublishCommand = "publishLocal", - dependencies = List(scalaJava8Compat, scalatest) ) lazy val specs2 = SbtCommunityProject( project = "specs2", sbtTestCommand = "core/testOnly -- exclude ci", sbtPublishCommand = "core/publishLocal", - dependencies = List() ) lazy val spire = SbtCommunityProject( @@ -723,7 +643,6 @@ object projects: sbtTestCommand = "test", sbtPublishCommand = "publishLocal", scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Xcheck-macros"), - dependencies = List(cats, disciplineMunit) ) lazy val http4s = SbtCommunityProject( @@ -731,7 +650,6 @@ object projects: sbtTestCommand = """set ThisBuild / tlFatalWarnings := false; rootJVM/test""", sbtPublishCommand = "publishLocal", scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"), - dependencies = List(cats, catsEffect3, fs2, disciplineMunit, scalacheckEffect) ) lazy val parboiled2 = SbtCommunityProject( @@ -739,7 +657,6 @@ object projects: sbtTestCommand = "parboiledCoreJVM/test; parboiledJVM/test", sbtPublishCommand = "publishLocal", scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Xcheck-macros"), - dependencies = List(utest, scalacheck) ) end projects diff --git a/project/Build.scala b/project/Build.scala index 4edd5a2ed45a..b3b859148d1e 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -3284,44 +3284,6 @@ object Build { ).evaluated ) - lazy val `sbt-community-build` = project.in(file("sbt-community-build")). - enablePlugins(SbtPlugin). - settings(commonSettings). - settings( - name := "sbt-community-build", - version := sbtCommunityBuildVersion, - organization := "ch.epfl.lamp", - sbtTestDirectory := baseDirectory.value / "sbt-test", - scriptedLaunchOpts ++= Seq( - "-Dplugin.version=" + version.value, - "-Dplugin.scalaVersion=" + dottyVersion, - "-Dplugin.scalaJSVersion=" + scalaJSVersion, - "-Dplugin.sbtDottyVersion=" + sbtDottyVersion, - "-Ddotty.communitybuild.dir=" + baseDirectory.value / "target", - "-Dsbt.boot.directory=" + ((ThisBuild / baseDirectory).value / ".sbt-scripted").getAbsolutePath // Workaround sbt/sbt#3469 - ), - // Pass along ivy home and repositories settings to sbt instances run from the tests - scriptedLaunchOpts ++= { - val repositoryPath = (io.Path.userHome / ".sbt" / "repositories").absolutePath - s"-Dsbt.repository.config=$repositoryPath" :: - ivyPaths.value.ivyHome.map("-Dsbt.ivy.home=" + _.getAbsolutePath).toList - }, - scriptedBufferLog := true, - scriptedBatchExecution := true, - scripted := scripted.dependsOn( - (`scala3-sbt-bridge` / publishLocal), - (`scala3-interfaces` / publishLocal), - (`scala3-compiler-bootstrapped` / publishLocal), - (`scala3-library-bootstrapped` / publishLocal), - (`scala3-library-bootstrappedJS` / publishLocal), - (`tasty-core-bootstrapped` / publishLocal), - (`scala3-staging` / publishLocal), - (`scala3-tasty-inspector` / publishLocal), - (`scaladoc` / publishLocal), - (`scala3-bootstrapped` / publishLocal) - ).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/{scala3-bootstrapped.version,sbt-injected-plugins}.") lazy val `community-build` = project.in(file("community-build")). @@ -3338,15 +3300,11 @@ object Build { (`scala3-compiler-bootstrapped` / publishLocal).value (`scala3-bootstrapped` / publishLocal).value (`scala3-library-bootstrappedJS` / publishLocal).value - (`sbt-community-build` / publishLocal).value // (publishLocal in `scala3-staging`).value val pluginText = - s"""updateOptions in Global ~= (_.withLatestSnapshots(false)) - |addSbtPlugin("ch.epfl.lamp" % "sbt-community-build" % "$sbtCommunityBuildVersion") - |addSbtPlugin("org.scala-js" % "sbt-scalajs" % "$scalaJSVersion")""".stripMargin + s"""addSbtPlugin("org.scala-js" % "sbt-scalajs" % "$scalaJSVersion")""" IO.write(baseDirectory.value / "sbt-injected-plugins", pluginText) IO.write(baseDirectory.value / "scala3-bootstrapped.version", dottyVersion) - IO.delete(baseDirectory.value / "dotty-community-build-deps") // delete any stale deps file }, (Test / testOptions) += Tests.Argument( TestFrameworks.JUnit, diff --git a/sbt-community-build/sbt-test/sbt-community-build/inter-project-transitive-dep/build.sbt b/sbt-community-build/sbt-test/sbt-community-build/inter-project-transitive-dep/build.sbt deleted file mode 100644 index 5d8eb6a0ad82..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/inter-project-transitive-dep/build.sbt +++ /dev/null @@ -1,23 +0,0 @@ -ThisBuild / scalaVersion := sys.props("plugin.scalaVersion") -ThisBuild / organization := "org.example" - -lazy val a = project - .settings( - name := "a", - version := "0.4.1-SNAPSHOT", - libraryDependencies := Seq(), // don't depend on scala-library - ) - -lazy val b = project - .settings(onlyThisTestResolverSettings) - .settings( - name := "b", - libraryDependencies := Seq(organization.value %% "a" % "0.4.0-SNAPSHOT"), - ) - -lazy val c = project - .settings(onlyThisTestResolverSettings) - .settings( - name := "c", - libraryDependencies := Seq(), // don't depend on scala-library - ).dependsOn(b) diff --git a/sbt-community-build/sbt-test/sbt-community-build/inter-project-transitive-dep/project/ThisTestPlugin.scala b/sbt-community-build/sbt-test/sbt-community-build/inter-project-transitive-dep/project/ThisTestPlugin.scala deleted file mode 100644 index 38065b524de4..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/inter-project-transitive-dep/project/ThisTestPlugin.scala +++ /dev/null @@ -1,33 +0,0 @@ -import sbt._ -import Keys._ - -object ThisTestPlugin extends AutoPlugin { - override def requires = plugins.IvyPlugin - override def trigger = allRequirements - - val thisTestIvyHome = settingKey[File]("Ivy home directory for artifacts published by this test") - val thisTestResolver = settingKey[Resolver]("Resolver for artifacts published by this test") - val deleteDepsFile = taskKey[Unit]("Deletes the dotty-community-build-deps dependency tracking file") - - override val projectSettings = Seq( - publishLocalConfiguration := publishLocalConfiguration.value.withResolverName("this-test") - ) - - override val buildSettings = defaultThisTestSettings ++ Seq( - resolvers += thisTestResolver.value - ) - - def defaultThisTestSettings: Seq[Setting[_]] = { - Seq( - thisTestIvyHome := (LocalRootProject / target).value / "ivy-cache", - thisTestResolver := Resolver.file("this-test", thisTestIvyHome.value / "local")(Resolver.ivyStylePatterns), - deleteDepsFile := IO.delete(file(sys.props("dotty.communitybuild.dir")) / "dotty-community-build-deps"), - ) - } - - object autoImport { - def onlyThisTestResolverSettings: Seq[Setting[_]] = Seq( - externalResolvers := thisTestResolver.value :: Nil - ) - } -} diff --git a/sbt-community-build/sbt-test/sbt-community-build/inter-project-transitive-dep/project/plugins.sbt b/sbt-community-build/sbt-test/sbt-community-build/inter-project-transitive-dep/project/plugins.sbt deleted file mode 100644 index c9ff25c194ee..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/inter-project-transitive-dep/project/plugins.sbt +++ /dev/null @@ -1,2 +0,0 @@ -addSbtPlugin("ch.epfl.lamp" % "sbt-community-build" % sys.props("plugin.version")) -addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % sys.props("plugin.sbtDottyVersion")) diff --git a/sbt-community-build/sbt-test/sbt-community-build/inter-project-transitive-dep/test b/sbt-community-build/sbt-test/sbt-community-build/inter-project-transitive-dep/test deleted file mode 100644 index a9bb88bd420d..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/inter-project-transitive-dep/test +++ /dev/null @@ -1,10 +0,0 @@ -> deleteDepsFile -> reload - -> a/publishLocal - --> c/update - -> reload - -> c/update diff --git a/sbt-community-build/sbt-test/sbt-community-build/multiple-deps/build.sbt b/sbt-community-build/sbt-test/sbt-community-build/multiple-deps/build.sbt deleted file mode 100644 index 43f4c872c11b..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/multiple-deps/build.sbt +++ /dev/null @@ -1,26 +0,0 @@ -ThisBuild / scalaVersion := sys.props("plugin.scalaVersion") -ThisBuild / organization := "org.example" - -lazy val a = project - .settings( - name := "a", - version := "0.2.1-SNAPSHOT", - libraryDependencies := Seq(), // don't depend on scala-library - ) - -lazy val b = project - .settings( - name := "b", - version := "1.2.1-SNAPSHOT", - libraryDependencies := Seq(), // don't depend on scala-library - ) - -lazy val c = project - .settings(onlyThisTestResolverSettings) - .settings( - name := "c", - libraryDependencies := Seq( - organization.value %% "a" % "0.2.0-SNAPSHOT", - organization.value %% "b" % "1.2.0-SNAPSHOT", - ), - ) diff --git a/sbt-community-build/sbt-test/sbt-community-build/multiple-deps/project/ThisTestPlugin.scala b/sbt-community-build/sbt-test/sbt-community-build/multiple-deps/project/ThisTestPlugin.scala deleted file mode 100644 index 38065b524de4..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/multiple-deps/project/ThisTestPlugin.scala +++ /dev/null @@ -1,33 +0,0 @@ -import sbt._ -import Keys._ - -object ThisTestPlugin extends AutoPlugin { - override def requires = plugins.IvyPlugin - override def trigger = allRequirements - - val thisTestIvyHome = settingKey[File]("Ivy home directory for artifacts published by this test") - val thisTestResolver = settingKey[Resolver]("Resolver for artifacts published by this test") - val deleteDepsFile = taskKey[Unit]("Deletes the dotty-community-build-deps dependency tracking file") - - override val projectSettings = Seq( - publishLocalConfiguration := publishLocalConfiguration.value.withResolverName("this-test") - ) - - override val buildSettings = defaultThisTestSettings ++ Seq( - resolvers += thisTestResolver.value - ) - - def defaultThisTestSettings: Seq[Setting[_]] = { - Seq( - thisTestIvyHome := (LocalRootProject / target).value / "ivy-cache", - thisTestResolver := Resolver.file("this-test", thisTestIvyHome.value / "local")(Resolver.ivyStylePatterns), - deleteDepsFile := IO.delete(file(sys.props("dotty.communitybuild.dir")) / "dotty-community-build-deps"), - ) - } - - object autoImport { - def onlyThisTestResolverSettings: Seq[Setting[_]] = Seq( - externalResolvers := thisTestResolver.value :: Nil - ) - } -} diff --git a/sbt-community-build/sbt-test/sbt-community-build/multiple-deps/project/plugins.sbt b/sbt-community-build/sbt-test/sbt-community-build/multiple-deps/project/plugins.sbt deleted file mode 100644 index c9ff25c194ee..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/multiple-deps/project/plugins.sbt +++ /dev/null @@ -1,2 +0,0 @@ -addSbtPlugin("ch.epfl.lamp" % "sbt-community-build" % sys.props("plugin.version")) -addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % sys.props("plugin.sbtDottyVersion")) diff --git a/sbt-community-build/sbt-test/sbt-community-build/multiple-deps/test b/sbt-community-build/sbt-test/sbt-community-build/multiple-deps/test deleted file mode 100644 index 344ba4e0a86d..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/multiple-deps/test +++ /dev/null @@ -1,11 +0,0 @@ -> deleteDepsFile -> reload - -> a/publishLocal -> b/publishLocal - --> c/update - -> reload - -> c/update diff --git a/sbt-community-build/sbt-test/sbt-community-build/scalajs/build.sbt b/sbt-community-build/sbt-test/sbt-community-build/scalajs/build.sbt deleted file mode 100644 index 15a3b1316968..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/scalajs/build.sbt +++ /dev/null @@ -1,32 +0,0 @@ -ThisBuild / scalaVersion := sys.props("plugin.scalaVersion") -ThisBuild / organization := "org.example" - -lazy val aJVM = project - .settings( - name := "a", - version := "0.5.1-SNAPSHOT", - libraryDependencies := Seq(), // don't depend on scala-library - ) - -lazy val aJS = project - .enablePlugins(ScalaJSPlugin) - .settings( - name := "a", - version := "0.5.1-SNAPSHOT", - libraryDependencies := Seq(), // don't depend on scala-library - ) - -lazy val bJVM = project - .settings(onlyThisTestResolverSettings) - .settings( - name := "b", - libraryDependencies := Seq(organization.value %%% "a" % "0.5.0-SNAPSHOT"), - ) - -lazy val bJS = project - .enablePlugins(ScalaJSPlugin) - .settings(onlyThisTestResolverSettings) - .settings( - name := "b", - libraryDependencies := Seq(organization.value %%% "a" % "0.5.0-SNAPSHOT"), - ) diff --git a/sbt-community-build/sbt-test/sbt-community-build/scalajs/project/ThisTestPlugin.scala b/sbt-community-build/sbt-test/sbt-community-build/scalajs/project/ThisTestPlugin.scala deleted file mode 100644 index 38065b524de4..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/scalajs/project/ThisTestPlugin.scala +++ /dev/null @@ -1,33 +0,0 @@ -import sbt._ -import Keys._ - -object ThisTestPlugin extends AutoPlugin { - override def requires = plugins.IvyPlugin - override def trigger = allRequirements - - val thisTestIvyHome = settingKey[File]("Ivy home directory for artifacts published by this test") - val thisTestResolver = settingKey[Resolver]("Resolver for artifacts published by this test") - val deleteDepsFile = taskKey[Unit]("Deletes the dotty-community-build-deps dependency tracking file") - - override val projectSettings = Seq( - publishLocalConfiguration := publishLocalConfiguration.value.withResolverName("this-test") - ) - - override val buildSettings = defaultThisTestSettings ++ Seq( - resolvers += thisTestResolver.value - ) - - def defaultThisTestSettings: Seq[Setting[_]] = { - Seq( - thisTestIvyHome := (LocalRootProject / target).value / "ivy-cache", - thisTestResolver := Resolver.file("this-test", thisTestIvyHome.value / "local")(Resolver.ivyStylePatterns), - deleteDepsFile := IO.delete(file(sys.props("dotty.communitybuild.dir")) / "dotty-community-build-deps"), - ) - } - - object autoImport { - def onlyThisTestResolverSettings: Seq[Setting[_]] = Seq( - externalResolvers := thisTestResolver.value :: Nil - ) - } -} diff --git a/sbt-community-build/sbt-test/sbt-community-build/scalajs/project/plugins.sbt b/sbt-community-build/sbt-test/sbt-community-build/scalajs/project/plugins.sbt deleted file mode 100644 index 85bf601273c1..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/scalajs/project/plugins.sbt +++ /dev/null @@ -1,3 +0,0 @@ -addSbtPlugin("ch.epfl.lamp" % "sbt-community-build" % sys.props("plugin.version")) -addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % sys.props("plugin.sbtDottyVersion")) -addSbtPlugin("org.scala-js" % "sbt-scalajs" % sys.props("plugin.scalaJSVersion")) diff --git a/sbt-community-build/sbt-test/sbt-community-build/scalajs/test b/sbt-community-build/sbt-test/sbt-community-build/scalajs/test deleted file mode 100644 index ca16d8916481..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/scalajs/test +++ /dev/null @@ -1,13 +0,0 @@ -> deleteDepsFile -> reload - -> aJVM/publishLocal -> aJS/publishLocal - --> bJVM/update --> bJS/update - -> reload - -> bJVM/update -> bJS/update diff --git a/sbt-community-build/sbt-test/sbt-community-build/single-dep/build.sbt b/sbt-community-build/sbt-test/sbt-community-build/single-dep/build.sbt deleted file mode 100644 index 945900611587..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/single-dep/build.sbt +++ /dev/null @@ -1,16 +0,0 @@ -ThisBuild / scalaVersion := sys.props("plugin.scalaVersion") -ThisBuild / organization := "org.example" - -lazy val a = project - .settings( - name := "a", - version := "0.1.1-SNAPSHOT", - libraryDependencies := Seq(), // don't depend on scala-library - ) - -lazy val b = project - .settings(onlyThisTestResolverSettings) - .settings( - name := "b", - libraryDependencies := Seq(organization.value %% "a" % "0.1.0-SNAPSHOT"), - ) diff --git a/sbt-community-build/sbt-test/sbt-community-build/single-dep/project/ThisTestPlugin.scala b/sbt-community-build/sbt-test/sbt-community-build/single-dep/project/ThisTestPlugin.scala deleted file mode 100644 index 38065b524de4..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/single-dep/project/ThisTestPlugin.scala +++ /dev/null @@ -1,33 +0,0 @@ -import sbt._ -import Keys._ - -object ThisTestPlugin extends AutoPlugin { - override def requires = plugins.IvyPlugin - override def trigger = allRequirements - - val thisTestIvyHome = settingKey[File]("Ivy home directory for artifacts published by this test") - val thisTestResolver = settingKey[Resolver]("Resolver for artifacts published by this test") - val deleteDepsFile = taskKey[Unit]("Deletes the dotty-community-build-deps dependency tracking file") - - override val projectSettings = Seq( - publishLocalConfiguration := publishLocalConfiguration.value.withResolverName("this-test") - ) - - override val buildSettings = defaultThisTestSettings ++ Seq( - resolvers += thisTestResolver.value - ) - - def defaultThisTestSettings: Seq[Setting[_]] = { - Seq( - thisTestIvyHome := (LocalRootProject / target).value / "ivy-cache", - thisTestResolver := Resolver.file("this-test", thisTestIvyHome.value / "local")(Resolver.ivyStylePatterns), - deleteDepsFile := IO.delete(file(sys.props("dotty.communitybuild.dir")) / "dotty-community-build-deps"), - ) - } - - object autoImport { - def onlyThisTestResolverSettings: Seq[Setting[_]] = Seq( - externalResolvers := thisTestResolver.value :: Nil - ) - } -} diff --git a/sbt-community-build/sbt-test/sbt-community-build/single-dep/project/plugins.sbt b/sbt-community-build/sbt-test/sbt-community-build/single-dep/project/plugins.sbt deleted file mode 100644 index c9ff25c194ee..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/single-dep/project/plugins.sbt +++ /dev/null @@ -1,2 +0,0 @@ -addSbtPlugin("ch.epfl.lamp" % "sbt-community-build" % sys.props("plugin.version")) -addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % sys.props("plugin.sbtDottyVersion")) diff --git a/sbt-community-build/sbt-test/sbt-community-build/single-dep/test b/sbt-community-build/sbt-test/sbt-community-build/single-dep/test deleted file mode 100644 index ca922b5e6e60..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/single-dep/test +++ /dev/null @@ -1,10 +0,0 @@ -> deleteDepsFile -> reload - -> a/publishLocal - --> b/update - -> reload - -> b/update diff --git a/sbt-community-build/sbt-test/sbt-community-build/transitive-dep/build.sbt b/sbt-community-build/sbt-test/sbt-community-build/transitive-dep/build.sbt deleted file mode 100644 index 731326994993..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/transitive-dep/build.sbt +++ /dev/null @@ -1,23 +0,0 @@ -ThisBuild / scalaVersion := sys.props("plugin.scalaVersion") -ThisBuild / organization := "org.example" - -lazy val a = project - .settings( - name := "a", - version := "0.3.1-SNAPSHOT", - libraryDependencies := Seq(), // don't depend on scala-library - ) - -lazy val b = project - .settings( - name := "b", - version := "1.3.1-SNAPSHOT", - libraryDependencies := Seq(organization.value %% "a" % "0.3.0-SNAPSHOT"), - ) - -lazy val c = project - .settings(onlyThisTestResolverSettings) - .settings( - name := "c", - libraryDependencies := Seq(organization.value %% "b" % "1.3.0-SNAPSHOT"), - ) diff --git a/sbt-community-build/sbt-test/sbt-community-build/transitive-dep/project/ThisTestPlugin.scala b/sbt-community-build/sbt-test/sbt-community-build/transitive-dep/project/ThisTestPlugin.scala deleted file mode 100644 index 38065b524de4..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/transitive-dep/project/ThisTestPlugin.scala +++ /dev/null @@ -1,33 +0,0 @@ -import sbt._ -import Keys._ - -object ThisTestPlugin extends AutoPlugin { - override def requires = plugins.IvyPlugin - override def trigger = allRequirements - - val thisTestIvyHome = settingKey[File]("Ivy home directory for artifacts published by this test") - val thisTestResolver = settingKey[Resolver]("Resolver for artifacts published by this test") - val deleteDepsFile = taskKey[Unit]("Deletes the dotty-community-build-deps dependency tracking file") - - override val projectSettings = Seq( - publishLocalConfiguration := publishLocalConfiguration.value.withResolverName("this-test") - ) - - override val buildSettings = defaultThisTestSettings ++ Seq( - resolvers += thisTestResolver.value - ) - - def defaultThisTestSettings: Seq[Setting[_]] = { - Seq( - thisTestIvyHome := (LocalRootProject / target).value / "ivy-cache", - thisTestResolver := Resolver.file("this-test", thisTestIvyHome.value / "local")(Resolver.ivyStylePatterns), - deleteDepsFile := IO.delete(file(sys.props("dotty.communitybuild.dir")) / "dotty-community-build-deps"), - ) - } - - object autoImport { - def onlyThisTestResolverSettings: Seq[Setting[_]] = Seq( - externalResolvers := thisTestResolver.value :: Nil - ) - } -} diff --git a/sbt-community-build/sbt-test/sbt-community-build/transitive-dep/project/plugins.sbt b/sbt-community-build/sbt-test/sbt-community-build/transitive-dep/project/plugins.sbt deleted file mode 100644 index c9ff25c194ee..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/transitive-dep/project/plugins.sbt +++ /dev/null @@ -1,2 +0,0 @@ -addSbtPlugin("ch.epfl.lamp" % "sbt-community-build" % sys.props("plugin.version")) -addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % sys.props("plugin.sbtDottyVersion")) diff --git a/sbt-community-build/sbt-test/sbt-community-build/transitive-dep/test b/sbt-community-build/sbt-test/sbt-community-build/transitive-dep/test deleted file mode 100644 index 29bf17ac2bb6..000000000000 --- a/sbt-community-build/sbt-test/sbt-community-build/transitive-dep/test +++ /dev/null @@ -1,13 +0,0 @@ -> deleteDepsFile -> reload - -> a/publishLocal -> reload - -> b/publishLocal - --> c/update - -> reload - -> c/update diff --git a/sbt-community-build/src/dotty/communitybuild/sbtplugin/CommunityBuildPlugin.scala b/sbt-community-build/src/dotty/communitybuild/sbtplugin/CommunityBuildPlugin.scala deleted file mode 100644 index 0b580e1cb77a..000000000000 --- a/sbt-community-build/src/dotty/communitybuild/sbtplugin/CommunityBuildPlugin.scala +++ /dev/null @@ -1,86 +0,0 @@ -package dotty.communitybuild.sbtplugin - -import sbt._ -import sbt.Keys._ -import sbt.librarymanagement.LibraryManagementCodec._ -import sjsonnew.support.scalajson.unsafe.{ Converter, CompactPrinter, Parser } -import scala.util.{ Try, Failure } - -/** This plugin provides automatic dependency overrides for projects in the - * community build. In doing so, we permit the projects in the build to - * depend on arbitrary versions of other projects in the build, and the - * version alignment is handled here. - */ -object CommunityBuildPlugin extends AutoPlugin { - override def requires = plugins.JvmPlugin - override def trigger = allRequirements - - override val projectSettings: Seq[Setting[_]] = Seq( - publishLocal := Def.taskDyn { - val pubLocalResult = publishLocal.value - Def.task { - if (artifacts.value.nonEmpty && !(publish / skip).value) - CommunityBuildDependencies.publish(projectID.value) - pubLocalResult - } - }.value - ) - - override val buildSettings: Seq[Setting[_]] = Seq( - dependencyOverrides ++= { - if (scalaVersion.value.startsWith("3.")) - CommunityBuildDependencies.allOverrides(sLog.value) - else Nil - } - ) -} - -object CommunityBuildDependencies { - private val communityBuildDir = Path(sys.props("dotty.communitybuild.dir")) - private val depsFile = communityBuildDir / "dotty-community-build-deps" - - /** Publish dependency override data for a module in the community build. - * This appends a single entry to the tracking file. - */ - def publish(moduleID: ModuleID): Unit = { - val line = encode(sanitized(moduleID)) + "\n" - synchronized { IO.append(depsFile, line) } - } - - /** Returns all currently tracked dependency overrides. */ - def allOverrides(log: Logger): List[ModuleID] = load(log) - - /** Load all entries from the dependency tracking file. */ - private def load(log: Logger): List[ModuleID] = { - def logError(line: String): PartialFunction[Throwable, Try[ModuleID]] = { - case ex: Throwable => - log.error(ex.toString()) - log.error(s"while parsing input: $line") - Failure(ex) - } - - log.info(s"Loading dependency tracking file $depsFile") - try { - val lines = synchronized { IO.readLines(depsFile) } - lines.map { s => decode(s).recoverWith(logError(s)).toOption }.flatten - } catch { - case _: java.io.FileNotFoundException => - log.info(s"Dependency tracking file $depsFile does not exist") - Nil - } - } - - private def encode(m: ModuleID): String = - CompactPrinter(Converter.toJsonUnsafe(m)) - - // It seems that badly formatted JSON will throw, e.g. - // sjsonnew.shaded.org.typelevel.jawn.IncompleteParseException: exhausted input - // But missing/misnamed fields will not and the malformed entry will be loaded - private def decode(s: String): Try[ModuleID] = - Parser.parseFromString(s) - .flatMap(Converter.fromJson[ModuleID]) - - // preserve only organization, name, revision, and crossVersion - private def sanitized(m: ModuleID): ModuleID = - ModuleID(m.organization, m.name, m.revision).withCrossVersion(m.crossVersion) -} From 68e78a7b299bbb51b64e3a114a2ae58718ce6a59 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Sat, 27 Sep 2025 12:06:19 +0200 Subject: [PATCH 2/2] disable `protoquill` for now, it is not happy when we removed the deps --- .../test/scala/dotty/communitybuild/CommunityBuildTest.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala index 5c2ea408413c..e2cc88c04d83 100644 --- a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala +++ b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala @@ -77,7 +77,7 @@ class CommunityBuildTestC: @Test def parboiled2 = projects.parboiled2.run() @Test def playJson = projects.playJson.run() @Test def pprint = projects.pprint.run() - @Test def protoquill = projects.protoquill.run() + //@Test def protoquill = projects.protoquill.run() @Test def requests = projects.requests.run() @Test def scalacheck = projects.scalacheck.run() @Test def scalaCollectionCompat = projects.scalaCollectionCompat.run()