Skip to content

Commit

Permalink
Reformat with scalafmt 3.8.4-RC4
Browse files Browse the repository at this point in the history
Executed command: scalafmt --non-interactive
  • Loading branch information
scala-steward committed Jan 12, 2025
1 parent 6d50a65 commit 42da029
Show file tree
Hide file tree
Showing 48 changed files with 267 additions and 227 deletions.
2 changes: 0 additions & 2 deletions ci/shared.mill
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package build.ci



def downloadTestRepo(label: String, commit: String, dest: os.Path) = {
os.unzip.stream(requests.get.stream(s"https://github.com/$label/archive/$commit.zip"), dest)
dest
Expand Down
2 changes: 1 addition & 1 deletion contrib/package.mill
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ object `package` extends RootModule {
def testArgs = Task {
super.testArgs() ++
Seq(
s"-DMILL_SCOVERAGE2_VERSION=${build.Deps.scalacScoverage2Plugin.dep.version}",
s"-DMILL_SCOVERAGE2_VERSION=${build.Deps.scalacScoverage2Plugin.dep.version}"
)
}

Expand Down
40 changes: 24 additions & 16 deletions dist/package.mill
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import $file.ci.upload

import scala.util.Using

trait InstallModule extends build.MillPublishJavaModule{
trait InstallModule extends build.MillPublishJavaModule {
// All modules that we want to aggregate as part of this `dev` assembly.
// Excluding itself, and the `dist` module that uses it
lazy val allPublishModules = build.millInternal.modules.collect {
Expand All @@ -18,7 +18,7 @@ trait InstallModule extends build.MillPublishJavaModule{

def jar: T[PathRef]

def executable = Task{
def executable = Task {
Task.traverse(allPublishModules)(m => m.publishLocalCached)()
jar()
}
Expand All @@ -40,7 +40,9 @@ trait InstallModule extends build.MillPublishJavaModule{

def installLocalCache() = Task.Command {
val path = installLocalTask(
Task.Anon((os.home / ".cache" / "mill" / "download" / (build.millVersion() + batExt)).toString())
Task.Anon(
(os.home / ".cache" / "mill" / "download" / (build.millVersion() + batExt)).toString()
)
)()
Task.log.outputStream.println(path.toString())
PathRef(path)
Expand All @@ -51,12 +53,14 @@ trait InstallModule extends build.MillPublishJavaModule{
if (os.exists(targetFile))
Task.log.info(s"Overwriting existing local Mill binary at ${targetFile}")
os.copy.over(executable().path, targetFile, createFolders = true)
Task.log.info(s"Published ${build.dist.allPublishModules.size} modules and installed ${targetFile}")
Task.log.info(
s"Published ${build.dist.allPublishModules.size} modules and installed ${targetFile}"
)
targetFile
}
}

object `package` extends RootModule with InstallModule {
object `package` extends RootModule with InstallModule {

/**
* Version of [[dist]] meant for local integration testing within the Mill
Expand Down Expand Up @@ -212,11 +216,11 @@ object `package` extends RootModule with InstallModule {
}
}
def launcherScript(
shellJvmArgs: Seq[String],
cmdJvmArgs: Seq[String],
shellClassPath: Agg[String],
cmdClassPath: Agg[String]
) = {
shellJvmArgs: Seq[String],
cmdJvmArgs: Seq[String],
shellClassPath: Agg[String],
cmdClassPath: Agg[String]
) = {

val millMainClass = "mill.runner.client.MillClientMain"

Expand Down Expand Up @@ -264,7 +268,12 @@ object `package` extends RootModule with InstallModule {
def millBootstrap = Task.Source(Task.workspace / "mill")
def millBootstrapBat = Task.Source(Task.workspace / "mill.bat")

def prepareBootstrapLauncher(bootstrap: os.Path, dest: os.Path, buildVersion: String, fileName: String) = {
def prepareBootstrapLauncher(
bootstrap: os.Path,
dest: os.Path,
buildVersion: String,
fileName: String
) = {
val outputPath = dest / fileName
val millBootstrapGrepPrefix = "(\n *DEFAULT_MILL_VERSION=)"

Expand All @@ -288,7 +297,7 @@ object `package` extends RootModule with InstallModule {
prepareBootstrapLauncher(millBootstrapBat().path, Task.dest, build.millVersion(), "mill.bat")
}

def examplePathsWithArtifactName:Task[Seq[(os.Path,String)]] = Task.Anon{
def examplePathsWithArtifactName: Task[Seq[(os.Path, String)]] = Task.Anon {
for {
exampleMod <- build.example.exampleModules
path = exampleMod.millSourcePath
Expand All @@ -299,9 +308,8 @@ object `package` extends RootModule with InstallModule {
}
}


def exampleZips: T[Seq[PathRef]] = Task {
examplePathsWithArtifactName().map{ case (examplePath, exampleStr) =>
examplePathsWithArtifactName().map { case (examplePath, exampleStr) =>
os.copy(examplePath, Task.dest / exampleStr, createFolders = true)
os.write(Task.dest / exampleStr / ".mill-version", build.millLastTag())
os.copy(bootstrapLauncher().path, Task.dest / exampleStr / "mill")
Expand Down Expand Up @@ -350,14 +358,14 @@ object `package` extends RootModule with InstallModule {
}

object native extends mill.scalalib.NativeImageModule with InstallModule {
def artifactOsSuffix = T{
def artifactOsSuffix = T {
val osName = System.getProperty("os.name").toLowerCase
if (osName.contains("mac")) "mac"
else if (osName.contains("windows")) "windows"
else "linux"
}

def artifactCpuSuffix = T{ System.getProperty("os.arch") }
def artifactCpuSuffix = T { System.getProperty("os.arch") }
def artifactName = s"${super.artifactName()}-${artifactOsSuffix()}-${artifactCpuSuffix()}"

def mainClass = Some("mill.runner.client.MillClientMain")
Expand Down
Loading

0 comments on commit 42da029

Please sign in to comment.