Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manage TestModule dependencies via build.sc #3320

Merged
merged 5 commits into from
Aug 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into manage-test-dependencies
  • Loading branch information
lefou authored Aug 1, 2024
commit 7893f670ee4b85fc949b88c4f34f66af352a9b83
47 changes: 22 additions & 25 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -1227,32 +1227,29 @@ object example extends MillScalaModule {
case "javamodule" => scalamodule
}

def buildScLines = T {
val upstreamLines = os.read.lines(
upstreamCross(this.millModuleSegments.parts.dropRight(1).last)(crossValue)
.testRepoRoot().path / "build.sc"
)
val lines = os.read.lines(testRepoRoot().path / "build.sc")

import collection.mutable
val groupedLines = mutable.Map.empty[String, mutable.Buffer[String]]
var current = Option.empty[String]
lines.foreach {
case s"//// SNIPPET:$name" =>
current = Some(name)
groupedLines(name) = mutable.Buffer()
case s => groupedLines(current.get).append(s)
}

upstreamLines.flatMap {
case s"//// SNIPPET:$name" =>
if (name != "END") {
def buildScLines =
upstreamCross(
this.millModuleSegments.parts.dropRight(1).last).valuesToModules.get(List(crossValue)
) match {
case None =>
T {
super.buildScLines()
}
case Some(upstream) => T {
val upstreamLines = os.read.lines(
upstream
.testRepoRoot().path / "build.sc"
)
val lines = os.read.lines(testRepoRoot().path / "build.sc")

current = Some(name)
groupedLines(name)
} else {
current = None
Nil
import collection.mutable
val groupedLines = mutable.Map.empty[String, mutable.Buffer[String]]
var current = Option.empty[String]
lines.foreach {
case s"//// SNIPPET:$name" =>
current = Some(name)
groupedLines(name) = mutable.Buffer()
case s => groupedLines(current.get).append(s)
}

upstreamLines.flatMap {
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.