diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f9aa57e31..6aa52e3e24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,8 +37,8 @@ jobs: - name: Tests run: | ./bin/sbt-ci.sh \ - "sbtBloop10/publishLocal" \ - "sbtBloop10/scripted" + "sbtBloop/publishLocal" \ + "sbtBloop/scripted" shell: bash bridges: name: Test platform bridges diff --git a/build.sbt b/build.sbt index b12197b2ea..579069849b 100644 --- a/build.sbt +++ b/build.sbt @@ -89,13 +89,7 @@ lazy val bloopShared = (project in file("shared")) * ************************************************************************************************ */ import build.Dependencies -import build.Dependencies.{ - Scala210Version, - Scala211Version, - Scala212Version, - Sbt013Version, - Sbt1Version -} +import build.Dependencies.{Scala210Version, Scala211Version, Scala212Version, SbtVersion} lazy val backend = project .enablePlugins(BuildInfoPlugin) @@ -477,46 +471,13 @@ def isJdiJar(file: File): Boolean = { else file.getAbsolutePath.contains(SbtJdiTools.JavaTools.getAbsolutePath.toString) } -lazy val integrationUtils211 = project - .in(integrations / "utils") - .settings( - scalafixSettings, - scalaVersion := Dependencies.Scala211Version, - libraryDependencies += Dependencies.bloopConfig, - target := (file( - "integrations" - ) / "utils" / "target" / "utils-2.11").getAbsoluteFile - ) - -lazy val integrationUtils212 = project - .in(integrations / "utils") - .settings( - scalafixSettings, - scalaVersion := Dependencies.Scala212Version, - libraryDependencies += Dependencies.bloopConfig, - target := (file( - "integrations" - ) / "utils" / "target" / "utils-2.12").getAbsoluteFile - ) - -lazy val integrationUtils213 = project - .in(integrations / "utils") - .settings( - scalafixSettings, - scalaVersion := Dependencies.Scala213Version, - libraryDependencies += Dependencies.bloopConfig, - target := (file( - "integrations" - ) / "utils" / "target" / "utils-2.13").getAbsoluteFile - ) - -lazy val sbtBloop10: Project = project +lazy val sbtBloop: Project = project .enablePlugins(ScriptedPlugin) .disablePlugins(ScalafixPlugin) .in(integrations / "sbt-bloop") .settings( BuildDefaults.scriptedSettings, - sbtPluginSettings("sbt-bloop", Sbt1Version), + sbtPluginSettings("sbt-bloop", SbtVersion), libraryDependencies += Dependencies.bloopConfig ) @@ -626,7 +587,7 @@ val allProjects = Seq( backend, frontend, benchmarks, - sbtBloop10, + sbtBloop, nativeBridge04, jsBridge06, jsBridge1, @@ -635,17 +596,14 @@ val allProjects = Seq( launcherTest, sockets, bloopgun, - bloopgun213, - integrationUtils211, - integrationUtils212, - integrationUtils213 + bloopgun213 ) val allProjectsToRelease = Seq[ProjectReference]( bloopShared, backend, frontend, - sbtBloop10, + sbtBloop, nativeBridge04, jsBridge06, jsBridge1, @@ -670,7 +628,6 @@ val bloop = project .settings( releaseEarly := { () }, (publish / skip) := true, - crossSbtVersions := Seq(Sbt1Version, Sbt013Version), buildIntegrationsBase := (ThisBuild / Keys.baseDirectory).value / "build-integrations", publishLocalAllModules := { BuildDefaults @@ -694,7 +651,7 @@ val bloop = project build.BuildImplementation .exportCommunityBuild( buildpress, - sbtBloop10 + sbtBloop ) .value } diff --git a/integrations/utils/src/main/scala/bloop/integrations/utils/BaseConfigSuite.scala b/integrations/utils/src/main/scala/bloop/integrations/utils/BaseConfigSuite.scala deleted file mode 100644 index 7c5cd5d78d..0000000000 --- a/integrations/utils/src/main/scala/bloop/integrations/utils/BaseConfigSuite.scala +++ /dev/null @@ -1,238 +0,0 @@ -package bloop.integrations.utils - -import java.io.File -import java.nio.charset.StandardCharsets -import java.nio.file.Files - -import bloop.config.Config -import bloop.config.PlatformFiles -import bloop.config.PlatformFiles.Path - -trait BaseConfigSuite { - - protected def createSource( - projectDir: File, - contents: String, - sourceSetName: String, - language: String - ): Unit = { - createSource(projectDir, contents, sourceSetName, "Hello", language) - } - - private def assertTrue(clue: String, condition: Boolean) = { - assert(condition, clue) - } - - private def assertFalse(clue: String, condition: Boolean) = { - assert(!condition, clue) - } - - protected def createSource( - projectDir: File, - contents: String, - sourceSetName: String, - fileName: String, - language: String - ): Unit = { - val srcDir = - projectDir.toPath.resolve("src").resolve(sourceSetName).resolve(language) - Files.createDirectories(srcDir) - val srcFile = srcDir.resolve(s"$fileName.$language") - Files.write(srcFile, contents.getBytes(StandardCharsets.UTF_8)) - () - } - - protected final val ScalaHelloWorldSource: String = { - """ - |object Hello { - | def main(args: Array[String]): Unit = { - | println("Hello") - | } - |} - """.stripMargin - } - - protected final val JavaHelloWorldSource: String = { - """ - |public class Hello { - | public static void main(String[] args) { - | System.out.println("Hello World"); - | } - |} - """.stripMargin - } - - protected def createHelloWorldJavaSource(projectDir: File): Unit = { - createSource(projectDir, JavaHelloWorldSource, "main", "java") - } - - protected def createHelloWorldJavaTestSource(projectDir: File): Unit = { - createSource(projectDir, JavaHelloWorldSource, "test", "java") - } - - protected def createHelloWorldScalaTestSource( - projectDir: File, - source: String = "" - ): Unit = { - createSource( - projectDir, - if (source.isEmpty) ScalaHelloWorldSource else source, - "test", - "scala" - ) - } - - protected def createHelloWorldScalaTestFixtureSource( - projectDir: File, - source: String = "" - ): Unit = { - createSource( - projectDir, - if (source.isEmpty) ScalaHelloWorldSource else source, - "testFixtures", - "scala" - ) - } - - protected def createHelloWorldScalaSource( - projectDir: File, - source: String = "" - ): Unit = { - createSource( - projectDir, - if (source.isEmpty) ScalaHelloWorldSource else source, - "main", - "scala" - ) - } - - protected def readValidBloopConfig(file: File): Config.File = { - assertTrue(s"The bloop project file should exist: $file", file.exists()) - val bytes = Files.readAllBytes(file.toPath) - bloop.config.read(bytes) match { - case Right(file) => file - case Left(failure) => - throw new AssertionError( - s"Failed to parse ${file.getAbsolutePath}: $failure" - ) - } - } - - protected def hasPathEntryName( - entryName: String, - paths: List[Path] - ): Boolean = { - val pathValidEntryName = entryName.replace('/', File.separatorChar) - val pathAsStr = paths.map(_.toString) - pathAsStr.exists(_.contains(pathValidEntryName)) - } - - protected def hasRuntimeClasspathEntryName( - config: Config.File, - entryName: String - ): Boolean = { - config.project.platform.exists { - case platform: Config.Platform.Jvm => - platform.classpath.exists(hasPathEntryName(entryName, _)) - case _ => false - } - } - - protected def hasCompileClasspathEntryName( - config: Config.File, - entryName: String - ): Boolean = { - hasPathEntryName(entryName, config.project.classpath) - } - - protected def hasBothClasspathsEntryName( - config: Config.File, - entryName: String - ): Boolean = { - hasCompileClasspathEntryName(config, entryName) && - hasRuntimeClasspathEntryName(config, entryName) - } - - protected def idxOfClasspathEntryName( - config: Config.File, - entryName: String - ): Int = { - val pathValidEntryName = entryName.replace('/', File.separatorChar) - config.project.classpath - .takeWhile(!_.toString.contains(pathValidEntryName)) - .size - } - - protected def hasTestFramework( - config: Config.File, - framework: Config.TestFramework - ): Boolean = { - config.project.test.map(_.frameworks).getOrElse(Nil).contains(framework) - } - - protected def hasTag(config: Config.File, tag: String): Boolean = { - config.project.tags.getOrElse(Nil).contains(tag) - } - - protected def writeBuildScript(buildFile: File, contents: String): Unit = { - Files.write(buildFile.toPath, contents.getBytes(StandardCharsets.UTF_8)) - () - } - - protected def assertAllConfigsMatchJarNames( - configs: List[Config.File], - jarNames: List[String] - ): Unit = { - assertContainsJarNames(configs, jarNames, _.contains(_), assertTrue) - } - - protected def assertAllConfigsHaveAllJars( - configs: List[Config.File], - jarNames: List[String] - ): Unit = { - assertContainsJarNames( - configs, - jarNames.map(j => s"$j.jar"), - _ == _, - assertTrue - ) - } - - protected def assertNoConfigsHaveAnyJars( - configs: List[Config.File], - jarNames: List[String] - ): Unit = { - assertContainsJarNames( - configs, - jarNames.map(j => s"$j.jar"), - _ == _, - assertFalse - ) - } - - protected def assertContainsJarNames( - configs: List[Config.File], - jarNames: List[String], - matchMethod: (String, String) => Boolean, - assertMethod: (String, Boolean) => Unit - ): Unit = { - configs.foreach(config => - jarNames - .foreach(jarName => - assertMethod( - s"${config.project.name} $jarName", - config.project.resolution.exists( - _.modules.exists( - _.artifacts.exists(a => - matchMethod( - PlatformFiles.getFileName(a.path).toString, - jarName - ) - ) - ) - ) - ) - ) - ) - } -} diff --git a/project/BuildPlugin.scala b/project/BuildPlugin.scala index 2d0c004401..51617a3809 100644 --- a/project/BuildPlugin.scala +++ b/project/BuildPlugin.scala @@ -522,7 +522,7 @@ object BuildImplementation { val buildpressHomePath = System.getProperty("user.home") + "/.buildpress" def exportCommunityBuild( buildpress: Reference, - sbtBloop10: Reference + sbtBloop: Reference ) = Def.taskDyn { val isWindows: Boolean = System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows") @@ -540,7 +540,7 @@ object BuildImplementation { val bloopVersion = Keys.version.value Def.task { // Publish the projects before we invoke buildpress - (sbtBloop10 / Keys.publishLocal).value + (sbtBloop / Keys.publishLocal).value val file = Keys.resourceDirectory .in(Compile) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 275afe3d67..cced5eb083 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -6,8 +6,7 @@ object Dependencies { val Scala212Version = "2.12.17" val Scala213Version = "2.13.8" - val Sbt013Version = "0.13.18" - val Sbt1Version = "1.3.3" + val SbtVersion = "1.3.3" val nailgunVersion = "ee3c4343" // Used to download the python client instead of resolving