Skip to content

Commit

Permalink
Drop support for old experimental in community-build
Browse files Browse the repository at this point in the history
  • Loading branch information
hamzaremmal committed Oct 8, 2024
1 parent 35c7d74 commit 8258bb0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ object CommunityBuildRunner:
* and avoid network overhead. See https://github.com/lampepfl/dotty-drone
* for more infrastructural details.
*/
extension (self: CommunityProject) def run()(using suite: CommunityBuildRunner): Unit =
if self.requiresExperimental && !compilerSupportExperimental then
log(s"Skipping ${self.project} - it needs experimental features unsupported in this build.")
return
self.dependencies.foreach(_.publish())
self.testOnlyDependencies().foreach(_.publish())
suite.runProject(self)
extension (self: CommunityProject)
def run()(using suite: CommunityBuildRunner): Unit =
self.dependencies.foreach(_.publish())
self.testOnlyDependencies().foreach(_.publish())
suite.runProject(self)
end extension

trait CommunityBuildRunner:

Expand Down
5 changes: 1 addition & 4 deletions community-build/src/scala/dotty/communitybuild/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ object Main:
Seq("rm", "-rf", destStr).!
Files.createDirectory(dest)
val (toRun, ignored) =
allProjects.partition( p =>
p.docCommand != null
&& (!p.requiresExperimental || compilerSupportExperimental)
)
allProjects.partition(_.docCommand != null)

val paths = toRun.map { project =>
val name = project.project
Expand Down
17 changes: 2 additions & 15 deletions community-build/src/scala/dotty/communitybuild/projects.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ lazy val compilerVersion: String =
val file = communitybuildDir.resolve("scala3-bootstrapped.version")
new String(Files.readAllBytes(file), UTF_8)

lazy val compilerSupportExperimental: Boolean =
compilerVersion.contains("SNAPSHOT") || compilerVersion.contains("NIGHTLY")

lazy val sbtPluginFilePath: String =
// Workaround for https://github.com/sbt/sbt/issues/4395
new File(sys.props("user.home") + "/.sbt/1.0/plugins").mkdirs()
Expand Down Expand Up @@ -43,7 +40,6 @@ sealed trait CommunityProject:
val testOnlyDependencies: () => List[CommunityProject]
val binaryName: String
val runCommandsArgs: List[String] = Nil
val requiresExperimental: Boolean
val environment: Map[String, String] = Map.empty

final val projectDir = communitybuildDir.resolve("community-projects").resolve(project)
Expand All @@ -53,7 +49,6 @@ sealed trait CommunityProject:

/** Publish this project to the local Maven repository */
final def publish(): Unit =
// TODO what should this do with .requiresExperimental?
if !published then
publishDependencies()
log(s"Publishing $project")
Expand All @@ -65,11 +60,6 @@ sealed trait CommunityProject:
published = true

final def doc(): Unit =
if this.requiresExperimental && !compilerSupportExperimental then
log(
s"Skipping ${this.project} - it needs experimental features unsupported in this build."
)
return
publishDependencies()
log(s"Documenting $project")
if docCommand eq null then
Expand All @@ -89,8 +79,7 @@ final case class MillCommunityProject(
baseCommand: String,
dependencies: List[CommunityProject] = Nil,
testOnlyDependencies: () => List[CommunityProject] = () => Nil,
ignoreDocs: Boolean = false,
requiresExperimental: Boolean = false,
ignoreDocs: Boolean = false
) extends CommunityProject:
override val binaryName: String = "./mill"
override val testCommand = s"$baseCommand.test"
Expand All @@ -109,8 +98,7 @@ final case class SbtCommunityProject(
testOnlyDependencies: () => List[CommunityProject] = () => Nil,
sbtPublishCommand: String = null,
sbtDocCommand: String = null,
scalacOptions: List[String] = SbtCommunityProject.scalacOptions,
requiresExperimental: Boolean = false,
scalacOptions: List[String] = SbtCommunityProject.scalacOptions
) extends CommunityProject:
override val binaryName: String = "sbt"

Expand Down Expand Up @@ -260,7 +248,6 @@ object projects:
project = "intent",
sbtTestCommand = "test",
sbtDocCommand = "doc",
requiresExperimental = true,
)

lazy val scalacheck = SbtCommunityProject(
Expand Down

0 comments on commit 8258bb0

Please sign in to comment.