From d2071c8fe4b3c60f84053991f334a686d138c981 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Fri, 25 Oct 2024 17:10:02 +0200 Subject: [PATCH 01/30] Update Mill to 0.12.0 --- .mill-version | 2 +- build.sc => build.mill | 21 ++++++++++++------- project/{deps.sc => deps.mill} | 2 ++ project/package.mill | 1 + project/{publish.sc => publish/package.mill} | 4 +++- .../{settings.sc => settings/package.mill} | 8 ++++--- project/{utils.sc => utils.mill} | 2 ++ project/{website.sc => website.mill} | 4 +++- 8 files changed, 30 insertions(+), 14 deletions(-) rename build.sc => build.mill (99%) rename project/{deps.sc => deps.mill} (99%) create mode 100644 project/package.mill rename project/{publish.sc => publish/package.mill} (98%) rename project/{settings.sc => settings/package.mill} (99%) rename project/{utils.sc => utils.mill} (85%) rename project/{website.sc => website.mill} (97%) diff --git a/.mill-version b/.mill-version index bd0119f963..ac454c6a1f 100644 --- a/.mill-version +++ b/.mill-version @@ -1 +1 @@ -0.11.12 +0.12.0 diff --git a/build.sc b/build.mill similarity index 99% rename from build.sc rename to build.mill index 811d015c4c..f583c1d589 100644 --- a/build.sc +++ b/build.mill @@ -1,9 +1,14 @@ +package build + +import $packages._ + import $ivy.`com.lihaoyi::mill-contrib-bloop:$MILL_VERSION` import $ivy.`io.get-coursier::coursier-launcher:2.1.13` import $ivy.`io.github.alexarchambault.mill::mill-native-image-upload:0.1.26` import $file.project.deps, deps.{Deps, Docker, InternalDeps, Java, Scala, TestDeps} -import $file.project.publish, publish.{ghOrg, ghName, ScalaCliPublishModule, organization} -import $file.project.settings, settings.{ +import build.project.publish, publish.{ghOrg, ghName, ScalaCliPublishModule, organization} +import build.project.settings +import build.project.settings.{ CliLaunchers, FormatNativeImageConf, HasTests, @@ -18,8 +23,8 @@ import $file.project.settings, settings.{ projectFileName, jvmPropertiesFileName } -import $file.project.deps, deps.customRepositories -import $file.project.website +import project.deps.customRepositories +import project.website import java.io.File import java.net.URL @@ -408,7 +413,7 @@ trait Core extends ScalaCliCrossSbtModule val testRunnerMainClass = `test-runner`(Scala.runnerScala3) .mainClass() .getOrElse(sys.error("No main class defined for test-runner")) - val runnerMainClass = runner(Scala.runnerScala3) + val runnerMainClass = build.runner(Scala.runnerScala3) .mainClass() .getOrElse(sys.error("No main class defined for runner")) val detailedVersionValue = @@ -438,9 +443,9 @@ trait Core extends ScalaCliCrossSbtModule | def testRunnerVersion = "${`test-runner`(Scala.runnerScala3).publishVersion()}" | def testRunnerMainClass = "$testRunnerMainClass" | - | def runnerOrganization = "${runner(Scala.runnerScala3).pomSettings().organization}" - | def runnerModuleName = "${runner(Scala.runnerScala3).artifactName()}" - | def runnerVersion = "${runner(Scala.runnerScala3).publishVersion()}" + | def runnerOrganization = "${build.runner(Scala.runnerScala3).pomSettings().organization}" + | def runnerModuleName = "${build.runner(Scala.runnerScala3).artifactName()}" + | def runnerVersion = "${build.runner(Scala.runnerScala3).publishVersion()}" | def runnerMainClass = "$runnerMainClass" | | def semanticDbPluginOrganization = "${Deps.semanticDbScalac.dep.module.organization diff --git a/project/deps.sc b/project/deps.mill similarity index 99% rename from project/deps.sc rename to project/deps.mill index 67f97f17ca..82614f65ee 100644 --- a/project/deps.sc +++ b/project/deps.mill @@ -1,3 +1,5 @@ +package build.project + import Deps.Versions import mill._ import scalalib._ diff --git a/project/package.mill b/project/package.mill new file mode 100644 index 0000000000..5aa711479c --- /dev/null +++ b/project/package.mill @@ -0,0 +1 @@ +package build.project diff --git a/project/publish.sc b/project/publish/package.mill similarity index 98% rename from project/publish.sc rename to project/publish/package.mill index 4a305fe2a5..4d6ca916e4 100644 --- a/project/publish.sc +++ b/project/publish/package.mill @@ -1,6 +1,8 @@ +package build.project.publish + import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0` import $ivy.`org.eclipse.jgit:org.eclipse.jgit:6.8.0.202311291450-r` -import $file.settings, settings.{PublishLocalNoFluff, workspaceDirName} +import build.project.settings.{PublishLocalNoFluff, workspaceDirName} import de.tobiasroeser.mill.vcs.version._ import mill._, scalalib._ diff --git a/project/settings.sc b/project/settings/package.mill similarity index 99% rename from project/settings.sc rename to project/settings/package.mill index b28ed46f4d..be4f449fbb 100644 --- a/project/settings.sc +++ b/project/settings/package.mill @@ -1,9 +1,11 @@ +package build.project.settings + import $ivy.`com.goyeau::mill-scalafix::0.3.1` import $ivy.`io.github.alexarchambault.mill::mill-native-image::0.1.26` +import $ivy.`io.get-coursier::coursier-launcher:2.1.14` -import $file.deps, - deps.{Deps, Docker, alpineVersion, buildCsVersion, buildCsM1Version, libsodiumVersion} -import $file.utils, utils.isArmArchitecture +import $file.project.deps, deps.{Deps, Docker, alpineVersion, buildCsVersion, buildCsM1Version, libsodiumVersion} +import $file.project.utils, utils.isArmArchitecture import com.goyeau.mill.scalafix.ScalafixModule import de.tobiasroeser.mill.vcs.version.VcsVersion diff --git a/project/utils.sc b/project/utils.mill similarity index 85% rename from project/utils.sc rename to project/utils.mill index bedd500dda..ab6beaca16 100644 --- a/project/utils.sc +++ b/project/utils.mill @@ -1,3 +1,5 @@ +package build.project + import java.util.Locale lazy val isArmArchitecture: Boolean = diff --git a/project/website.sc b/project/website.mill similarity index 97% rename from project/website.sc rename to project/website.mill index 9bffdec43b..36bf50ccf8 100644 --- a/project/website.sc +++ b/project/website.mill @@ -1,4 +1,6 @@ -import $file.deps, deps.Scala +package build.project + +import deps.Scala private def lastTableLine(path: os.Path, colCount: Int): Seq[String] = { val content = os.read(path) From 83a7a11e183ad325df5055fe4f653b0cac5b0b81 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Sat, 26 Oct 2024 14:03:28 +0200 Subject: [PATCH 02/30] Avoid using positional arguments --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a818da4f8..d8c9abc659 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: with: jvm: "temurin:17" - name: Copy launcher - run: ./mill -i copyJvmLauncher artifacts/ + run: ./mill -i copyJvmLauncher --directory artifacts/ if: runner.os == 'Linux' - name: Copy bootstrapped launcher run: ./mill -i copyJvmBootstrappedLauncher artifacts/ From 33e6c4ac8fc2cf96827fdee5771ff983571ff118 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Sat, 26 Oct 2024 14:04:46 +0200 Subject: [PATCH 03/30] Avoid positional arguments --- .github/scripts/generate-native-image.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/generate-native-image.sh b/.github/scripts/generate-native-image.sh index f9a48629ce..d9fa34ade7 100755 --- a/.github/scripts/generate-native-image.sh +++ b/.github/scripts/generate-native-image.sh @@ -42,7 +42,7 @@ else esac fi - ./mill -i "$COMMAND" generate-native-image.sh "" + ./mill -i "$COMMAND" --scriptDest generate-native-image.sh --imageDest "" bash ./generate-native-image.sh "${CLEANUP[@]}" fi From 3c77c91b1046ea965808ae74f64c5ff1def958f2 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Sat, 26 Oct 2024 15:16:33 +0200 Subject: [PATCH 04/30] Use `T.workspace` when possible --- build.mill | 95 ++++++++++++++++++----------------- project/deps.mill | 2 +- project/publish/package.mill | 9 ++-- project/settings/package.mill | 54 ++++++++++---------- 4 files changed, 81 insertions(+), 79 deletions(-) diff --git a/build.mill b/build.mill index f583c1d589..f4dae9c0a4 100644 --- a/build.mill +++ b/build.mill @@ -199,17 +199,17 @@ trait DocsTests extends CrossSbtModule with ScalaCliScalafixModule with HasTests object test extends ScalaCliTests with ScalaCliScalafixModule { def forkEnv = super.forkEnv() ++ extraEnv() ++ Seq( - "SCALA_CLI_EXAMPLES" -> (os.pwd / "examples").toString, - "SCALA_CLI_GIF_SCENARIOS" -> (os.pwd / "gifs" / "scenarios").toString, - "SCALA_CLI_WEBSITE_IMG" -> (os.pwd / "website" / "static" / "img").toString, - "SCALA_CLI_GIF_RENDERER_DOCKER_DIR" -> (os.pwd / "gifs").toString, - "SCALA_CLI_SVG_RENDERER_DOCKER_DIR" -> (os.pwd / "gifs" / "svg_render").toString + "SCALA_CLI_EXAMPLES" -> (T.workspace / "examples").toString, + "SCALA_CLI_GIF_SCENARIOS" -> (T.workspace / "gifs" / "scenarios").toString, + "SCALA_CLI_WEBSITE_IMG" -> (T.workspace / "website" / "static" / "img").toString, + "SCALA_CLI_GIF_RENDERER_DOCKER_DIR" -> (T.workspace / "gifs").toString, + "SCALA_CLI_SVG_RENDERER_DOCKER_DIR" -> (T.workspace / "gifs" / "svg_render").toString ) def resources = T.sources { // Adding markdown directories here, so that they're watched for changes in watch mode Seq( - PathRef(os.pwd / "website" / "docs" / "commands"), - PathRef(os.pwd / "website" / "docs" / "cookbooks") + PathRef(T.workspace / "website" / "docs" / "commands"), + PathRef(T.workspace / "website" / "docs" / "cookbooks") ) ++ super.resources() } } @@ -304,7 +304,7 @@ trait BuildMacros extends ScalaCliCrossSbtModule } def testNegativeCompilation() = T.command { - val base = os.pwd / "modules" / "build-macros" / "src" + val base = T.workspace / "modules" / "build-macros" / "src" val negativeTests = Seq( "MismatchedLeft.scala" -> Seq( "Found\\: +EE1".r, @@ -939,7 +939,7 @@ trait Cli extends CrossSbtModule with ProtoBuildModule with CliLaunchers mainClass = `scala3-graal-processor`(crossScalaVersion).finalMainClass(), classPath = `scala3-graal-processor`(crossScalaVersion).runClasspath().map(_.path), mainArgs = Seq(cache.toNIO.toString, classpath), - workingDir = os.pwd + workingDir = T.workspace ) val cp = res.out.trim() cp.split(File.pathSeparator).toSeq.map(p => PathRef(os.Path(p))) @@ -1014,8 +1014,8 @@ trait CliIntegration extends SbtModule with ScalaCliPublishModule with HasTests val mostlyStaticDockerfile = os.rel / ".github" / "scripts" / "docker" / "ScalaCliSlimDockerFile" assert( - os.exists(os.pwd / mostlyStaticDockerfile), - s"Error: ${os.pwd / mostlyStaticDockerfile} not found" + os.exists(T.workspace / mostlyStaticDockerfile), + s"Error: ${T.workspace / mostlyStaticDockerfile} not found" ) val code = s"""package scala.cli.integration @@ -1119,7 +1119,7 @@ trait CliIntegration extends SbtModule with ScalaCliPublishModule with HasTests val dir = Option(System.getenv("SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY")).getOrElse { sys.error("SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY not set") } - val content = importedLauncher(dir) + val content = importedLauncher(T.workspace, dir) os.write( launcher, content, @@ -1136,7 +1136,7 @@ trait CliIntegration extends SbtModule with ScalaCliPublishModule with HasTests val dir = Option(System.getenv("SCALA_CLI_IT_FORCED_STATIC_LAUNCHER_DIRECTORY")).getOrElse { sys.error("SCALA_CLI_IT_FORCED_STATIC_LAUNCHER_DIRECTORY not set") } - val content = importedLauncher(dir) + val content = importedLauncher(T.workspace, dir) os.write(launcher, content, createFolders = true) } PathRef(launcher) @@ -1149,7 +1149,7 @@ trait CliIntegration extends SbtModule with ScalaCliPublishModule with HasTests Option(System.getenv("SCALA_CLI_IT_FORCED_MOSTLY_STATIC_LAUNCHER_DIRECTORY")).getOrElse { sys.error("SCALA_CLI_IT_FORCED_MOSTLY_STATIC_LAUNCHER_DIRECTORY not set") } - val content = importedLauncher(dir) + val content = importedLauncher(T.workspace, dir) os.write(launcher, content, createFolders = true) } PathRef(launcher) @@ -1280,12 +1280,13 @@ object `local-repo` extends LocalRepo { def publishSonatype(tasks: mill.main.Tasks[PublishModule.PublishData]) = T.command { publish.publishSonatype( data = define.Target.sequence(tasks.value)(), - log = T.ctx().log + log = T.ctx().log, + workspace = T.workspace ) } def copyTo(task: mill.main.Tasks[PathRef], dest: String) = T.command { - val destPath = os.Path(dest, os.pwd) + val destPath = os.Path(dest, T.workspace) if (task.value.length > 1) sys.error("Expected a single task") val ref = task.value.head() @@ -1294,7 +1295,7 @@ def copyTo(task: mill.main.Tasks[PathRef], dest: String) = T.command { } def writePackageVersionTo(dest: String) = T.command { - val destPath = os.Path(dest, os.pwd) + val destPath = os.Path(dest, T.workspace) val rawVersion = cli(Scala.defaultInternal).publishVersion() val version = if (rawVersion.contains("+")) rawVersion.stripSuffix("-SNAPSHOT") @@ -1303,15 +1304,15 @@ def writePackageVersionTo(dest: String) = T.command { } def writeShortPackageVersionTo(dest: String) = T.command { - val destPath = os.Path(dest, os.pwd) + val destPath = os.Path(dest, T.workspace) val rawVersion = cli(Scala.defaultInternal).publishVersion() val version = rawVersion.takeWhile(c => c != '-' && c != '+') os.write.over(destPath, version) } -def importedLauncher(directory: String = "artifacts"): Array[Byte] = { +def importedLauncher(workspace: os.Path, directory: String = "artifacts"): Array[Byte] = { val ext = if (Properties.isWin) ".zip" else ".gz" - val from = os.Path(directory, os.pwd) / s"scala-cli-${Upload.platformSuffix}$ext" + val from = workspace / directory / s"scala-cli-${Upload.platformSuffix}$ext" System.err.println(s"Importing launcher from $from") if (!os.exists(from)) sys.error(s"$from not found") @@ -1351,7 +1352,7 @@ def copyJvmLauncher(directory: String = "artifacts") = T.command { val launcher = cli(Scala.defaultInternal).standaloneLauncher().path os.copy( launcher, - os.Path(directory, os.pwd) / s"scala-cli$platformExecutableJarExtension", + os.Path(directory, T.workspace) / s"scala-cli$platformExecutableJarExtension", createFolders = true, replaceExisting = true ) @@ -1360,7 +1361,7 @@ def copyJvmBootstrappedLauncher(directory: String = "artifacts") = T.command { val launcher = cliBootstrapped.jar().path os.copy( launcher, - os.Path(directory, os.pwd) / s"scala-cli.jar", + os.Path(directory, T.workspace) / s"scala-cli.jar", createFolders = true, replaceExisting = true ) @@ -1369,7 +1370,7 @@ def copyJvmBootstrappedLauncher(directory: String = "artifacts") = T.command { def uploadLaunchers(directory: String = "artifacts") = T.command { val version = cli(Scala.defaultInternal).publishVersion() - val path = os.Path(directory, os.pwd) + val path = os.Path(directory, T.workspace) val launchers = os.list(path).filter(os.isFile(_)).map { path => path -> path.last } @@ -1473,7 +1474,7 @@ object ci extends Module { def updateScalaCliSetup() = T.command { val version = cli(Scala.defaultInternal).publishVersion() - val targetDir = os.pwd / "target-scala-cli-setup" + val targetDir = T.workspace / "target-scala-cli-setup" val mainDir = targetDir / "scala-cli-setup" val setupScriptPath = mainDir / "src" / "main.ts" @@ -1502,7 +1503,7 @@ object ci extends Module { def updateStandaloneLauncher() = T.command { val version = cli(Scala.defaultInternal).publishVersion() - val targetDir = os.pwd / "target" + val targetDir = T.workspace / "target" val scalaCliDir = targetDir / "scala-cli" val standaloneLauncherPath = scalaCliDir / "scala-cli.sh" val standaloneWindowsLauncherPath = scalaCliDir / "scala-cli.bat" @@ -1567,7 +1568,7 @@ object ci extends Module { def updateScalaCliBrewFormula() = T.command { val version = cli(Scala.defaultInternal).publishVersion() - val targetDir = os.pwd / "target" + val targetDir = T.workspace / "target" val homebrewFormulaDir = targetDir / "homebrew-scala-cli" // clean target directory @@ -1587,11 +1588,11 @@ object ci extends Module { val arm64LauncherURL = s"https://github.com/Virtuslab/scala-cli/releases/download/v$version/scala-cli-aarch64-apple-darwin.gz" - val x86LauncherPath = os.Path("artifacts", os.pwd) / "scala-cli-x86_64-apple-darwin.gz" - val arm64LauncherPath = os.Path("artifacts", os.pwd) / "scala-cli-aarch64-apple-darwin.gz" + val x86LauncherPath = os.Path("artifacts", T.workspace) / "scala-cli-x86_64-apple-darwin.gz" + val arm64LauncherPath = os.Path("artifacts", T.workspace) / "scala-cli-aarch64-apple-darwin.gz" val (x86Sha256, arm64Sha256) = brewLaunchersSha(x86LauncherPath, arm64LauncherPath, targetDir) - val templateFormulaPath = os.pwd / ".github" / "scripts" / "scala-cli.rb.template" + val templateFormulaPath = T.workspace / ".github" / "scripts" / "scala-cli.rb.template" val template = os.read(templateFormulaPath) val updatedFormula = template @@ -1609,7 +1610,7 @@ object ci extends Module { def updateScalaExperimentalBrewFormula() = T.command { val version = cli(Scala.defaultInternal).publishVersion() - val targetDir = os.pwd / "target" + val targetDir = T.workspace / "target" val homebrewFormulaDir = targetDir / "homebrew-scala-experimental" // clean homebrew-scala-experimental directory @@ -1629,11 +1630,11 @@ object ci extends Module { val arm64LauncherURL = s"https://github.com/Virtuslab/scala-cli/releases/download/v$version/scala-cli-aarch64-apple-darwin.gz" - val x86LauncherPath = os.Path("artifacts", os.pwd) / "scala-cli-x86_64-apple-darwin.gz" - val arm64LauncherPath = os.Path("artifacts", os.pwd) / "scala-cli-aarch64-apple-darwin.gz" + val x86LauncherPath = os.Path("artifacts", T.workspace) / "scala-cli-x86_64-apple-darwin.gz" + val arm64LauncherPath = os.Path("artifacts", T.workspace) / "scala-cli-aarch64-apple-darwin.gz" val (x86Sha256, arm64Sha256) = brewLaunchersSha(x86LauncherPath, arm64LauncherPath, targetDir) - val templateFormulaPath = os.pwd / ".github" / "scripts" / "scala.rb.template" + val templateFormulaPath = T.workspace / ".github" / "scripts" / "scala.rb.template" val template = os.read(templateFormulaPath) val updatedFormula = template @@ -1651,7 +1652,7 @@ object ci extends Module { def updateInstallationScript() = T.command { val version = cli(Scala.defaultInternal).publishVersion() - val targetDir = os.pwd / "target" + val targetDir = T.workspace / "target" val packagesDir = targetDir / "scala-cli-packages" val installationScriptPath = packagesDir / "scala-setup.sh" @@ -1678,7 +1679,7 @@ object ci extends Module { def updateDebianPackages() = T.command { val version = cli(Scala.defaultInternal).publishVersion() - val targetDir = os.pwd / "target" + val targetDir = T.workspace / "target" val packagesDir = targetDir / "scala-cli-packages" val debianDir = packagesDir / "debian" @@ -1696,7 +1697,7 @@ object ci extends Module { // copy deb package to repository os.copy( - os.Path("artifacts", os.pwd) / "scala-cli-x86_64-pc-linux.deb", + os.Path("artifacts", T.workspace) / "scala-cli-x86_64-pc-linux.deb", debianDir / s"scala-cli_$version.deb" ) @@ -1746,12 +1747,12 @@ object ci extends Module { def updateChocolateyPackage() = T.command { val version = cli(Scala.defaultInternal).publishVersion() - val packagesDir = os.pwd / "target" / "scala-cli-packages" - val chocoDir = os.pwd / ".github" / "scripts" / "choco" + val packagesDir = T.workspace / "target" / "scala-cli-packages" + val chocoDir = T.workspace / ".github" / "scripts" / "choco" val msiPackagePath = packagesDir / s"scala-cli_$version.msi" os.copy( - os.pwd / "artifacts" / "scala-cli-x86_64-pc-win32.msi", + T.workspace / "artifacts" / "scala-cli-x86_64-pc-win32.msi", msiPackagePath, createFolders = true ) @@ -1790,7 +1791,7 @@ object ci extends Module { def updateCentOsPackages() = T.command { val version = cli(Scala.defaultInternal).publishVersion() - val targetDir = os.pwd / "target" + val targetDir = T.workspace / "target" val packagesDir = targetDir / "scala-cli-packages" val centOsDir = packagesDir / "CentOS" @@ -1808,7 +1809,7 @@ object ci extends Module { // copy rpm package to repository os.copy( - os.Path("artifacts", os.pwd) / "scala-cli-x86_64-pc-linux.rpm", + os.Path("artifacts", T.workspace) / "scala-cli-x86_64-pc-linux.rpm", centOsDir / "Packages" / s"scala-cli_$version.rpm" ) @@ -1870,7 +1871,7 @@ object ci extends Module { .mkString(System.lineSeparator()) ) } - val destDir = os.Path(directory, os.pwd) + val destDir = os.Path(directory, T.workspace) os.copy(orig, destDir / distName, createFolders = true, replaceExisting = true) } def writeWixConfigExtra(dest: String = "wix-visual-cpp-redist.xml") = T.command { @@ -1913,7 +1914,7 @@ object ci extends Module { | | |""".stripMargin - val dest0 = os.Path(dest, os.pwd) + val dest0 = os.Path(dest, T.workspace) os.write.over(dest0, content.getBytes(Charset.defaultCharset()), createFolders = true) } def setShouldPublish() = T.command { @@ -1933,18 +1934,18 @@ object ci extends Module { "--ttl", "0" ) - val baseJavaHome = os.Path(command.!!.trim, os.pwd) + val baseJavaHome = os.Path(command.!!.trim, T.workspace) System.err.println(s"Initial Java home $baseJavaHome") - val destJavaHome = os.Path(dest, os.pwd) + val destJavaHome = os.Path(dest, T.workspace) os.copy(baseJavaHome, destJavaHome, createFolders = true) System.err.println(s"New Java home $destJavaHome") destJavaHome } def checkScalaVersions() = T.command { - website.checkMainScalaVersions(os.pwd / "website" / "docs" / "reference" / "scala-versions.md") + website.checkMainScalaVersions(T.workspace / "website" / "docs" / "reference" / "scala-versions.md") website.checkScalaJsVersions( - os.pwd / "website" / "docs" / "guides" / "advanced" / "scala-js.md" + T.workspace / "website" / "docs" / "guides" / "advanced" / "scala-js.md" ) } } diff --git a/project/deps.mill b/project/deps.mill index a25a902c8a..378b9152ce 100644 --- a/project/deps.mill +++ b/project/deps.mill @@ -94,7 +94,7 @@ object TestDeps { object InternalDeps { object Versions { - def mill = os.read(os.pwd / ".mill-version").trim + def mill = _root_.mill.main.BuildInfo.millVersion def lefouMillwRef = "166bcdf5741de8569e0630e18c3b2ef7e252cd96" } } diff --git a/project/publish/package.mill b/project/publish/package.mill index 4d6ca916e4..4b1e9f46f2 100644 --- a/project/publish/package.mill +++ b/project/publish/package.mill @@ -20,7 +20,7 @@ lazy val (ghOrg, ghName) = { val repos = { var git: Git = null try { - git = Git.open(os.pwd.toIO) + git = Git.open(os.Path(sys.env("MILL_TEST_RESOURCE_DIR")).toIO) git.remoteList().call().asScala.toVector } finally @@ -155,7 +155,8 @@ trait ScalaCliPublishModule extends PublishModule with PublishLocalNoFluff { def publishSonatype( data: Seq[PublishModule.PublishData], - log: mill.api.Logger + log: mill.api.Logger, + workspace: os.Path ): Unit = { val credentials = sys.env("SONATYPE_USERNAME") + ":" + sys.env("SONATYPE_PASSWORD") @@ -195,7 +196,7 @@ def publishSonatype( readTimeout = timeout.toMillis.toInt, connectTimeout = timeout.toMillis.toInt, log = log, - workspace = os.pwd, + workspace = workspace, env = sys.env, awaitTimeout = timeout.toMillis.toInt, stagingRelease = isRelease @@ -224,7 +225,7 @@ def setShouldPublish() = T.command { val charSet = Charset.defaultCharset() val nl = System.lineSeparator() os.write.append( - os.Path(envFile, os.pwd), + os.Path(envFile, T.workspace), s"SHOULD_PUBLISH=${shouldPublish()}$nl".getBytes(charSet) ) } diff --git a/project/settings/package.mill b/project/settings/package.mill index be4f449fbb..05d2dba39d 100644 --- a/project/settings/package.mill +++ b/project/settings/package.mill @@ -98,7 +98,7 @@ def cs: T[String] = T.persistent { case t: Throwable => throw new Exception(s"Error getting and extracting $url", t) } - val f = maybeFile.fold(ex => throw new Exception(ex), os.Path(_, os.pwd)) + val f = maybeFile.fold(ex => throw new Exception(ex), os.Path(_, T.workspace)) val exec = if (Properties.isWin && os.isDir(f) && f.last.endsWith(".zip")) os.list(f).find(_.last.endsWith(".exe")).getOrElse( @@ -188,7 +188,7 @@ trait CliLaunchers extends SbtModule { self => private def staticLibDirName = "native-libs" - private def copyCsjniutilTo(cs: String, destDir: os.Path): Unit = { + private def copyCsjniutilTo(cs: String, destDir: os.Path, workspace: os.Path): Unit = T.task { val jniUtilsVersion = Deps.jniUtils.dep.version val libRes = os.proc( cs, @@ -198,10 +198,10 @@ trait CliLaunchers extends SbtModule { self => "-A", "lib" ).call() - val libPath = os.Path(libRes.out.trim(), os.pwd) + val libPath = os.Path(libRes.out.trim(), workspace) os.copy.over(libPath, destDir / "csjniutils.lib") } - private def copyLibsodiumjniTo(cs: String, destDir: os.Path): Unit = { + private def copyLibsodiumjniTo(cs: String, destDir: os.Path, workspace: os.Path): Unit = { val libsodiumjniVersion = Deps.libsodiumjni.dep.version val (classifier, ext) = sys.props.get("os.arch") match { case Some("x86_64" | "amd64") => @@ -226,26 +226,26 @@ trait CliLaunchers extends SbtModule { self => "-A", ext ).call() - val libPath = os.Path(libRes.out.trim(), os.pwd) + val libPath = os.Path(libRes.out.trim(), workspace) val prefix = if (Properties.isWin) "" else "lib" os.copy.over(libPath, destDir / s"${prefix}sodiumjni.$ext") } - private def copyLibsodiumStaticTo(cs: String, destDir: os.Path): Unit = { + private def copyLibsodiumStaticTo(cs: String, destDir: os.Path, workspace: os.Path): Unit = { val dirRes = os.proc( cs, "get", "--archive", "https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-stable-msvc.zip" ).call() - val dir = os.Path(dirRes.out.trim(), os.pwd) + val dir = os.Path(dirRes.out.trim(), workspace) os.copy.over( dir / "libsodium" / "x64" / "Release" / "v143" / "static" / "libsodium.lib", destDir / "sodium.lib" ) } - private def copyAlpineLibsodiumTo(cs: String, destDir: os.Path): Unit = { + private def copyAlpineLibsodiumTo(cs: String, destDir: os.Path, workspace: os.Path): Unit = { val arcPath = os.proc( cs, "get", @@ -253,7 +253,7 @@ trait CliLaunchers extends SbtModule { self => ).call().out.trim() val tmpDir = os.temp.dir(prefix = "libsodium-static") try { - os.proc("tar", "-zxf", os.Path(arcPath, os.pwd)) + os.proc("tar", "-zxf", os.Path(arcPath, workspace)) .call(cwd = tmpDir, stdout = os.Inherit) os.copy.over(tmpDir / "usr" / "lib" / "libsodium.a", destDir / "libsodium.a") } @@ -279,14 +279,14 @@ trait CliLaunchers extends SbtModule { self => os.makeDir.all(dir) if (Properties.isWin) { - copyLibsodiumStaticTo(cs(), dir) - copyLibsodiumjniTo(cs(), dir) - copyCsjniutilTo(cs(), dir) + copyLibsodiumStaticTo(cs(), dir, T.workspace) + copyLibsodiumjniTo(cs(), dir, T.workspace) + copyCsjniutilTo(cs(), dir, T.workspace) } if (launcherKind == "static") { - copyAlpineLibsodiumTo(cs(), dir) - copyLibsodiumjniTo(cs(), dir) + copyAlpineLibsodiumTo(cs(), dir, T.workspace) + copyLibsodiumjniTo(cs(), dir, T.workspace) } PathRef(dir) @@ -355,7 +355,7 @@ trait CliLaunchers extends SbtModule { self => } def buildHelperImage = T { os.proc("docker", "build", "-t", Docker.customMuslBuilderImageName, ".") - .call(cwd = os.pwd / "project" / "musl-image", stdout = os.Inherit) + .call(cwd = T.workspace / "project" / "musl-image", stdout = os.Inherit) () } def writeNativeImageScript(scriptDest: String, imageDest: String = "") = T.command { @@ -434,7 +434,7 @@ trait CliLaunchers extends SbtModule { self => stdin = os.Inherit, stdout = os.Inherit ) - T.log.outputStream.println(s"Config generated in ${outputDir.relativeTo(os.pwd)}") + T.log.outputStream.println(s"Config generated in ${outputDir.relativeTo(T.workspace)}") } def runFromJars(args: String*) = T.command { @@ -486,7 +486,7 @@ trait CliLaunchers extends SbtModule { self => def standaloneLauncher = T { - val cachePath = os.Path(coursier.cache.FileCache().location, os.pwd) + val cachePath = os.Path(coursier.cache.FileCache().location, T.workspace) def urlOf(path: os.Path): Option[String] = if (path.startsWith(cachePath)) { val segments = path.relativeTo(cachePath).segments @@ -542,7 +542,7 @@ trait HasTests extends SbtModule { else Nil super.scalacOptions() ++ extraOptions } - trait ScalaCliTests extends ScalaCliModule with super.SbtModuleTests with TestModule.Munit { + trait ScalaCliTests extends ScalaCliModule with super.SbtTests with TestModule.Munit { def ivyDeps = super.ivyDeps() ++ Agg( Deps.expecty, Deps.munit @@ -574,10 +574,10 @@ trait PublishLocalNoFluff extends PublishModule { val publisher = localIvyRepo match { case null => LocalIvyPublisher case repo => - new LocalIvyPublisher(os.Path(repo.replace("{VERSION}", publishVersion()), os.pwd)) + new LocalIvyPublisher(os.Path(repo.replace("{VERSION}", publishVersion()), T.workspace)) } - publisher.publish( + publisher.publishLocal( jar = jar().path, sourcesJar = emptyZip().path, docJar = emptyZip().path, @@ -615,7 +615,7 @@ trait LocalRepo extends Module { val repoVer = vcsState().format() val ver = version() val something = localRepo() - val repoDir = os.pwd / "out" / "repo" / ver + val repoDir = T.workspace / "out" / "repo" / ver val destDir = T.dest / ver / "repo.zip" val dest = destDir / "repo.zip" @@ -759,7 +759,7 @@ trait FormatNativeImageConf extends JavaModule { System.err.println(msg) for (f <- needsFormatting) System.err.println( - s" ${if (f.startsWith(os.pwd)) f.relativeTo(os.pwd).toString else f.toString}" + s" ${if (f.startsWith(T.workspace)) f.relativeTo(T.workspace).toString else f.toString}" ) System.err.println( """Run @@ -785,18 +785,18 @@ trait ScalaCliScalafixModule extends ScalafixModule { def scalafixConfig = T { if (scalaVersion().startsWith("2.")) super.scalafixConfig() - else Some(os.pwd / ".scalafix3.conf") + else Some(T.workspace / ".scalafix3.conf") } def scalacPluginIvyDeps = super.scalacPluginIvyDeps() ++ { if (scalaVersion().startsWith("2.")) Seq(Deps.semanticDbScalac) else Nil } // Explicitly setting sourceroot, so that Scala CLI doesn't use a wrong one. - // Using os.pwd is more or less required, for scalafix stuff to work fine. + // Using T.workspace is more or less required, for scalafix stuff to work fine. def scalacOptions = T { val sv = scalaVersion() val isScala2 = sv.startsWith("2.") - val sourceRoot = os.pwd + val sourceRoot = T.workspace val parentOptions = { val l = super.scalacOptions() if (isScala2) l.filterNot(_.startsWith("-P:semanticdb:sourceroot:")) @@ -849,7 +849,7 @@ object Licenses { implicit val rw: ReadWriter[Licenses] = macroRW } -def updateLicensesFile() = { +def updateLicensesFile = T.task { val url = "https://github.com/spdx/license-list-data/raw/master/json/licenses.json" var is: InputStream = null val b = @@ -890,7 +890,7 @@ def updateLicensesFile() = { val dest = os.rel / "modules" / "build" / "src" / "main" / "scala" / "scala" / "build" / "internal" / "Licenses.scala" - os.write.over(os.pwd / dest, genSource) + os.write.over(T.workspace / dest, genSource) System.err.println(s"Wrote $dest") } From 7933c3fc174141935b765e2def241475a8055555 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Sat, 26 Oct 2024 15:25:36 +0200 Subject: [PATCH 05/30] Use os.pwd in static code --- project/publish/package.mill | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/publish/package.mill b/project/publish/package.mill index 4b1e9f46f2..e7cdbb98e3 100644 --- a/project/publish/package.mill +++ b/project/publish/package.mill @@ -20,7 +20,7 @@ lazy val (ghOrg, ghName) = { val repos = { var git: Git = null try { - git = Git.open(os.Path(sys.env("MILL_TEST_RESOURCE_DIR")).toIO) + git = Git.open(os.pwd.toIO) git.remoteList().call().asScala.toVector } finally From 9ac1db41987f0500a96bd38455c57d75161ee5f3 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Sat, 26 Oct 2024 15:43:04 +0200 Subject: [PATCH 06/30] Use `MILL_WORKSPACE_ROOT` instead of os.pwd --- project/publish/package.mill | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/publish/package.mill b/project/publish/package.mill index e7cdbb98e3..527a883cae 100644 --- a/project/publish/package.mill +++ b/project/publish/package.mill @@ -20,7 +20,7 @@ lazy val (ghOrg, ghName) = { val repos = { var git: Git = null try { - git = Git.open(os.pwd.toIO) + git = Git.open(os.Path(sys.env("MILL_WORKSPACE_ROOT")).toIO) git.remoteList().call().asScala.toVector } finally From f736bc570c52ee25baec64031f49aa79f26b609a Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Sat, 26 Oct 2024 15:47:38 +0200 Subject: [PATCH 07/30] Avoid positional arguments --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8c9abc659..c53084fd7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: run: ./mill -i copyJvmLauncher --directory artifacts/ if: runner.os == 'Linux' - name: Copy bootstrapped launcher - run: ./mill -i copyJvmBootstrappedLauncher artifacts/ + run: ./mill -i copyJvmBootstrappedLauncher --directory artifacts/ if: runner.os == 'Linux' - uses: actions/upload-artifact@v3 if: runner.os == 'Linux' From 559cf98e7b95db7b036063db55874726f0f2fd76 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Sat, 26 Oct 2024 15:58:16 +0200 Subject: [PATCH 08/30] Pass `streamOut = false` to return the stdout instead of printing it --- build.mill | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.mill b/build.mill index f4dae9c0a4..ead3633084 100644 --- a/build.mill +++ b/build.mill @@ -939,7 +939,8 @@ trait Cli extends CrossSbtModule with ProtoBuildModule with CliLaunchers mainClass = `scala3-graal-processor`(crossScalaVersion).finalMainClass(), classPath = `scala3-graal-processor`(crossScalaVersion).runClasspath().map(_.path), mainArgs = Seq(cache.toNIO.toString, classpath), - workingDir = T.workspace + workingDir = T.workspace, + streamOut = false ) val cp = res.out.trim() cp.split(File.pathSeparator).toSeq.map(p => PathRef(os.Path(p))) From 91180137e6e9c58413c24b5c6bc1705d39d6ab86 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Sat, 26 Oct 2024 16:01:07 +0200 Subject: [PATCH 09/30] Avoid positional arguments --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c53084fd7f..8c0963d046 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1551,7 +1551,7 @@ jobs: - name: Java Home run: echo "$JAVA_HOME" - name: Build Scala CLI - run: ./mill copyJvmLauncher build + run: ./mill copyJvmLauncher --directory build - name: Build Benchmark run: java -jar ./build/scala-cli --power package --standalone gcbenchmark/gcbenchmark.scala -o gc - name: Run Benchmark From 1e0cd8cc966a2886340840f0a51863d8e66cbb7b Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Sat, 26 Oct 2024 16:11:36 +0200 Subject: [PATCH 10/30] Fix ScalaCliSuite paths --- .../src/test/scala/scala/cli/integration/ScalaCliSuite.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/integration/src/test/scala/scala/cli/integration/ScalaCliSuite.scala b/modules/integration/src/test/scala/scala/cli/integration/ScalaCliSuite.scala index 9551a1d8a5..f249e3c862 100644 --- a/modules/integration/src/test/scala/scala/cli/integration/ScalaCliSuite.scala +++ b/modules/integration/src/test/scala/scala/cli/integration/ScalaCliSuite.scala @@ -6,11 +6,11 @@ import scala.concurrent.duration.{Duration, FiniteDuration} abstract class ScalaCliSuite extends munit.FunSuite { implicit class BeforeEachOpts(munitContext: BeforeEach) { - def locationAbsolutePath: os.Path = os.pwd / os.RelPath(munitContext.test.location.path) + def locationAbsolutePath: os.Path = os.Path(munitContext.test.location.path) } implicit class AfterEachOpts(munitContext: AfterEach) { - def locationAbsolutePath: os.Path = os.pwd / os.RelPath(munitContext.test.location.path) + def locationAbsolutePath: os.Path = os.Path(munitContext.test.location.path) } val testStartEndLogger: Fixture[Unit] = new Fixture[Unit]("files") { def apply(): Unit = () From 35cf7be600907c178d74e7582a519e23d98f4748 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Sat, 26 Oct 2024 23:50:07 +0200 Subject: [PATCH 11/30] Fix locationAbsolutePath --- .../src/test/scala/scala/build/tests/TestUtil.scala | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/build/src/test/scala/scala/build/tests/TestUtil.scala b/modules/build/src/test/scala/scala/build/tests/TestUtil.scala index 9b583f2f73..544fc6c726 100644 --- a/modules/build/src/test/scala/scala/build/tests/TestUtil.scala +++ b/modules/build/src/test/scala/scala/build/tests/TestUtil.scala @@ -12,12 +12,10 @@ object TestUtil { abstract class ScalaCliBuildSuite extends munit.FunSuite { extension (munitContext: BeforeEach | AfterEach) { def locationAbsolutePath: os.Path = - os.pwd / os.RelPath { - (munitContext match { - case beforeEach: BeforeEach => beforeEach.test - case afterEach: AfterEach => afterEach.test - }).location.path - } + (munitContext match { + case beforeEach: BeforeEach => beforeEach.test + case afterEach: AfterEach => afterEach.test + }).location.path } override def munitTimeout = new FiniteDuration(120, TimeUnit.SECONDS) val testStartEndLogger = new Fixture[Unit]("files") { From 0114814945f566aa5ee51f286a1ab1893a56baa5 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Sun, 27 Oct 2024 09:53:36 +0100 Subject: [PATCH 12/30] Revert making copyCsjniutilTo a Task --- project/settings/package.mill | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/settings/package.mill b/project/settings/package.mill index 05d2dba39d..2db1dcc921 100644 --- a/project/settings/package.mill +++ b/project/settings/package.mill @@ -188,7 +188,7 @@ trait CliLaunchers extends SbtModule { self => private def staticLibDirName = "native-libs" - private def copyCsjniutilTo(cs: String, destDir: os.Path, workspace: os.Path): Unit = T.task { + private def copyCsjniutilTo(cs: String, destDir: os.Path, workspace: os.Path): Unit = { val jniUtilsVersion = Deps.jniUtils.dep.version val libRes = os.proc( cs, From d94f82f77331d49d729dce507a0ad9439cdb2652 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Sun, 27 Oct 2024 09:54:38 +0100 Subject: [PATCH 13/30] Use .mill.scala suffix --- build.mill => build.mill.scala | 0 project/{deps.mill => deps.mill.scala} | 0 project/{package.mill => package.mill.scala} | 0 project/publish/{package.mill => package.mill.scala} | 0 project/settings/{package.mill => package.mill.scala} | 0 project/{utils.mill => utils.mill.scala} | 0 project/{website.mill => website.mill.scala} | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename build.mill => build.mill.scala (100%) rename project/{deps.mill => deps.mill.scala} (100%) rename project/{package.mill => package.mill.scala} (100%) rename project/publish/{package.mill => package.mill.scala} (100%) rename project/settings/{package.mill => package.mill.scala} (100%) rename project/{utils.mill => utils.mill.scala} (100%) rename project/{website.mill => website.mill.scala} (100%) diff --git a/build.mill b/build.mill.scala similarity index 100% rename from build.mill rename to build.mill.scala diff --git a/project/deps.mill b/project/deps.mill.scala similarity index 100% rename from project/deps.mill rename to project/deps.mill.scala diff --git a/project/package.mill b/project/package.mill.scala similarity index 100% rename from project/package.mill rename to project/package.mill.scala diff --git a/project/publish/package.mill b/project/publish/package.mill.scala similarity index 100% rename from project/publish/package.mill rename to project/publish/package.mill.scala diff --git a/project/settings/package.mill b/project/settings/package.mill.scala similarity index 100% rename from project/settings/package.mill rename to project/settings/package.mill.scala diff --git a/project/utils.mill b/project/utils.mill.scala similarity index 100% rename from project/utils.mill rename to project/utils.mill.scala diff --git a/project/website.mill b/project/website.mill.scala similarity index 100% rename from project/website.mill rename to project/website.mill.scala From 9b3c5f41ad3f90c2291ee7781a2f5f25998941e4 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Sun, 27 Oct 2024 10:09:05 +0100 Subject: [PATCH 14/30] Make TestUtil compile again --- .../src/test/scala/scala/build/tests/TestUtil.scala | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/build/src/test/scala/scala/build/tests/TestUtil.scala b/modules/build/src/test/scala/scala/build/tests/TestUtil.scala index 544fc6c726..05323ac8a9 100644 --- a/modules/build/src/test/scala/scala/build/tests/TestUtil.scala +++ b/modules/build/src/test/scala/scala/build/tests/TestUtil.scala @@ -12,10 +12,12 @@ object TestUtil { abstract class ScalaCliBuildSuite extends munit.FunSuite { extension (munitContext: BeforeEach | AfterEach) { def locationAbsolutePath: os.Path = - (munitContext match { - case beforeEach: BeforeEach => beforeEach.test - case afterEach: AfterEach => afterEach.test - }).location.path + os.Path { + (munitContext match { + case beforeEach: BeforeEach => beforeEach.test + case afterEach: AfterEach => afterEach.test + }).location.path + } } override def munitTimeout = new FiniteDuration(120, TimeUnit.SECONDS) val testStartEndLogger = new Fixture[Unit]("files") { From 29762435ae50e6746a8ec7bbe6707d8444d362f3 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Mon, 28 Oct 2024 14:03:46 +0100 Subject: [PATCH 15/30] Update mill-native-image to 0.1.28 --- build.mill.scala | 2 +- project/settings/package.mill.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.mill.scala b/build.mill.scala index ead3633084..c424a28f45 100644 --- a/build.mill.scala +++ b/build.mill.scala @@ -4,7 +4,7 @@ import $packages._ import $ivy.`com.lihaoyi::mill-contrib-bloop:$MILL_VERSION` import $ivy.`io.get-coursier::coursier-launcher:2.1.13` -import $ivy.`io.github.alexarchambault.mill::mill-native-image-upload:0.1.26` +import $ivy.`io.github.alexarchambault.mill::mill-native-image-upload:0.1.28` import $file.project.deps, deps.{Deps, Docker, InternalDeps, Java, Scala, TestDeps} import build.project.publish, publish.{ghOrg, ghName, ScalaCliPublishModule, organization} import build.project.settings diff --git a/project/settings/package.mill.scala b/project/settings/package.mill.scala index 2db1dcc921..894c337fea 100644 --- a/project/settings/package.mill.scala +++ b/project/settings/package.mill.scala @@ -1,7 +1,7 @@ package build.project.settings import $ivy.`com.goyeau::mill-scalafix::0.3.1` -import $ivy.`io.github.alexarchambault.mill::mill-native-image::0.1.26` +import $ivy.`io.github.alexarchambault.mill::mill-native-image::0.1.28` import $ivy.`io.get-coursier::coursier-launcher:2.1.14` import $file.project.deps, deps.{Deps, Docker, alpineVersion, buildCsVersion, buildCsM1Version, libsodiumVersion} From 497cb51bbb8189e04ebc0ebcbdaf7ecaceebfc93 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Mon, 28 Oct 2024 14:32:06 +0100 Subject: [PATCH 16/30] Avoid positional arguments --- .github/scripts/generate-docker-image.sh | 2 +- .github/scripts/generate-os-packages.sh | 4 ++-- .github/scripts/generate-slim-docker-image.sh | 2 +- .github/scripts/publish-sdkman.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/scripts/generate-docker-image.sh b/.github/scripts/generate-docker-image.sh index 3ff00ce82a..36c1380ccb 100755 --- a/.github/scripts/generate-docker-image.sh +++ b/.github/scripts/generate-docker-image.sh @@ -5,7 +5,7 @@ ROOT="$(cd "$(dirname "$0")/../.." && pwd)" WORKDIR="$ROOT/out/docker-workdir" mkdir -p "$WORKDIR" -./mill -i copyTo 'cli[]'.nativeImageStatic "$WORKDIR/scala-cli" 1>&2 +./mill -i copyTo --task 'cli[]'.nativeImageStatic --dest "$WORKDIR/scala-cli" 1>&2 cd "$WORKDIR" docker build -t scala-cli -f "$ROOT/.github/scripts/docker/ScalaCliDockerFile" . diff --git a/.github/scripts/generate-os-packages.sh b/.github/scripts/generate-os-packages.sh index 1b2181bc22..0ef125bce6 100755 --- a/.github/scripts/generate-os-packages.sh +++ b/.github/scripts/generate-os-packages.sh @@ -34,12 +34,12 @@ launcher() { launcherName="scala" fi - "$mill" -i copyTo "$launcherMillCommand" "$launcherName" 1>&2 + "$mill" -i copyTo --task "$launcherMillCommand" --dest "$launcherName" 1>&2 echo "$launcherName" } version() { - "$mill" -i writePackageVersionTo scala-cli-version 1>&2 + "$mill" -i writePackageVersionTo --dest scala-cli-version 1>&2 cat scala-cli-version } diff --git a/.github/scripts/generate-slim-docker-image.sh b/.github/scripts/generate-slim-docker-image.sh index a648683fd4..1b818d0cac 100755 --- a/.github/scripts/generate-slim-docker-image.sh +++ b/.github/scripts/generate-slim-docker-image.sh @@ -5,7 +5,7 @@ ROOT="$(cd "$(dirname "$0")/../.." && pwd)" WORKDIR="$ROOT/out/docker-slim-workdir" mkdir -p "$WORKDIR" -./mill -i copyTo 'cli[]'.nativeImageMostlyStatic "$WORKDIR/scala-cli" 1>&2 +./mill -i copyTo --task 'cli[]'.nativeImageMostlyStatic --dest "$WORKDIR/scala-cli" 1>&2 cd "$WORKDIR" docker build -t scala-cli-slim -f "$ROOT/.github/scripts/docker/ScalaCliSlimDockerFile" . diff --git a/.github/scripts/publish-sdkman.sh b/.github/scripts/publish-sdkman.sh index 10e0985f9d..347aa4261e 100755 --- a/.github/scripts/publish-sdkman.sh +++ b/.github/scripts/publish-sdkman.sh @@ -10,7 +10,7 @@ set -eu version() { - "./mill" -i writePackageVersionTo scala-cli-version 1>&2 + "./mill" -i writePackageVersionTo --dest scala-cli-version 1>&2 cat scala-cli-version } From 92e2df3f12284cbb457f4cc04adb3408ba28e4d9 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Mon, 28 Oct 2024 14:39:26 +0100 Subject: [PATCH 17/30] Avoid positional arguments --- .github/scripts/generate-native-image.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/generate-native-image.sh b/.github/scripts/generate-native-image.sh index d9fa34ade7..16a2d8f865 100755 --- a/.github/scripts/generate-native-image.sh +++ b/.github/scripts/generate-native-image.sh @@ -15,7 +15,7 @@ if [[ "$OSTYPE" == "msys" ]]; then export GRAALVM_HOME="$JAVA_HOME" export PATH="$(pwd)/bin:$PATH" echo "PATH=$PATH" - ./mill.bat -i "$COMMAND" generate-native-image.bat "" + ./mill.bat -i "$COMMAND" --scriptDest generate-native-image.bat --imageDest "" ./generate-native-image.bat else if [ $# == "0" ]; then From b6fa7a4dee7d57eeddbfec6649794a9fa3627017 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Mon, 28 Oct 2024 14:58:01 +0100 Subject: [PATCH 18/30] Avoid positional arguments --- .github/scripts/generate-os-packages.sh | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/generate-os-packages.sh b/.github/scripts/generate-os-packages.sh index 0ef125bce6..f35b2da1f3 100755 --- a/.github/scripts/generate-os-packages.sh +++ b/.github/scripts/generate-os-packages.sh @@ -89,7 +89,7 @@ generate_msi() { # Having the MSI automatically install Visual C++ redistributable when needed, # see https://wixtoolset.org/documentation/manual/v3/howtos/redistributables_and_install_checks/install_vcredist.html - "$mill" -i ci.writeWixConfigExtra wix-visual-cpp-redist.xml + "$mill" -i ci.writeWixConfigExtra --dest wix-visual-cpp-redist.xml packager \ --msi \ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c0963d046..e64956aac5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1050,7 +1050,7 @@ jobs: run: .github/scripts/generate-native-image.sh mostly-static shell: bash - name: Copy artifacts - run: ./mill -i copyMostlyStaticLauncher artifacts/ + run: ./mill -i copyMostlyStaticLauncher --directory artifacts/ - uses: actions/upload-artifact@v3 with: name: mostly-static-launchers From 4e466c9de8c7956727304a2632e3aac5b6e80643 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Mon, 28 Oct 2024 15:02:41 +0100 Subject: [PATCH 19/30] Run Scalafmt --- build.mill.scala | 4 +++- project/settings/package.mill.scala | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/build.mill.scala b/build.mill.scala index c424a28f45..e22c901015 100644 --- a/build.mill.scala +++ b/build.mill.scala @@ -1944,7 +1944,9 @@ object ci extends Module { } def checkScalaVersions() = T.command { - website.checkMainScalaVersions(T.workspace / "website" / "docs" / "reference" / "scala-versions.md") + website.checkMainScalaVersions( + T.workspace / "website" / "docs" / "reference" / "scala-versions.md" + ) website.checkScalaJsVersions( T.workspace / "website" / "docs" / "guides" / "advanced" / "scala-js.md" ) diff --git a/project/settings/package.mill.scala b/project/settings/package.mill.scala index 894c337fea..6cfe430b39 100644 --- a/project/settings/package.mill.scala +++ b/project/settings/package.mill.scala @@ -4,7 +4,8 @@ import $ivy.`com.goyeau::mill-scalafix::0.3.1` import $ivy.`io.github.alexarchambault.mill::mill-native-image::0.1.28` import $ivy.`io.get-coursier::coursier-launcher:2.1.14` -import $file.project.deps, deps.{Deps, Docker, alpineVersion, buildCsVersion, buildCsM1Version, libsodiumVersion} +import $file.project.deps, + deps.{Deps, Docker, alpineVersion, buildCsVersion, buildCsM1Version, libsodiumVersion} import $file.project.utils, utils.isArmArchitecture import com.goyeau.mill.scalafix.ScalafixModule From 681fe6cf2add8aea690b2af8ef4b6dd564a64690 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Mon, 28 Oct 2024 15:16:36 +0100 Subject: [PATCH 20/30] . --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e64956aac5..ae4db8df42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1253,7 +1253,7 @@ jobs: run: .github/scripts/generate-native-image.sh static shell: bash - name: Copy artifacts - run: ./mill -i copyStaticLauncher artifacts/ + run: ./mill -i copyStaticLauncher --directory artifacts/ - uses: actions/upload-artifact@v3 with: name: static-launchers From 251c03e9b798efdcf08244d6c57d021c01023afe Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Tue, 29 Oct 2024 09:54:49 +0100 Subject: [PATCH 21/30] Update Mill to 0.12.1 --- .mill-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mill-version b/.mill-version index ac454c6a1f..34a83616bb 100644 --- a/.mill-version +++ b/.mill-version @@ -1 +1 @@ -0.12.0 +0.12.1 From 690240faf282bc7e2905f660a2e828cc2c687485 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Tue, 29 Oct 2024 10:15:28 +0100 Subject: [PATCH 22/30] . --- .github/scripts/generate-os-packages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/generate-os-packages.sh b/.github/scripts/generate-os-packages.sh index f35b2da1f3..74fbb43909 100755 --- a/.github/scripts/generate-os-packages.sh +++ b/.github/scripts/generate-os-packages.sh @@ -44,7 +44,7 @@ version() { } shortVersion() { - "$mill" -i writeShortPackageVersionTo scala-cli-short-version 1>&2 + "$mill" -i writeShortPackageVersionTo --dest scala-cli-short-version 1>&2 cat scala-cli-short-version } From da08eeb76b38b141231727228fe8c31a64620126 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Tue, 29 Oct 2024 11:13:57 +0100 Subject: [PATCH 23/30] Pass T.workspace to Upload.copyLauncher --- build.mill.scala | 11 +++++++---- project/settings/package.mill.scala | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build.mill.scala b/build.mill.scala index e22c901015..0ae8139a10 100644 --- a/build.mill.scala +++ b/build.mill.scala @@ -4,7 +4,7 @@ import $packages._ import $ivy.`com.lihaoyi::mill-contrib-bloop:$MILL_VERSION` import $ivy.`io.get-coursier::coursier-launcher:2.1.13` -import $ivy.`io.github.alexarchambault.mill::mill-native-image-upload:0.1.28` +import $ivy.`io.github.alexarchambault.mill::mill-native-image-upload:0.1.29` import $file.project.deps, deps.{Deps, Docker, InternalDeps, Java, Scala, TestDeps} import build.project.publish, publish.{ghOrg, ghName, ScalaCliPublishModule, organization} import build.project.settings @@ -1345,7 +1345,8 @@ def copyLauncher(directory: String = "artifacts") = T.command { nativeLauncher, directory, "scala-cli", - compress = true + compress = true, + wd = T.workspace ) } @@ -1422,7 +1423,8 @@ def copyMostlyStaticLauncher(directory: String = "artifacts") = T.command { directory, "scala-cli", compress = true, - suffix = "-mostly-static" + suffix = "-mostly-static", + wd = T.workspace ) } @@ -1433,7 +1435,8 @@ def copyStaticLauncher(directory: String = "artifacts") = T.command { directory, "scala-cli", compress = true, - suffix = "-static" + suffix = "-static", + wd = T.workspace ) } private def ghToken(): String = Option(System.getenv("UPLOAD_GH_TOKEN")).getOrElse { diff --git a/project/settings/package.mill.scala b/project/settings/package.mill.scala index 6cfe430b39..f8bfcfef27 100644 --- a/project/settings/package.mill.scala +++ b/project/settings/package.mill.scala @@ -1,7 +1,7 @@ package build.project.settings import $ivy.`com.goyeau::mill-scalafix::0.3.1` -import $ivy.`io.github.alexarchambault.mill::mill-native-image::0.1.28` +import $ivy.`io.github.alexarchambault.mill::mill-native-image::0.1.29` import $ivy.`io.get-coursier::coursier-launcher:2.1.14` import $file.project.deps, From d6de2391f66b554d6399516eca999cacac39fc89 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Tue, 29 Oct 2024 11:22:37 +0100 Subject: [PATCH 24/30] . --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae4db8df42..fc8c861bda 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -822,7 +822,7 @@ jobs: run: .github/scripts/generate-os-packages.sh shell: bash - name: Copy artifacts - run: ./mill -i copyDefaultLauncher artifacts/ + run: ./mill -i copyDefaultLauncher --directory artifacts/ - uses: actions/upload-artifact@v3 with: name: windows-launchers From 38f71c55ac2d4700aa55143377b8109b42220b54 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Tue, 29 Oct 2024 11:23:00 +0100 Subject: [PATCH 25/30] . --- .github/scripts/build-linux-aarch64-from-docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/build-linux-aarch64-from-docker.sh b/.github/scripts/build-linux-aarch64-from-docker.sh index ad33bd5390..9c8c75b483 100755 --- a/.github/scripts/build-linux-aarch64-from-docker.sh +++ b/.github/scripts/build-linux-aarch64-from-docker.sh @@ -12,7 +12,7 @@ eval "$(cs java --env --jvm temurin:17 --jvm-index https://github.com/coursier/j git config --global --add safe.directory "$(pwd)" ./mill -i show 'cli[]'.nativeImage -./mill -i copyDefaultLauncher ./artifacts +./mill -i copyDefaultLauncher --directory ./artifacts if "true" == $(./mill -i ci.shouldPublish); then .github/scripts/generate-os-packages.sh fi From 382b5dd4d57ee6e50396d5695f6acbbf352c28b9 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Tue, 29 Oct 2024 11:24:46 +0100 Subject: [PATCH 26/30] Update mill-scalafix to 0.4.2 --- project/settings/package.mill.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/settings/package.mill.scala b/project/settings/package.mill.scala index f8bfcfef27..7463695d8d 100644 --- a/project/settings/package.mill.scala +++ b/project/settings/package.mill.scala @@ -1,6 +1,6 @@ package build.project.settings -import $ivy.`com.goyeau::mill-scalafix::0.3.1` +import $ivy.`com.goyeau::mill-scalafix::0.4.2` import $ivy.`io.github.alexarchambault.mill::mill-native-image::0.1.29` import $ivy.`io.get-coursier::coursier-launcher:2.1.14` From e7b1b5dd69f4bd5e260aee4bc0b1f87de1463bdd Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Tue, 29 Oct 2024 13:03:28 +0100 Subject: [PATCH 27/30] Update Scalafix and run it only on one version of Scala per module --- .scalafix.conf | 1 + .scalafix3.conf | 1 + build.mill.scala | 7 ------ project/settings/package.mill.scala | 37 ++++++++++++++++++++++++++--- 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/.scalafix.conf b/.scalafix.conf index 8c4c426699..9f7d64a06a 100644 --- a/.scalafix.conf +++ b/.scalafix.conf @@ -19,4 +19,5 @@ OrganizeImports { expandRelative = true groups = ["*", "re:javax?\\.", "scala."] groupedImports = AggressiveMerge + targetDialect = Scala3 } diff --git a/.scalafix3.conf b/.scalafix3.conf index e5a920e622..63c037bbdf 100644 --- a/.scalafix3.conf +++ b/.scalafix3.conf @@ -21,4 +21,5 @@ OrganizeImports { groups = ["*", "re:javax?\\.", "scala."] groupedImports = AggressiveMerge removeUnused = false # added for Scala 3 + targetDialect = Scala3 } diff --git a/build.mill.scala b/build.mill.scala index 0ae8139a10..23121a021e 100644 --- a/build.mill.scala +++ b/build.mill.scala @@ -623,13 +623,6 @@ trait Config extends ScalaCliCrossSbtModule def scalacOptions = T { super.scalacOptions() ++ Seq("-release", "8") } - - // Disabling Scalafix in 2.13 and 3, so that it doesn't remove - // some compatibility-related imports, that are actually only used - // in Scala 2.12. - def fix(args: String*) = - if (crossScalaVersion.startsWith("2.12.")) super.fix(args: _*) - else T.command(()) } trait Options extends ScalaCliCrossSbtModule with ScalaCliPublishModule with HasTests diff --git a/project/settings/package.mill.scala b/project/settings/package.mill.scala index 7463695d8d..559dbae63a 100644 --- a/project/settings/package.mill.scala +++ b/project/settings/package.mill.scala @@ -5,7 +5,7 @@ import $ivy.`io.github.alexarchambault.mill::mill-native-image::0.1.29` import $ivy.`io.get-coursier::coursier-launcher:2.1.14` import $file.project.deps, - deps.{Deps, Docker, alpineVersion, buildCsVersion, buildCsM1Version, libsodiumVersion} + deps.{Deps, Docker, alpineVersion, buildCsVersion, buildCsM1Version, libsodiumVersion, Scala} import $file.project.utils, utils.isArmArchitecture import com.goyeau.mill.scalafix.ScalafixModule @@ -785,8 +785,39 @@ trait ScalaCliScalafixModule extends ScalafixModule { override def semanticDbVersion = Deps.Versions.scalaMeta def scalafixConfig = T { - if (scalaVersion().startsWith("2.")) super.scalafixConfig() - else Some(T.workspace / ".scalafix3.conf") + if (scalaVersion().startsWith("2.12.")) { + val newConfigPath = T.dest / ".scalafix.conf" + val newConfigContent = + os.read(T.workspace / ".scalafix.conf").replace( + "targetDialect = Scala3", + "# targetDialect = Scala3" + ) + os.write(newConfigPath, newConfigContent) + Some(newConfigPath) + } + else if (scalaVersion().startsWith("3.")) Some(T.workspace / ".scalafix3.conf") + else super.scalafixConfig() + } + + // Run Scalafix only on the main Scala version of the module + // If the module has Scala 2. + override def fix(args: String*) = { + val allScalaVersions = this.millOuterCtx.crossValues.map(_.toString) + + val mainScalaVersion = + if (allScalaVersions.contains(Scala.scala212)) Some(Scala.scala212) + else if (allScalaVersions.contains(Scala.scala213)) Some(Scala.scala213) + else if (allScalaVersions.contains(Scala.scala3Lts)) Some(Scala.scala3Lts) + else None + + this match { + case m: CrossModuleBase if mainScalaVersion.contains(m.crossScalaVersion) => + super.fix(args: _*) + case m: CrossModuleBase => + T.command(()) + case _ => + super.fix(args: _*) + } } def scalacPluginIvyDeps = super.scalacPluginIvyDeps() ++ { if (scalaVersion().startsWith("2.")) Seq(Deps.semanticDbScalac) From abb34dcd551b4cbf7f213bacfbf51d0f5038eb7b Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Tue, 29 Oct 2024 13:07:13 +0100 Subject: [PATCH 28/30] Run Scalafix on all code using new config We use Scala3 dialect on all code with Scala 2.13+ --- modules/build/src/main/scala/scala/build/Bloop.scala | 4 ++-- modules/build/src/main/scala/scala/build/Build.scala | 6 +++--- modules/build/src/main/scala/scala/build/CrossSources.scala | 2 +- modules/build/src/main/scala/scala/build/Project.scala | 6 +++--- .../build/src/main/scala/scala/build/ReplArtifacts.scala | 4 ++-- .../build/src/main/scala/scala/build/bsp/BspClient.scala | 2 +- modules/build/src/main/scala/scala/build/bsp/BspImpl.scala | 2 +- .../build/src/main/scala/scala/build/bsp/BspServer.scala | 4 ++-- .../scala/scala/build/bsp/BuildClientForwardStubs.scala | 2 +- .../scala/scala/build/bsp/BuildServerForwardStubs.scala | 2 +- .../src/main/scala/scala/build/bsp/BuildServerProxy.scala | 2 +- .../main/scala/scala/build/bsp/HasGeneratedSources.scala | 2 +- .../scala/scala/build/bsp/HasGeneratedSourcesImpl.scala | 2 +- .../scala/scala/build/bsp/JavaBuildServerForwardStubs.scala | 2 +- .../src/main/scala/scala/build/bsp/LoggingBuildClient.scala | 2 +- .../src/main/scala/scala/build/bsp/LoggingBuildServer.scala | 2 +- .../main/scala/scala/build/bsp/LoggingBuildServerAll.scala | 2 +- .../main/scala/scala/build/bsp/LoggingJavaBuildServer.scala | 2 +- .../scala/scala/build/bsp/LoggingScalaBuildServer.scala | 2 +- .../scala/build/bsp/ScalaBuildServerForwardStubs.scala | 2 +- modules/build/src/main/scala/scala/build/bsp/package.scala | 2 +- .../scala/scala/build/internal/JavaParserProxyBinary.scala | 2 +- .../build/src/main/scala/scala/build/internal/Runner.scala | 2 +- .../scala/build/postprocessing/SemanticdbProcessor.scala | 2 +- .../build/preprocessing/CustomDirectivesReporter.scala | 2 +- .../scala/build/preprocessing/DirectivesPreprocessor.scala | 2 +- .../scala/build/preprocessing/ExtractedDirectives.scala | 2 +- .../scala/cli/commands/CustomWindowsEnvVarUpdater.scala | 2 +- .../src/main/scala/scala/cli/commands/bloop/BloopJson.scala | 4 ++-- .../main/scala/scala/cli/commands/bloop/BloopOptions.scala | 2 +- .../scala/scala/cli/commands/bloop/BloopStartOptions.scala | 2 +- modules/cli/src/main/scala/scala/cli/commands/bsp/Bsp.scala | 2 +- .../main/scala/scala/cli/commands/clean/CleanOptions.scala | 2 +- .../scala/scala/cli/commands/compile/CompileOptions.scala | 2 +- .../src/main/scala/scala/cli/commands/config/Config.scala | 2 +- modules/cli/src/main/scala/scala/cli/commands/doc/Doc.scala | 2 +- .../src/main/scala/scala/cli/commands/export0/Export.scala | 2 +- .../main/scala/scala/cli/commands/github/GitHubApi.scala | 4 ++-- .../main/scala/scala/cli/commands/package0/Package.scala | 2 +- .../src/main/scala/scala/cli/commands/packaging/Spark.scala | 2 +- .../src/main/scala/scala/cli/commands/pgp/KeyServer.scala | 2 +- .../src/main/scala/scala/cli/commands/pgp/PgpCreate.scala | 2 +- .../src/main/scala/scala/cli/commands/pgp/PgpKeyId.scala | 2 +- .../main/scala/scala/cli/commands/pgp/PgpPushOptions.scala | 2 +- .../cli/src/main/scala/scala/cli/commands/pgp/PgpSign.scala | 2 +- .../src/main/scala/scala/cli/commands/pgp/PgpVerify.scala | 2 +- .../src/main/scala/scala/cli/commands/publish/GitRepo.scala | 2 +- .../main/scala/scala/cli/commands/publish/OptionCheck.scala | 2 +- .../scala/scala/cli/commands/publish/OptionChecks.scala | 4 ++-- .../src/main/scala/scala/cli/commands/publish/Publish.scala | 4 ++-- .../cli/commands/publish/checks/ComputeVersionCheck.scala | 2 +- .../scala/cli/commands/publish/checks/DeveloperCheck.scala | 4 ++-- .../scala/cli/commands/publish/checks/LicenseCheck.scala | 2 +- .../scala/scala/cli/commands/publish/checks/NameCheck.scala | 2 +- .../cli/commands/publish/checks/OrganizationCheck.scala | 2 +- .../scala/cli/commands/publish/checks/PasswordCheck.scala | 4 ++-- .../cli/commands/publish/checks/PgpSecretKeyCheck.scala | 2 +- .../scala/scala/cli/commands/publish/checks/ScmCheck.scala | 2 +- .../scala/scala/cli/commands/publish/checks/UrlCheck.scala | 2 +- .../scala/scala/cli/commands/publish/checks/UserCheck.scala | 4 ++-- .../cli/src/main/scala/scala/cli/commands/repl/Repl.scala | 2 +- modules/cli/src/main/scala/scala/cli/commands/run/Run.scala | 2 +- .../scala/scala/cli/commands/run/SharedRunOptions.scala | 2 +- .../main/scala/scala/cli/commands/setupide/SetupIde.scala | 2 +- .../scala/scala/cli/commands/shared/SharedOptions.scala | 4 ++-- .../cli/src/main/scala/scala/cli/commands/test/Test.scala | 2 +- .../main/scala/scala/cli/commands/test/TestOptions.scala | 2 +- .../src/main/scala/scala/cli/commands/util/RunHadoop.scala | 2 +- .../src/main/scala/scala/cli/exportCmd/MillProject.scala | 2 +- .../cli/src/main/scala/scala/cli/internal/CliLogger.scala | 4 ++-- .../src/main/scala/scala/cli/internal/ScalaJsLinker.scala | 4 ++-- .../main/scala/scala/cli/javaLauncher/JavaLauncherCli.scala | 2 +- .../cli/src/main/scala/scala/cli/packaging/Library.scala | 2 +- .../scala/scala/cli/util/ConfigPasswordOptionHelpers.scala | 2 +- .../test/scala/cli/commands/tests/ReplOptionsTests.scala | 2 +- .../src/test/scala/cli/commands/tests/RunOptionsTests.scala | 2 +- .../cli/src/test/scala/cli/tests/CachedBinaryTests.scala | 2 +- modules/core/src/main/scala/scala/build/Logger.scala | 4 ++-- .../build/internals/CustomProgressBarRefreshDisplay.scala | 2 +- .../scala/scala/build/internals/StableScalaVersion.scala | 4 ++-- .../build/preprocessing/directives/ComputeVersion.scala | 2 +- .../build/preprocessing/directives/DirectiveHandler.scala | 2 +- .../scala/build/preprocessing/directives/Packaging.scala | 2 +- .../build/preprocessing/directives/PublishContextual.scala | 2 +- .../scala/build/preprocessing/directives/Toolkit.scala | 2 +- .../scala/scala/cli/integration/BspTestDefinitions.scala | 2 +- .../scala/scala/cli/integration/DocTestDefinitions.scala | 4 ++-- .../test/scala/scala/cli/integration/SparkTests212.scala | 2 +- .../test/scala/scala/cli/integration/TestBspClient.scala | 2 +- modules/options/src/main/scala/scala/build/Artifacts.scala | 2 +- .../options/src/main/scala/scala/build/CoursierUtils.scala | 2 +- .../scala/scala/build/actionable/ActionableDiagnostic.scala | 2 +- .../scala/build/actionable/ActionablePreprocessor.scala | 2 +- .../main/scala/scala/build/options/ClassPathOptions.scala | 2 +- .../src/main/scala/scala/build/options/JavaOptions.scala | 2 +- .../src/main/scala/scala/build/options/PackageOptions.scala | 2 +- .../src/main/scala/scala/build/options/ScalaJsOptions.scala | 4 ++-- .../main/scala/scala/build/options/ScalaNativeOptions.scala | 6 +++--- .../src/main/scala/scala/cli/graal/BytecodeProcessor.scala | 4 ++-- 99 files changed, 123 insertions(+), 123 deletions(-) diff --git a/modules/build/src/main/scala/scala/build/Bloop.scala b/modules/build/src/main/scala/scala/build/Bloop.scala index 50f109ebd5..8e7cf1def4 100644 --- a/modules/build/src/main/scala/scala/build/Bloop.scala +++ b/modules/build/src/main/scala/scala/build/Bloop.scala @@ -12,9 +12,9 @@ import java.io.{File, IOException} import scala.annotation.tailrec import scala.build.EitherCps.{either, value} import scala.build.errors.{BuildException, ModuleFormatError} -import scala.build.internal.CsLoggerUtil._ +import scala.build.internal.CsLoggerUtil.* import scala.concurrent.duration.FiniteDuration -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* object Bloop { diff --git a/modules/build/src/main/scala/scala/build/Build.scala b/modules/build/src/main/scala/scala/build/Build.scala index d22552c71c..c2bbcf8579 100644 --- a/modules/build/src/main/scala/scala/build/Build.scala +++ b/modules/build/src/main/scala/scala/build/Build.scala @@ -14,15 +14,15 @@ import scala.build.EitherCps.{either, value} import scala.build.Ops.* import scala.build.compiler.{ScalaCompiler, ScalaCompilerMaker} import scala.build.errors.* -import scala.build.input.VirtualScript.VirtualScriptNameRegex import scala.build.input.* +import scala.build.input.VirtualScript.VirtualScriptNameRegex import scala.build.internal.resource.ResourceMapper import scala.build.internal.{Constants, MainClass, Name, Util} -import scala.build.options.ScalaVersionUtil.asVersion import scala.build.options.* +import scala.build.options.ScalaVersionUtil.asVersion import scala.build.options.validation.ValidationException -import scala.build.postprocessing.LineConversion.scalaLineToScLineShift import scala.build.postprocessing.* +import scala.build.postprocessing.LineConversion.scalaLineToScLineShift import scala.collection.mutable.ListBuffer import scala.concurrent.duration.DurationInt import scala.util.control.NonFatal diff --git a/modules/build/src/main/scala/scala/build/CrossSources.scala b/modules/build/src/main/scala/scala/build/CrossSources.scala index c7e731752a..d41a239047 100644 --- a/modules/build/src/main/scala/scala/build/CrossSources.scala +++ b/modules/build/src/main/scala/scala/build/CrossSources.scala @@ -13,8 +13,8 @@ import scala.build.errors.{ MalformedDirectiveError, Severity } -import scala.build.input.ElementsUtils.* import scala.build.input.* +import scala.build.input.ElementsUtils.* import scala.build.internal.Constants import scala.build.internal.util.{RegexUtils, WarningMessages} import scala.build.options.{ diff --git a/modules/build/src/main/scala/scala/build/Project.scala b/modules/build/src/main/scala/scala/build/Project.scala index f6d793be82..c35a1e9cef 100644 --- a/modules/build/src/main/scala/scala/build/Project.scala +++ b/modules/build/src/main/scala/scala/build/Project.scala @@ -1,8 +1,8 @@ package scala.build -import _root_.bloop.config.{Config => BloopConfig, ConfigCodecs => BloopCodecs} -import _root_.coursier.{Dependency => CsDependency, core => csCore, util => csUtil} -import com.github.plokhotnyuk.jsoniter_scala.core.{writeToArray => writeAsJsonToArray} +import _root_.bloop.config.{Config as BloopConfig, ConfigCodecs as BloopCodecs} +import _root_.coursier.{Dependency as CsDependency, core as csCore, util as csUtil} +import com.github.plokhotnyuk.jsoniter_scala.core.writeToArray as writeAsJsonToArray import coursier.core.Classifier import java.io.ByteArrayOutputStream diff --git a/modules/build/src/main/scala/scala/build/ReplArtifacts.scala b/modules/build/src/main/scala/scala/build/ReplArtifacts.scala index 8077dab118..e89f69453d 100644 --- a/modules/build/src/main/scala/scala/build/ReplArtifacts.scala +++ b/modules/build/src/main/scala/scala/build/ReplArtifacts.scala @@ -3,11 +3,11 @@ package scala.build import coursier.cache.FileCache import coursier.core.{Repository, Version} import coursier.util.Task -import dependency._ +import dependency.* import scala.build.EitherCps.{either, value} import scala.build.errors.BuildException -import scala.build.internal.CsLoggerUtil._ +import scala.build.internal.CsLoggerUtil.* final case class ReplArtifacts( replArtifacts: Seq[(String, os.Path)], diff --git a/modules/build/src/main/scala/scala/build/bsp/BspClient.scala b/modules/build/src/main/scala/scala/build/bsp/BspClient.scala index fa6499053f..2b80ba79e9 100644 --- a/modules/build/src/main/scala/scala/build/bsp/BspClient.scala +++ b/modules/build/src/main/scala/scala/build/bsp/BspClient.scala @@ -1,7 +1,7 @@ package scala.build.bsp -import ch.epfl.scala.bsp4j.{ScalaAction, ScalaDiagnostic, ScalaTextEdit, ScalaWorkspaceEdit} import ch.epfl.scala.bsp4j as b +import ch.epfl.scala.bsp4j.{ScalaAction, ScalaDiagnostic, ScalaTextEdit, ScalaWorkspaceEdit} import com.google.gson.{Gson, JsonElement} import java.lang.Boolean as JBoolean diff --git a/modules/build/src/main/scala/scala/build/bsp/BspImpl.scala b/modules/build/src/main/scala/scala/build/bsp/BspImpl.scala index 9313ea8990..20399a33d1 100644 --- a/modules/build/src/main/scala/scala/build/bsp/BspImpl.scala +++ b/modules/build/src/main/scala/scala/build/bsp/BspImpl.scala @@ -11,8 +11,8 @@ import java.io.{InputStream, OutputStream} import java.util.UUID import java.util.concurrent.{CompletableFuture, Executor} -import scala.build.EitherCps.{either, value} import scala.build.* +import scala.build.EitherCps.{either, value} import scala.build.compiler.BloopCompiler import scala.build.errors.{ BuildException, diff --git a/modules/build/src/main/scala/scala/build/bsp/BspServer.scala b/modules/build/src/main/scala/scala/build/bsp/BspServer.scala index 95c85c0d11..a5c6c797f4 100644 --- a/modules/build/src/main/scala/scala/build/bsp/BspServer.scala +++ b/modules/build/src/main/scala/scala/build/bsp/BspServer.scala @@ -1,12 +1,12 @@ package scala.build.bsp -import ch.epfl.scala.bsp4j.{BuildClient, LogMessageParams, MessageType} import ch.epfl.scala.bsp4j as b +import ch.epfl.scala.bsp4j.{BuildClient, LogMessageParams, MessageType} import java.io.{File, PrintWriter, StringWriter} import java.net.URI -import java.util.concurrent.{CompletableFuture, TimeUnit} import java.util as ju +import java.util.concurrent.{CompletableFuture, TimeUnit} import scala.build.Logger import scala.build.internal.Constants diff --git a/modules/build/src/main/scala/scala/build/bsp/BuildClientForwardStubs.scala b/modules/build/src/main/scala/scala/build/bsp/BuildClientForwardStubs.scala index 3c586f717a..6ab18b56a0 100644 --- a/modules/build/src/main/scala/scala/build/bsp/BuildClientForwardStubs.scala +++ b/modules/build/src/main/scala/scala/build/bsp/BuildClientForwardStubs.scala @@ -1,6 +1,6 @@ package scala.build.bsp -import ch.epfl.scala.{bsp4j => b} +import ch.epfl.scala.bsp4j as b trait BuildClientForwardStubs extends b.BuildClient { protected def forwardToOpt: Option[b.BuildClient] diff --git a/modules/build/src/main/scala/scala/build/bsp/BuildServerForwardStubs.scala b/modules/build/src/main/scala/scala/build/bsp/BuildServerForwardStubs.scala index 97c170f4d1..2a01bdc0e1 100644 --- a/modules/build/src/main/scala/scala/build/bsp/BuildServerForwardStubs.scala +++ b/modules/build/src/main/scala/scala/build/bsp/BuildServerForwardStubs.scala @@ -1,7 +1,7 @@ package scala.build.bsp +import ch.epfl.scala.bsp4j as b import ch.epfl.scala.bsp4j.{DependencyModulesParams, DependencyModulesResult} -import ch.epfl.scala.{bsp4j => b} import java.util.concurrent.CompletableFuture import java.util.function.BiFunction diff --git a/modules/build/src/main/scala/scala/build/bsp/BuildServerProxy.scala b/modules/build/src/main/scala/scala/build/bsp/BuildServerProxy.scala index 2cd444aec2..0ecfca3456 100644 --- a/modules/build/src/main/scala/scala/build/bsp/BuildServerProxy.scala +++ b/modules/build/src/main/scala/scala/build/bsp/BuildServerProxy.scala @@ -1,6 +1,6 @@ package scala.build.bsp -import ch.epfl.scala.{bsp4j => b} +import ch.epfl.scala.bsp4j as b import java.util.concurrent.CompletableFuture diff --git a/modules/build/src/main/scala/scala/build/bsp/HasGeneratedSources.scala b/modules/build/src/main/scala/scala/build/bsp/HasGeneratedSources.scala index 74cf3ce0f3..680ea12efb 100644 --- a/modules/build/src/main/scala/scala/build/bsp/HasGeneratedSources.scala +++ b/modules/build/src/main/scala/scala/build/bsp/HasGeneratedSources.scala @@ -1,6 +1,6 @@ package scala.build.bsp -import ch.epfl.scala.{bsp4j => b} +import ch.epfl.scala.bsp4j as b import scala.build.GeneratedSource import scala.build.input.Inputs diff --git a/modules/build/src/main/scala/scala/build/bsp/HasGeneratedSourcesImpl.scala b/modules/build/src/main/scala/scala/build/bsp/HasGeneratedSourcesImpl.scala index 4855cbf824..b5c511902f 100644 --- a/modules/build/src/main/scala/scala/build/bsp/HasGeneratedSourcesImpl.scala +++ b/modules/build/src/main/scala/scala/build/bsp/HasGeneratedSourcesImpl.scala @@ -1,6 +1,6 @@ package scala.build.bsp -import ch.epfl.scala.{bsp4j => b} +import ch.epfl.scala.bsp4j as b import scala.build.GeneratedSource import scala.build.input.Inputs diff --git a/modules/build/src/main/scala/scala/build/bsp/JavaBuildServerForwardStubs.scala b/modules/build/src/main/scala/scala/build/bsp/JavaBuildServerForwardStubs.scala index e25bbd9d1d..b99e9c94c8 100644 --- a/modules/build/src/main/scala/scala/build/bsp/JavaBuildServerForwardStubs.scala +++ b/modules/build/src/main/scala/scala/build/bsp/JavaBuildServerForwardStubs.scala @@ -1,7 +1,7 @@ package scala.build.bsp +import ch.epfl.scala.bsp4j as b import ch.epfl.scala.bsp4j.{JavacOptionsParams, JavacOptionsResult} -import ch.epfl.scala.{bsp4j => b} import java.util.concurrent.CompletableFuture diff --git a/modules/build/src/main/scala/scala/build/bsp/LoggingBuildClient.scala b/modules/build/src/main/scala/scala/build/bsp/LoggingBuildClient.scala index 1fa1d9fd8d..e6f33fab89 100644 --- a/modules/build/src/main/scala/scala/build/bsp/LoggingBuildClient.scala +++ b/modules/build/src/main/scala/scala/build/bsp/LoggingBuildClient.scala @@ -1,6 +1,6 @@ package scala.build.bsp -import ch.epfl.scala.{bsp4j => b} +import ch.epfl.scala.bsp4j as b trait LoggingBuildClient extends b.BuildClient { protected def underlying: b.BuildClient diff --git a/modules/build/src/main/scala/scala/build/bsp/LoggingBuildServer.scala b/modules/build/src/main/scala/scala/build/bsp/LoggingBuildServer.scala index f05968fc51..ba6103baf0 100644 --- a/modules/build/src/main/scala/scala/build/bsp/LoggingBuildServer.scala +++ b/modules/build/src/main/scala/scala/build/bsp/LoggingBuildServer.scala @@ -1,7 +1,7 @@ package scala.build.bsp +import ch.epfl.scala.bsp4j as b import ch.epfl.scala.bsp4j.{DependencyModulesParams, DependencyModulesResult} -import ch.epfl.scala.{bsp4j => b} import java.util.concurrent.CompletableFuture diff --git a/modules/build/src/main/scala/scala/build/bsp/LoggingBuildServerAll.scala b/modules/build/src/main/scala/scala/build/bsp/LoggingBuildServerAll.scala index f0d5985f33..b21a2b5248 100644 --- a/modules/build/src/main/scala/scala/build/bsp/LoggingBuildServerAll.scala +++ b/modules/build/src/main/scala/scala/build/bsp/LoggingBuildServerAll.scala @@ -1,6 +1,6 @@ package scala.build.bsp -import ch.epfl.scala.{bsp4j => b} +import ch.epfl.scala.bsp4j as b import java.util.concurrent.CompletableFuture diff --git a/modules/build/src/main/scala/scala/build/bsp/LoggingJavaBuildServer.scala b/modules/build/src/main/scala/scala/build/bsp/LoggingJavaBuildServer.scala index 658818cc3a..0fcd6e4254 100644 --- a/modules/build/src/main/scala/scala/build/bsp/LoggingJavaBuildServer.scala +++ b/modules/build/src/main/scala/scala/build/bsp/LoggingJavaBuildServer.scala @@ -1,6 +1,6 @@ package scala.build.bsp -import ch.epfl.scala.{bsp4j => b} +import ch.epfl.scala.bsp4j as b import java.util.concurrent.CompletableFuture diff --git a/modules/build/src/main/scala/scala/build/bsp/LoggingScalaBuildServer.scala b/modules/build/src/main/scala/scala/build/bsp/LoggingScalaBuildServer.scala index d118f08984..52dc6898df 100644 --- a/modules/build/src/main/scala/scala/build/bsp/LoggingScalaBuildServer.scala +++ b/modules/build/src/main/scala/scala/build/bsp/LoggingScalaBuildServer.scala @@ -1,6 +1,6 @@ package scala.build.bsp -import ch.epfl.scala.{bsp4j => b} +import ch.epfl.scala.bsp4j as b import java.util.concurrent.CompletableFuture diff --git a/modules/build/src/main/scala/scala/build/bsp/ScalaBuildServerForwardStubs.scala b/modules/build/src/main/scala/scala/build/bsp/ScalaBuildServerForwardStubs.scala index 12cb1c3265..219483fb9e 100644 --- a/modules/build/src/main/scala/scala/build/bsp/ScalaBuildServerForwardStubs.scala +++ b/modules/build/src/main/scala/scala/build/bsp/ScalaBuildServerForwardStubs.scala @@ -1,6 +1,6 @@ package scala.build.bsp -import ch.epfl.scala.{bsp4j => b} +import ch.epfl.scala.bsp4j as b import java.util.concurrent.CompletableFuture diff --git a/modules/build/src/main/scala/scala/build/bsp/package.scala b/modules/build/src/main/scala/scala/build/bsp/package.scala index 5f3fe3e632..ac7f8139aa 100644 --- a/modules/build/src/main/scala/scala/build/bsp/package.scala +++ b/modules/build/src/main/scala/scala/build/bsp/package.scala @@ -1,7 +1,7 @@ package scala.build -import ch.epfl.scala.bsp4j.SourcesItem import ch.epfl.scala.bsp4j as b +import ch.epfl.scala.bsp4j.SourcesItem import java.util.concurrent.CompletableFuture diff --git a/modules/build/src/main/scala/scala/build/internal/JavaParserProxyBinary.scala b/modules/build/src/main/scala/scala/build/internal/JavaParserProxyBinary.scala index 1e196a61bc..908ce5be43 100644 --- a/modules/build/src/main/scala/scala/build/internal/JavaParserProxyBinary.scala +++ b/modules/build/src/main/scala/scala/build/internal/JavaParserProxyBinary.scala @@ -2,7 +2,7 @@ package scala.build.internal import coursier.cache.ArchiveCache import coursier.util.Task -import dependency._ +import dependency.* import java.util.function.Supplier diff --git a/modules/build/src/main/scala/scala/build/internal/Runner.scala b/modules/build/src/main/scala/scala/build/internal/Runner.scala index f1a6f7a780..2916f7b5c1 100644 --- a/modules/build/src/main/scala/scala/build/internal/Runner.scala +++ b/modules/build/src/main/scala/scala/build/internal/Runner.scala @@ -11,7 +11,7 @@ import java.nio.file.{Files, Path, Paths} import scala.build.EitherCps.{either, value} import scala.build.Logger -import scala.build.errors._ +import scala.build.errors.* import scala.build.internals.EnvVar import scala.build.testrunner.{AsmTestRunner, TestRunner} import scala.util.{Failure, Properties, Success} diff --git a/modules/build/src/main/scala/scala/build/postprocessing/SemanticdbProcessor.scala b/modules/build/src/main/scala/scala/build/postprocessing/SemanticdbProcessor.scala index 6830675681..b6814b47f6 100644 --- a/modules/build/src/main/scala/scala/build/postprocessing/SemanticdbProcessor.scala +++ b/modules/build/src/main/scala/scala/build/postprocessing/SemanticdbProcessor.scala @@ -7,7 +7,7 @@ import java.nio.charset.StandardCharsets import java.security.MessageDigest import scala.collection.mutable -import scala.meta.internal.semanticdb._ +import scala.meta.internal.semanticdb.* object SemanticdbProcessor { diff --git a/modules/build/src/main/scala/scala/build/preprocessing/CustomDirectivesReporter.scala b/modules/build/src/main/scala/scala/build/preprocessing/CustomDirectivesReporter.scala index 2381c160dc..79c012cfcd 100644 --- a/modules/build/src/main/scala/scala/build/preprocessing/CustomDirectivesReporter.scala +++ b/modules/build/src/main/scala/scala/build/preprocessing/CustomDirectivesReporter.scala @@ -1,6 +1,6 @@ package scala.build.preprocessing -import com.virtuslab.using_directives.custom.utils.{Position => DirectivePosition} +import com.virtuslab.using_directives.custom.utils.Position as DirectivePosition import com.virtuslab.using_directives.reporter.Reporter import scala.build.Position diff --git a/modules/build/src/main/scala/scala/build/preprocessing/DirectivesPreprocessor.scala b/modules/build/src/main/scala/scala/build/preprocessing/DirectivesPreprocessor.scala index 3006196cf4..f6dda8ebad 100644 --- a/modules/build/src/main/scala/scala/build/preprocessing/DirectivesPreprocessor.scala +++ b/modules/build/src/main/scala/scala/build/preprocessing/DirectivesPreprocessor.scala @@ -23,9 +23,9 @@ import scala.build.options.{ SuppressWarningOptions, WithBuildRequirements } +import scala.build.preprocessing.directives.* import scala.build.preprocessing.directives.DirectivesPreprocessingUtils.* import scala.build.preprocessing.directives.PartiallyProcessedDirectives.* -import scala.build.preprocessing.directives.* case class DirectivesPreprocessor( path: Either[String, os.Path], diff --git a/modules/build/src/main/scala/scala/build/preprocessing/ExtractedDirectives.scala b/modules/build/src/main/scala/scala/build/preprocessing/ExtractedDirectives.scala index 495933028b..9aa5789bd0 100644 --- a/modules/build/src/main/scala/scala/build/preprocessing/ExtractedDirectives.scala +++ b/modules/build/src/main/scala/scala/build/preprocessing/ExtractedDirectives.scala @@ -8,7 +8,7 @@ import com.virtuslab.using_directives.custom.model.{ UsingDirectives, Value } -import com.virtuslab.using_directives.custom.utils.ast._ +import com.virtuslab.using_directives.custom.utils.ast.* import scala.annotation.targetName import scala.build.errors.* diff --git a/modules/cli/src/main/scala/scala/cli/commands/CustomWindowsEnvVarUpdater.scala b/modules/cli/src/main/scala/scala/cli/commands/CustomWindowsEnvVarUpdater.scala index 2bb29ef292..9a11f3e844 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/CustomWindowsEnvVarUpdater.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/CustomWindowsEnvVarUpdater.scala @@ -1,6 +1,6 @@ package scala.cli.commands -import coursier.env._ +import coursier.env.* // Only using this instead of coursier.env.WindowsEnvVarUpdater for the "\u0000" striping thing, // that earlier version of the Scala CLI may have left behind. diff --git a/modules/cli/src/main/scala/scala/cli/commands/bloop/BloopJson.scala b/modules/cli/src/main/scala/scala/cli/commands/bloop/BloopJson.scala index 6b5c3d2f1d..41b340c693 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/bloop/BloopJson.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/bloop/BloopJson.scala @@ -1,7 +1,7 @@ package scala.cli.commands.bloop -import com.github.plokhotnyuk.jsoniter_scala.core._ -import com.github.plokhotnyuk.jsoniter_scala.macros._ +import com.github.plokhotnyuk.jsoniter_scala.core.* +import com.github.plokhotnyuk.jsoniter_scala.macros.* final case class BloopJson(javaOptions: List[String] = Nil) diff --git a/modules/cli/src/main/scala/scala/cli/commands/bloop/BloopOptions.scala b/modules/cli/src/main/scala/scala/cli/commands/bloop/BloopOptions.scala index 376b8e9346..96d22a6696 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/bloop/BloopOptions.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/bloop/BloopOptions.scala @@ -2,7 +2,7 @@ package scala.cli.commands.bloop import caseapp.* -import scala.cli.commands.shared._ +import scala.cli.commands.shared.* import scala.cli.commands.tags // format: off diff --git a/modules/cli/src/main/scala/scala/cli/commands/bloop/BloopStartOptions.scala b/modules/cli/src/main/scala/scala/cli/commands/bloop/BloopStartOptions.scala index 1bdb421c93..2578ca538b 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/bloop/BloopStartOptions.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/bloop/BloopStartOptions.scala @@ -2,7 +2,7 @@ package scala.cli.commands.bloop import caseapp.* -import scala.cli.commands.shared._ +import scala.cli.commands.shared.* import scala.cli.commands.tags // format: off diff --git a/modules/cli/src/main/scala/scala/cli/commands/bsp/Bsp.scala b/modules/cli/src/main/scala/scala/cli/commands/bsp/Bsp.scala index 7c2595ac94..d28e46e90f 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/bsp/Bsp.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/bsp/Bsp.scala @@ -4,8 +4,8 @@ import caseapp.* import com.github.plokhotnyuk.jsoniter_scala.core.* import com.github.plokhotnyuk.jsoniter_scala.macros.JsonCodecMaker -import scala.build.EitherCps.{either, value} import scala.build.* +import scala.build.EitherCps.{either, value} import scala.build.bsp.{BspReloadableOptions, BspThreads} import scala.build.errors.BuildException import scala.build.input.Inputs diff --git a/modules/cli/src/main/scala/scala/cli/commands/clean/CleanOptions.scala b/modules/cli/src/main/scala/scala/cli/commands/clean/CleanOptions.scala index 36bbafc03e..47a57fc972 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/clean/CleanOptions.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/clean/CleanOptions.scala @@ -3,7 +3,7 @@ package scala.cli.commands.clean import caseapp.* import scala.cli.ScalaCli.fullRunnerName -import scala.cli.commands.shared._ +import scala.cli.commands.shared.* // format: off @HelpMessage(CleanOptions.helpMessage, "", CleanOptions.detailedHelpMessage) diff --git a/modules/cli/src/main/scala/scala/cli/commands/compile/CompileOptions.scala b/modules/cli/src/main/scala/scala/cli/commands/compile/CompileOptions.scala index eaec64b49c..7962ef4906 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/compile/CompileOptions.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/compile/CompileOptions.scala @@ -3,7 +3,7 @@ package scala.cli.commands.compile import caseapp.* import caseapp.core.help.Help -import scala.cli.commands.shared._ +import scala.cli.commands.shared.* import scala.cli.commands.tags @HelpMessage(CompileOptions.helpMessage, "", CompileOptions.detailedHelpMessage) diff --git a/modules/cli/src/main/scala/scala/cli/commands/config/Config.scala b/modules/cli/src/main/scala/scala/cli/commands/config/Config.scala index f6b3f0dad2..d2c7ad3ed3 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/config/Config.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/config/Config.scala @@ -12,7 +12,7 @@ import scala.build.{Directories, Logger} import scala.cli.commands.publish.ConfigUtil.* import scala.cli.commands.shared.HelpGroup import scala.cli.commands.{ScalaCommand, SpecificationLevel} -import scala.cli.config._ +import scala.cli.config.* import scala.cli.util.ArgHelpers.* import scala.cli.util.ConfigDbUtils object Config extends ScalaCommand[ConfigOptions] { diff --git a/modules/cli/src/main/scala/scala/cli/commands/doc/Doc.scala b/modules/cli/src/main/scala/scala/cli/commands/doc/Doc.scala index abb5f5834e..68a647f99d 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/doc/Doc.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/doc/Doc.scala @@ -6,8 +6,8 @@ import dependency.* import java.io.File -import scala.build.EitherCps.{either, value} import scala.build.* +import scala.build.EitherCps.{either, value} import scala.build.compiler.{ScalaCompilerMaker, SimpleScalaCompilerMaker} import scala.build.errors.BuildException import scala.build.interactive.InteractiveFileOps diff --git a/modules/cli/src/main/scala/scala/cli/commands/export0/Export.scala b/modules/cli/src/main/scala/scala/cli/commands/export0/Export.scala index 02d1964c3b..a28524ec89 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/export0/Export.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/export0/Export.scala @@ -11,8 +11,8 @@ import coursier.util.{Artifact, Task} import java.io.{OutputStreamWriter, PrintStream} import java.nio.charset.{Charset, StandardCharsets} -import scala.build.EitherCps.{either, value} import scala.build.* +import scala.build.EitherCps.{either, value} import scala.build.errors.BuildException import scala.build.input.Inputs import scala.build.internal.Constants diff --git a/modules/cli/src/main/scala/scala/cli/commands/github/GitHubApi.scala b/modules/cli/src/main/scala/scala/cli/commands/github/GitHubApi.scala index 3e4cc0ac11..50958e338e 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/github/GitHubApi.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/github/GitHubApi.scala @@ -1,7 +1,7 @@ package scala.cli.commands.github -import com.github.plokhotnyuk.jsoniter_scala.core._ -import com.github.plokhotnyuk.jsoniter_scala.macros._ +import com.github.plokhotnyuk.jsoniter_scala.core.* +import com.github.plokhotnyuk.jsoniter_scala.macros.* import java.util.Base64 diff --git a/modules/cli/src/main/scala/scala/cli/commands/package0/Package.scala b/modules/cli/src/main/scala/scala/cli/commands/package0/Package.scala index cd2fe6cb74..6c3d84d32d 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/package0/Package.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/package0/Package.scala @@ -18,9 +18,9 @@ import java.nio.charset.StandardCharsets import java.nio.file.attribute.FileTime import java.util.zip.{ZipEntry, ZipOutputStream} +import scala.build.* import scala.build.EitherCps.{either, value} import scala.build.Ops.* -import scala.build.* import scala.build.errors.* import scala.build.interactive.InteractiveFileOps import scala.build.internal.Util.* diff --git a/modules/cli/src/main/scala/scala/cli/commands/packaging/Spark.scala b/modules/cli/src/main/scala/scala/cli/commands/packaging/Spark.scala index 3cd9f7165e..712a421a19 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/packaging/Spark.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/packaging/Spark.scala @@ -1,6 +1,6 @@ package scala.cli.commands.packaging -import dependency._ +import dependency.* object Spark { diff --git a/modules/cli/src/main/scala/scala/cli/commands/pgp/KeyServer.scala b/modules/cli/src/main/scala/scala/cli/commands/pgp/KeyServer.scala index 0d84871860..b8f7701b7c 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/pgp/KeyServer.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/pgp/KeyServer.scala @@ -1,6 +1,6 @@ package scala.cli.commands.pgp -import sttp.client3._ +import sttp.client3.* import sttp.model.Uri object KeyServer { diff --git a/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpCreate.scala b/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpCreate.scala index 3668b4c2fd..069a60f588 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpCreate.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpCreate.scala @@ -3,7 +3,7 @@ package scala.cli.commands.pgp import caseapp.core.RemainingArgs import caseapp.core.app.Command -import scala.cli.signing.commands.{PgpCreate => OriginalPgpCreate, PgpCreateOptions} +import scala.cli.signing.commands.{PgpCreate as OriginalPgpCreate, PgpCreateOptions} object PgpCreate extends PgpCommand[PgpCreateOptions] { override def names = PgpCommandNames.pgpCreate diff --git a/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpKeyId.scala b/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpKeyId.scala index 8fdedefbeb..0307e0c882 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpKeyId.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpKeyId.scala @@ -3,7 +3,7 @@ package scala.cli.commands.pgp import caseapp.core.RemainingArgs import caseapp.core.app.Command -import scala.cli.signing.commands.{PgpKeyId => OriginalPgpKeyId, PgpKeyIdOptions} +import scala.cli.signing.commands.{PgpKeyId as OriginalPgpKeyId, PgpKeyIdOptions} object PgpKeyId extends PgpCommand[PgpKeyIdOptions] { override def names: List[List[String]] = PgpCommandNames.pgpKeyId diff --git a/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpPushOptions.scala b/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpPushOptions.scala index dd98b263f3..ba982583e2 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpPushOptions.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpPushOptions.scala @@ -2,7 +2,7 @@ package scala.cli.commands.pgp import caseapp.* -import scala.cli.commands.shared._ +import scala.cli.commands.shared.* // format: off final case class PgpPushOptions( diff --git a/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpSign.scala b/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpSign.scala index 9a1ee6c19e..5d7e1fdf0c 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpSign.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpSign.scala @@ -3,7 +3,7 @@ package scala.cli.commands.pgp import caseapp.core.RemainingArgs import caseapp.core.app.Command -import scala.cli.signing.commands.{PgpSign => OriginalPgpSign, PgpSignOptions} +import scala.cli.signing.commands.{PgpSign as OriginalPgpSign, PgpSignOptions} object PgpSign extends PgpCommand[PgpSignOptions] { override def names = PgpCommandNames.pgpSign diff --git a/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpVerify.scala b/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpVerify.scala index 0838c60ff1..0abb53adea 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpVerify.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/pgp/PgpVerify.scala @@ -3,7 +3,7 @@ package scala.cli.commands.pgp import caseapp.core.RemainingArgs import caseapp.core.app.Command -import scala.cli.signing.commands.{PgpVerify => OriginalPgpVerify, PgpVerifyOptions} +import scala.cli.signing.commands.{PgpVerify as OriginalPgpVerify, PgpVerifyOptions} object PgpVerify extends PgpCommand[PgpVerifyOptions] { override def names = PgpCommandNames.pgpVerify diff --git a/modules/cli/src/main/scala/scala/cli/commands/publish/GitRepo.scala b/modules/cli/src/main/scala/scala/cli/commands/publish/GitRepo.scala index 9486c21be1..e591a2fddf 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/publish/GitRepo.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/publish/GitRepo.scala @@ -3,7 +3,7 @@ package scala.cli.commands.publish import org.eclipse.jgit.api.Git import scala.build.Logger -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* import scala.util.{Properties, Using} object GitRepo { diff --git a/modules/cli/src/main/scala/scala/cli/commands/publish/OptionCheck.scala b/modules/cli/src/main/scala/scala/cli/commands/publish/OptionCheck.scala index 4091a4ed9f..bc64b35c0f 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/publish/OptionCheck.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/publish/OptionCheck.scala @@ -1,7 +1,7 @@ package scala.cli.commands.publish import scala.build.errors.BuildException -import scala.build.options.{PublishOptions => BPublishOptions} +import scala.build.options.PublishOptions as BPublishOptions /** A check for missing options in [[PublishOptions]] */ diff --git a/modules/cli/src/main/scala/scala/cli/commands/publish/OptionChecks.scala b/modules/cli/src/main/scala/scala/cli/commands/publish/OptionChecks.scala index 135def5a08..84ee411138 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/publish/OptionChecks.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/publish/OptionChecks.scala @@ -2,10 +2,10 @@ package scala.cli.commands.publish import coursier.cache.FileCache import coursier.util.Task -import sttp.client3._ +import sttp.client3.* import scala.build.Logger -import scala.cli.commands.publish.checks._ +import scala.cli.commands.publish.checks.* import scala.cli.config.ConfigDb object OptionChecks { diff --git a/modules/cli/src/main/scala/scala/cli/commands/publish/Publish.scala b/modules/cli/src/main/scala/scala/cli/commands/publish/Publish.scala index c5f38e7385..3d4d636daa 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/publish/Publish.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/publish/Publish.scala @@ -23,15 +23,15 @@ import java.time.{Instant, LocalDateTime, ZoneOffset} import java.util.concurrent.Executors import java.util.function.Supplier +import scala.build.* import scala.build.EitherCps.{either, value} import scala.build.Ops.* -import scala.build.* import scala.build.compiler.ScalaCompilerMaker import scala.build.errors.{BuildException, CompositeBuildException, NoMainClassFoundError, Severity} import scala.build.input.Inputs import scala.build.internal.Util import scala.build.internal.Util.ScalaDependencyOps -import scala.build.options.publish.{Developer, License, Signer => PSigner, Vcs} +import scala.build.options.publish.{Developer, License, Signer as PSigner, Vcs} import scala.build.options.{ BuildOptions, ComputeVersion, diff --git a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/ComputeVersionCheck.scala b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/ComputeVersionCheck.scala index d8584fbfdb..b0cc76c2ac 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/ComputeVersionCheck.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/ComputeVersionCheck.scala @@ -2,7 +2,7 @@ package scala.cli.commands.publish.checks import scala.build.Logger import scala.build.errors.BuildException -import scala.build.options.{PublishOptions => BPublishOptions} +import scala.build.options.PublishOptions as BPublishOptions import scala.cli.commands.publish.{GitRepo, OptionCheck, PublishSetupOptions} import scala.cli.errors.MissingPublishOptionError diff --git a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/DeveloperCheck.scala b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/DeveloperCheck.scala index 1f2b9d58b9..cacde7f002 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/DeveloperCheck.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/DeveloperCheck.scala @@ -3,8 +3,8 @@ package scala.cli.commands.publish.checks import scala.build.EitherCps.{either, value} import scala.build.Logger import scala.build.errors.BuildException -import scala.build.options.{PublishOptions => BPublishOptions} -import scala.cli.commands.publish.ConfigUtil._ +import scala.build.options.PublishOptions as BPublishOptions +import scala.cli.commands.publish.ConfigUtil.* import scala.cli.commands.publish.{OptionCheck, PublishSetupOptions} import scala.cli.config.{ConfigDb, Keys} import scala.cli.errors.MissingPublishOptionError diff --git a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/LicenseCheck.scala b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/LicenseCheck.scala index a8cac7069d..895a838831 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/LicenseCheck.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/LicenseCheck.scala @@ -2,7 +2,7 @@ package scala.cli.commands.publish.checks import scala.build.Logger import scala.build.errors.BuildException -import scala.build.options.{PublishOptions => BPublishOptions} +import scala.build.options.PublishOptions as BPublishOptions import scala.cli.commands.publish.{OptionCheck, PublishSetupOptions} final case class LicenseCheck( diff --git a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/NameCheck.scala b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/NameCheck.scala index 7e7755097c..0fb31e6c35 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/NameCheck.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/NameCheck.scala @@ -2,7 +2,7 @@ package scala.cli.commands.publish.checks import scala.build.Logger import scala.build.errors.BuildException -import scala.build.options.{PublishOptions => BPublishOptions} +import scala.build.options.PublishOptions as BPublishOptions import scala.cli.commands.publish.{OptionCheck, PublishSetupOptions} final case class NameCheck( diff --git a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/OrganizationCheck.scala b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/OrganizationCheck.scala index 93774f14be..c295f8e52e 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/OrganizationCheck.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/OrganizationCheck.scala @@ -2,7 +2,7 @@ package scala.cli.commands.publish.checks import scala.build.Logger import scala.build.errors.BuildException -import scala.build.options.{PublishOptions => BPublishOptions} +import scala.build.options.PublishOptions as BPublishOptions import scala.cli.commands.publish.{GitRepo, OptionCheck, PublishSetupOptions} import scala.cli.errors.MissingPublishOptionError diff --git a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/PasswordCheck.scala b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/PasswordCheck.scala index 11124682a0..73e418d0f1 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/PasswordCheck.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/PasswordCheck.scala @@ -5,8 +5,8 @@ import java.net.URI import scala.build.EitherCps.{either, value} import scala.build.Logger import scala.build.errors.BuildException -import scala.build.options.{PublishOptions => BPublishOptions} -import scala.cli.commands.publish.ConfigUtil._ +import scala.build.options.PublishOptions as BPublishOptions +import scala.cli.commands.publish.ConfigUtil.* import scala.cli.commands.publish.{OptionCheck, PublishSetupOptions, RepoParams, SetSecret} import scala.cli.config.{ConfigDb, Keys} import scala.cli.errors.MissingPublishOptionError diff --git a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/PgpSecretKeyCheck.scala b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/PgpSecretKeyCheck.scala index 5b12ee4e56..25f4963b2b 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/PgpSecretKeyCheck.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/PgpSecretKeyCheck.scala @@ -10,9 +10,9 @@ import scala.build.Logger import scala.build.Ops.* import scala.build.errors.{BuildException, CompositeBuildException, MalformedCliInputError} import scala.build.internal.util.WarningMessages +import scala.build.options.PublishOptions as BPublishOptions import scala.build.options.publish.ConfigPasswordOption import scala.build.options.publish.ConfigPasswordOption.* -import scala.build.options.PublishOptions as BPublishOptions import scala.cli.commands.config.ThrowawayPgpSecret import scala.cli.commands.pgp.{KeyServer, PgpProxyMaker} import scala.cli.commands.publish.ConfigUtil.* diff --git a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/ScmCheck.scala b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/ScmCheck.scala index 5e2f820768..82053da328 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/ScmCheck.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/ScmCheck.scala @@ -2,7 +2,7 @@ package scala.cli.commands.publish.checks import scala.build.Logger import scala.build.errors.BuildException -import scala.build.options.{PublishOptions => BPublishOptions} +import scala.build.options.PublishOptions as BPublishOptions import scala.cli.commands.publish.{GitRepo, OptionCheck, PublishSetupOptions} import scala.cli.errors.MissingPublishOptionError diff --git a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/UrlCheck.scala b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/UrlCheck.scala index 7c0b5b5486..1e1a627b47 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/UrlCheck.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/UrlCheck.scala @@ -2,7 +2,7 @@ package scala.cli.commands.publish.checks import scala.build.Logger import scala.build.errors.BuildException -import scala.build.options.{PublishOptions => BPublishOptions} +import scala.build.options.PublishOptions as BPublishOptions import scala.cli.commands.publish.{GitRepo, OptionCheck, PublishSetupOptions} import scala.cli.errors.MissingPublishOptionError diff --git a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/UserCheck.scala b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/UserCheck.scala index 86e03195c2..207b81f8e3 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/publish/checks/UserCheck.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/publish/checks/UserCheck.scala @@ -5,8 +5,8 @@ import java.net.URI import scala.build.EitherCps.{either, value} import scala.build.Logger import scala.build.errors.BuildException -import scala.build.options.{PublishOptions => BPublishOptions} -import scala.cli.commands.publish.ConfigUtil._ +import scala.build.options.PublishOptions as BPublishOptions +import scala.cli.commands.publish.ConfigUtil.* import scala.cli.commands.publish.{OptionCheck, PublishSetupOptions, RepoParams, SetSecret} import scala.cli.config.{ConfigDb, Keys} import scala.cli.errors.MissingPublishOptionError diff --git a/modules/cli/src/main/scala/scala/cli/commands/repl/Repl.scala b/modules/cli/src/main/scala/scala/cli/commands/repl/Repl.scala index ea0dc10186..3b20599aea 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/repl/Repl.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/repl/Repl.scala @@ -10,8 +10,8 @@ import dependency.* import java.io.File import java.util.zip.ZipFile -import scala.build.EitherCps.{either, value} import scala.build.* +import scala.build.EitherCps.{either, value} import scala.build.errors.{ BuildException, CantDownloadAmmoniteError, diff --git a/modules/cli/src/main/scala/scala/cli/commands/run/Run.scala b/modules/cli/src/main/scala/scala/cli/commands/run/Run.scala index 68c2b2a86a..c2ab3b87b9 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/run/Run.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/run/Run.scala @@ -9,8 +9,8 @@ import java.util.Locale import java.util.concurrent.CompletableFuture import java.util.concurrent.atomic.AtomicReference -import scala.build.EitherCps.{either, value} import scala.build.* +import scala.build.EitherCps.{either, value} import scala.build.errors.BuildException import scala.build.input.{Inputs, ScalaCliInvokeData, SubCommand} import scala.build.internal.{Constants, Runner, ScalaJsLinkerConfig} diff --git a/modules/cli/src/main/scala/scala/cli/commands/run/SharedRunOptions.scala b/modules/cli/src/main/scala/scala/cli/commands/run/SharedRunOptions.scala index 832207f2c3..19e1f3f7bf 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/run/SharedRunOptions.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/run/SharedRunOptions.scala @@ -3,7 +3,7 @@ package scala.cli.commands.run import caseapp.* import caseapp.core.help.Help -import scala.cli.commands.shared._ +import scala.cli.commands.shared.* import scala.cli.commands.tags // format: off diff --git a/modules/cli/src/main/scala/scala/cli/commands/setupide/SetupIde.scala b/modules/cli/src/main/scala/scala/cli/commands/setupide/SetupIde.scala index 1b3aa42ce3..c896d0017f 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/setupide/SetupIde.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/setupide/SetupIde.scala @@ -8,8 +8,8 @@ import com.google.gson.GsonBuilder import java.nio.charset.{Charset, StandardCharsets} -import scala.build.EitherCps.{either, value} import scala.build.* +import scala.build.EitherCps.{either, value} import scala.build.bsp.IdeInputs import scala.build.errors.{BuildException, WorkspaceError} import scala.build.input.{Inputs, OnDisk, Virtual, WorkspaceOrigin} diff --git a/modules/cli/src/main/scala/scala/cli/commands/shared/SharedOptions.scala b/modules/cli/src/main/scala/scala/cli/commands/shared/SharedOptions.scala index 4d1d039099..0d103bb0bd 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/shared/SharedOptions.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/shared/SharedOptions.scala @@ -17,9 +17,9 @@ import java.io.{File, InputStream} import java.nio.file.Paths import java.util.concurrent.atomic.AtomicBoolean +import scala.build.* import scala.build.EitherCps.{either, value} import scala.build.Ops.EitherOptOps -import scala.build.* import scala.build.compiler.{BloopCompilerMaker, ScalaCompilerMaker, SimpleScalaCompilerMaker} import scala.build.directives.DirectiveDescription import scala.build.errors.{AmbiguousPlatformError, BuildException, ConfigDbException, Severity} @@ -29,12 +29,12 @@ import scala.build.interactive.Interactive.{InteractiveAsk, InteractiveNop} import scala.build.internal.util.WarningMessages import scala.build.internal.{Constants, FetchExternalBinary, OsLibc, Util} import scala.build.internals.ConsoleUtils.ScalaCliConsole +import scala.build.options as bo import scala.build.options.ScalaVersionUtil.fileWithTtl0 import scala.build.options.{BuildOptions, ComputeVersion, Platform, ScalacOpt, ShadowingSeq} import scala.build.preprocessing.directives.ClasspathUtils.* import scala.build.preprocessing.directives.Toolkit.maxScalaNativeWarningMsg import scala.build.preprocessing.directives.{Python, Toolkit} -import scala.build.options as bo import scala.cli.ScalaCli import scala.cli.commands.publish.ConfigUtil.* import scala.cli.commands.shared.{ diff --git a/modules/cli/src/main/scala/scala/cli/commands/test/Test.scala b/modules/cli/src/main/scala/scala/cli/commands/test/Test.scala index 5592698087..b61b67ebe0 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/test/Test.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/test/Test.scala @@ -5,9 +5,9 @@ import caseapp.core.help.HelpFormat import java.nio.file.Path +import scala.build.* import scala.build.EitherCps.{either, value} import scala.build.Ops.* -import scala.build.* import scala.build.errors.{BuildException, CompositeBuildException} import scala.build.internal.{Constants, Runner} import scala.build.internals.ConsoleUtils.ScalaCliConsole diff --git a/modules/cli/src/main/scala/scala/cli/commands/test/TestOptions.scala b/modules/cli/src/main/scala/scala/cli/commands/test/TestOptions.scala index 131ece4169..7307037965 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/test/TestOptions.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/test/TestOptions.scala @@ -3,7 +3,7 @@ package scala.cli.commands.test import caseapp.* import caseapp.core.help.Help -import scala.cli.commands.shared._ +import scala.cli.commands.shared.* import scala.cli.commands.tags @HelpMessage(TestOptions.helpMessage, "", TestOptions.detailedHelpMessage) diff --git a/modules/cli/src/main/scala/scala/cli/commands/util/RunHadoop.scala b/modules/cli/src/main/scala/scala/cli/commands/util/RunHadoop.scala index 9ab521da57..5be02bc881 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/util/RunHadoop.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/util/RunHadoop.scala @@ -4,7 +4,7 @@ import scala.build.EitherCps.{either, value} import scala.build.errors.BuildException import scala.build.internal.Runner import scala.build.{Build, Logger} -import scala.cli.commands.package0.{Package => PackageCmd} +import scala.cli.commands.package0.Package as PackageCmd import scala.cli.commands.packaging.Spark object RunHadoop { diff --git a/modules/cli/src/main/scala/scala/cli/exportCmd/MillProject.scala b/modules/cli/src/main/scala/scala/cli/exportCmd/MillProject.scala index 7b31b08c01..6703cc1e94 100644 --- a/modules/cli/src/main/scala/scala/cli/exportCmd/MillProject.scala +++ b/modules/cli/src/main/scala/scala/cli/exportCmd/MillProject.scala @@ -3,7 +3,7 @@ package scala.cli.exportCmd import java.nio.charset.StandardCharsets import scala.build.options.ConfigMonoid -import scala.cli.util.SeqHelpers._ +import scala.cli.util.SeqHelpers.* import scala.reflect.NameTransformer import scala.util.Properties diff --git a/modules/cli/src/main/scala/scala/cli/internal/CliLogger.scala b/modules/cli/src/main/scala/scala/cli/internal/CliLogger.scala index fe91c52944..59fccb3796 100644 --- a/modules/cli/src/main/scala/scala/cli/internal/CliLogger.scala +++ b/modules/cli/src/main/scala/scala/cli/internal/CliLogger.scala @@ -1,11 +1,11 @@ package scala.cli.internal import bloop.rifle.BloopRifleLogger -import ch.epfl.scala.bsp4j.Location import ch.epfl.scala.bsp4j as b +import ch.epfl.scala.bsp4j.Location import coursier.cache.CacheLogger import coursier.cache.loggers.{FallbackRefreshDisplay, RefreshLogger} -import org.scalajs.logging.{Level => ScalaJsLevel, Logger => ScalaJsLogger, ScalaConsoleLogger} +import org.scalajs.logging.{Level as ScalaJsLevel, Logger as ScalaJsLogger, ScalaConsoleLogger} import java.io.PrintStream diff --git a/modules/cli/src/main/scala/scala/cli/internal/ScalaJsLinker.scala b/modules/cli/src/main/scala/scala/cli/internal/ScalaJsLinker.scala index b05183e67e..2a8f6bad31 100644 --- a/modules/cli/src/main/scala/scala/cli/internal/ScalaJsLinker.scala +++ b/modules/cli/src/main/scala/scala/cli/internal/ScalaJsLinker.scala @@ -4,8 +4,8 @@ import coursier.Repositories import coursier.cache.{ArchiveCache, FileCache} import coursier.core.Version import coursier.util.Task -import dependency._ -import org.scalajs.testing.adapter.{TestAdapterInitializer => TAI} +import dependency.* +import org.scalajs.testing.adapter.TestAdapterInitializer as TAI import java.io.{File, InputStream, OutputStream} diff --git a/modules/cli/src/main/scala/scala/cli/javaLauncher/JavaLauncherCli.scala b/modules/cli/src/main/scala/scala/cli/javaLauncher/JavaLauncherCli.scala index 375567a985..4f596a676a 100644 --- a/modules/cli/src/main/scala/scala/cli/javaLauncher/JavaLauncherCli.scala +++ b/modules/cli/src/main/scala/scala/cli/javaLauncher/JavaLauncherCli.scala @@ -7,7 +7,7 @@ import scala.build.errors.BuildException import scala.build.internal.{OsLibc, Runner} import scala.build.options.{BuildOptions, JavaOptions} import scala.cli.commands.shared.LoggingOptions -import scala.cli.javaLauncher.JavaLauncherCli.LauncherKind._ +import scala.cli.javaLauncher.JavaLauncherCli.LauncherKind.* object JavaLauncherCli { def runAndExit(remainingArgs: Seq[String]): Nothing = { diff --git a/modules/cli/src/main/scala/scala/cli/packaging/Library.scala b/modules/cli/src/main/scala/scala/cli/packaging/Library.scala index 9ba415b6b0..361b1cffa3 100644 --- a/modules/cli/src/main/scala/scala/cli/packaging/Library.scala +++ b/modules/cli/src/main/scala/scala/cli/packaging/Library.scala @@ -3,7 +3,7 @@ package scala.cli.packaging import java.io.OutputStream import java.nio.file.StandardOpenOption.{CREATE, TRUNCATE_EXISTING} import java.nio.file.attribute.FileTime -import java.util.jar.{Attributes => JarAttributes, JarOutputStream} +import java.util.jar.{Attributes as JarAttributes, JarOutputStream} import java.util.zip.{ZipEntry, ZipOutputStream} import scala.build.Build diff --git a/modules/cli/src/main/scala/scala/cli/util/ConfigPasswordOptionHelpers.scala b/modules/cli/src/main/scala/scala/cli/util/ConfigPasswordOptionHelpers.scala index e87baf6bd0..9b660b64d4 100644 --- a/modules/cli/src/main/scala/scala/cli/util/ConfigPasswordOptionHelpers.scala +++ b/modules/cli/src/main/scala/scala/cli/util/ConfigPasswordOptionHelpers.scala @@ -3,7 +3,7 @@ package scala.cli.util import scala.build.errors.BuildException import scala.build.options.publish.ConfigPasswordOption import scala.cli.commands.SpecificationLevel -import scala.cli.commands.publish.ConfigUtil._ +import scala.cli.commands.publish.ConfigUtil.* import scala.cli.config.{ConfigDb, Key, PasswordOption} import scala.cli.errors.MissingConfigEntryError diff --git a/modules/cli/src/test/scala/cli/commands/tests/ReplOptionsTests.scala b/modules/cli/src/test/scala/cli/commands/tests/ReplOptionsTests.scala index 00b2227480..565a5661aa 100644 --- a/modules/cli/src/test/scala/cli/commands/tests/ReplOptionsTests.scala +++ b/modules/cli/src/test/scala/cli/commands/tests/ReplOptionsTests.scala @@ -1,6 +1,6 @@ package scala.cli.commands.tests -import com.eed3si9n.expecty.Expecty.{assert => expect} +import com.eed3si9n.expecty.Expecty.assert as expect import scala.cli.commands.repl.{Repl, ReplOptions, SharedReplOptions} import scala.cli.commands.shared.{SharedOptions, SharedPythonOptions} diff --git a/modules/cli/src/test/scala/cli/commands/tests/RunOptionsTests.scala b/modules/cli/src/test/scala/cli/commands/tests/RunOptionsTests.scala index 3aa077bbcd..82ab8fdff4 100644 --- a/modules/cli/src/test/scala/cli/commands/tests/RunOptionsTests.scala +++ b/modules/cli/src/test/scala/cli/commands/tests/RunOptionsTests.scala @@ -1,6 +1,6 @@ package scala.cli.commands.tests -import com.eed3si9n.expecty.Expecty.{assert => expect} +import com.eed3si9n.expecty.Expecty.assert as expect import scala.cli.commands.run.{Run, RunOptions, SharedRunOptions} import scala.cli.commands.shared.{SharedOptions, SharedPythonOptions} diff --git a/modules/cli/src/test/scala/cli/tests/CachedBinaryTests.scala b/modules/cli/src/test/scala/cli/tests/CachedBinaryTests.scala index 2a758e8fa8..2475f86874 100644 --- a/modules/cli/src/test/scala/cli/tests/CachedBinaryTests.scala +++ b/modules/cli/src/test/scala/cli/tests/CachedBinaryTests.scala @@ -1,6 +1,6 @@ package scala.cli.tests -import com.eed3si9n.expecty.Expecty.{assert => expect} +import com.eed3si9n.expecty.Expecty.assert as expect import scala.build.options.{BuildOptions, InternalOptions} import scala.build.tests.util.BloopServer diff --git a/modules/core/src/main/scala/scala/build/Logger.scala b/modules/core/src/main/scala/scala/build/Logger.scala index 35b863aaee..574ce35b10 100644 --- a/modules/core/src/main/scala/scala/build/Logger.scala +++ b/modules/core/src/main/scala/scala/build/Logger.scala @@ -1,13 +1,13 @@ package scala.build import bloop.rifle.BloopRifleLogger -import org.scalajs.logging.{Logger => ScalaJsLogger, NullLogger} +import org.scalajs.logging.{Logger as ScalaJsLogger, NullLogger} import java.io.{OutputStream, PrintStream} import scala.build.errors.{BuildException, Diagnostic, Severity} import scala.build.internals.FeatureType -import scala.scalanative.{build => sn} +import scala.scalanative.build as sn trait Logger { def error(message: String): Unit diff --git a/modules/core/src/main/scala/scala/build/internals/CustomProgressBarRefreshDisplay.scala b/modules/core/src/main/scala/scala/build/internals/CustomProgressBarRefreshDisplay.scala index ea65dbb006..a5e9b27f31 100644 --- a/modules/core/src/main/scala/scala/build/internals/CustomProgressBarRefreshDisplay.scala +++ b/modules/core/src/main/scala/scala/build/internals/CustomProgressBarRefreshDisplay.scala @@ -4,7 +4,7 @@ package scala.build.internal // bars on screen import coursier.cache.internal.ConsoleDim -import coursier.cache.loggers._ +import coursier.cache.loggers.* import java.io.Writer import java.sql.Timestamp diff --git a/modules/core/src/main/scala/scala/build/internals/StableScalaVersion.scala b/modules/core/src/main/scala/scala/build/internals/StableScalaVersion.scala index 9eeb2ac387..192f41e7aa 100644 --- a/modules/core/src/main/scala/scala/build/internals/StableScalaVersion.scala +++ b/modules/core/src/main/scala/scala/build/internals/StableScalaVersion.scala @@ -1,7 +1,7 @@ package scala.build.internal -import com.github.plokhotnyuk.jsoniter_scala.core._ -import com.github.plokhotnyuk.jsoniter_scala.macros._ +import com.github.plokhotnyuk.jsoniter_scala.core.* +import com.github.plokhotnyuk.jsoniter_scala.macros.* import coursier.core.Version final case class StableScalaVersion( diff --git a/modules/directives/src/main/scala/scala/build/preprocessing/directives/ComputeVersion.scala b/modules/directives/src/main/scala/scala/build/preprocessing/directives/ComputeVersion.scala index a7281455f1..fd47132c41 100644 --- a/modules/directives/src/main/scala/scala/build/preprocessing/directives/ComputeVersion.scala +++ b/modules/directives/src/main/scala/scala/build/preprocessing/directives/ComputeVersion.scala @@ -12,7 +12,7 @@ import scala.build.directives.{ HasBuildOptions } import scala.build.errors.BuildException -import scala.build.options.{BuildOptions, ComputeVersion => cv, SourceGeneratorOptions} +import scala.build.options.{BuildOptions, ComputeVersion as cv, SourceGeneratorOptions} import scala.cli.commands.SpecificationLevel @DirectiveGroupName("Compute Version") diff --git a/modules/directives/src/main/scala/scala/build/preprocessing/directives/DirectiveHandler.scala b/modules/directives/src/main/scala/scala/build/preprocessing/directives/DirectiveHandler.scala index 40d782cb3c..e0236ec4fd 100644 --- a/modules/directives/src/main/scala/scala/build/preprocessing/directives/DirectiveHandler.scala +++ b/modules/directives/src/main/scala/scala/build/preprocessing/directives/DirectiveHandler.scala @@ -18,7 +18,7 @@ import scala.build.errors.{ import scala.build.preprocessing.Scoped import scala.cli.commands.SpecificationLevel import scala.deriving.* -import scala.quoted.{_, given} +import scala.quoted.{*, given} trait DirectiveHandler[+T] { self => def name: String diff --git a/modules/directives/src/main/scala/scala/build/preprocessing/directives/Packaging.scala b/modules/directives/src/main/scala/scala/build/preprocessing/directives/Packaging.scala index dca479380f..00c9623c02 100644 --- a/modules/directives/src/main/scala/scala/build/preprocessing/directives/Packaging.scala +++ b/modules/directives/src/main/scala/scala/build/preprocessing/directives/Packaging.scala @@ -11,7 +11,7 @@ import scala.build.errors.{ MalformedInputError, ModuleFormatError } -import scala.build.options._ +import scala.build.options.* import scala.build.options.packaging.{DockerOptions, NativeImageOptions} import scala.build.{Positioned, options} import scala.cli.commands.SpecificationLevel diff --git a/modules/directives/src/main/scala/scala/build/preprocessing/directives/PublishContextual.scala b/modules/directives/src/main/scala/scala/build/preprocessing/directives/PublishContextual.scala index 151e809eae..7305cef295 100644 --- a/modules/directives/src/main/scala/scala/build/preprocessing/directives/PublishContextual.scala +++ b/modules/directives/src/main/scala/scala/build/preprocessing/directives/PublishContextual.scala @@ -4,7 +4,7 @@ import scala.build.EitherCps.{either, value} import scala.build.Ops.* import scala.build.directives.* import scala.build.errors.{BuildException, CompositeBuildException, MalformedInputError} -import scala.build.options._ +import scala.build.options.* import scala.build.options.publish.ConfigPasswordOption import scala.build.{Positioned, options} import scala.cli.commands.SpecificationLevel diff --git a/modules/directives/src/main/scala/scala/build/preprocessing/directives/Toolkit.scala b/modules/directives/src/main/scala/scala/build/preprocessing/directives/Toolkit.scala index 22f5799a12..c3dc4ad56a 100644 --- a/modules/directives/src/main/scala/scala/build/preprocessing/directives/Toolkit.scala +++ b/modules/directives/src/main/scala/scala/build/preprocessing/directives/Toolkit.scala @@ -7,9 +7,9 @@ import scala.build.Positioned import scala.build.directives.* import scala.build.errors.BuildException import scala.build.internal.Constants +import scala.build.options.* import scala.build.options.BuildRequirements.ScopeRequirement import scala.build.options.WithBuildRequirements.* -import scala.build.options.* import scala.cli.commands.SpecificationLevel @DirectiveGroupName("Toolkit") diff --git a/modules/integration/src/test/scala/scala/cli/integration/BspTestDefinitions.scala b/modules/integration/src/test/scala/scala/cli/integration/BspTestDefinitions.scala index 521e3bb5c1..3a7c23a0df 100644 --- a/modules/integration/src/test/scala/scala/cli/integration/BspTestDefinitions.scala +++ b/modules/integration/src/test/scala/scala/cli/integration/BspTestDefinitions.scala @@ -1,7 +1,7 @@ package scala.cli.integration -import ch.epfl.scala.bsp4j.JvmTestEnvironmentParams import ch.epfl.scala.bsp4j as b +import ch.epfl.scala.bsp4j.JvmTestEnvironmentParams import com.eed3si9n.expecty.Expecty.expect import com.google.gson.{Gson, JsonElement} diff --git a/modules/integration/src/test/scala/scala/cli/integration/DocTestDefinitions.scala b/modules/integration/src/test/scala/scala/cli/integration/DocTestDefinitions.scala index b3a0b0a5a2..6b11c8d8ef 100644 --- a/modules/integration/src/test/scala/scala/cli/integration/DocTestDefinitions.scala +++ b/modules/integration/src/test/scala/scala/cli/integration/DocTestDefinitions.scala @@ -1,9 +1,9 @@ package scala.cli.integration import com.eed3si9n.expecty.Expecty.expect -import org.jsoup._ +import org.jsoup.* -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* abstract class DocTestDefinitions extends ScalaCliSuite with TestScalaVersionArgs { _: TestScalaVersion => diff --git a/modules/integration/src/test/scala/scala/cli/integration/SparkTests212.scala b/modules/integration/src/test/scala/scala/cli/integration/SparkTests212.scala index 3b38af3b92..c8c9c74c59 100644 --- a/modules/integration/src/test/scala/scala/cli/integration/SparkTests212.scala +++ b/modules/integration/src/test/scala/scala/cli/integration/SparkTests212.scala @@ -5,7 +5,7 @@ import com.eed3si9n.expecty.Expecty.expect import java.io.File import java.util.Locale -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* import scala.util.Properties class SparkTests212 extends SparkTestDefinitions with Test212 { diff --git a/modules/integration/src/test/scala/scala/cli/integration/TestBspClient.scala b/modules/integration/src/test/scala/scala/cli/integration/TestBspClient.scala index dd128b37ea..733832b6c2 100644 --- a/modules/integration/src/test/scala/scala/cli/integration/TestBspClient.scala +++ b/modules/integration/src/test/scala/scala/cli/integration/TestBspClient.scala @@ -1,6 +1,6 @@ package scala.cli.integration -import ch.epfl.scala.{bsp4j => b} +import ch.epfl.scala.bsp4j as b import org.eclipse.lsp4j.jsonrpc import java.io.{InputStream, OutputStream} diff --git a/modules/options/src/main/scala/scala/build/Artifacts.scala b/modules/options/src/main/scala/scala/build/Artifacts.scala index 573dae3046..1beae8f494 100644 --- a/modules/options/src/main/scala/scala/build/Artifacts.scala +++ b/modules/options/src/main/scala/scala/build/Artifacts.scala @@ -4,7 +4,7 @@ import coursier.cache.FileCache import coursier.core.{Classifier, Module, ModuleName, Organization, Repository, Version} import coursier.error.ResolutionError import coursier.util.Task -import coursier.{Dependency => CsDependency, Fetch, Resolution, core => csCore, util => csUtil} +import coursier.{Dependency as CsDependency, Fetch, Resolution, core as csCore, util as csUtil} import dependency.* import java.net.URL diff --git a/modules/options/src/main/scala/scala/build/CoursierUtils.scala b/modules/options/src/main/scala/scala/build/CoursierUtils.scala index 078bff7719..fb16702a70 100644 --- a/modules/options/src/main/scala/scala/build/CoursierUtils.scala +++ b/modules/options/src/main/scala/scala/build/CoursierUtils.scala @@ -1,6 +1,6 @@ package scala.build -import coursier.core.{Dependency => CDependency, Module} +import coursier.core.{Dependency as CDependency, Module} import coursier.parse.{DependencyParser, ModuleParser} import dependency.{DependencyLike, NameAttributes} diff --git a/modules/options/src/main/scala/scala/build/actionable/ActionableDiagnostic.scala b/modules/options/src/main/scala/scala/build/actionable/ActionableDiagnostic.scala index d751a0a443..4bd5e7957c 100644 --- a/modules/options/src/main/scala/scala/build/actionable/ActionableDiagnostic.scala +++ b/modules/options/src/main/scala/scala/build/actionable/ActionableDiagnostic.scala @@ -1,6 +1,6 @@ package scala.build.actionable -import dependency._ +import dependency.* import scala.build.Position import scala.build.errors.Diagnostic.TextEdit diff --git a/modules/options/src/main/scala/scala/build/actionable/ActionablePreprocessor.scala b/modules/options/src/main/scala/scala/build/actionable/ActionablePreprocessor.scala index b410ceb59e..7fd35c0efa 100644 --- a/modules/options/src/main/scala/scala/build/actionable/ActionablePreprocessor.scala +++ b/modules/options/src/main/scala/scala/build/actionable/ActionablePreprocessor.scala @@ -1,6 +1,6 @@ package scala.build.actionable -import scala.build.Ops._ +import scala.build.Ops.* import scala.build.errors.{BuildException, CompositeBuildException, Diagnostic} import scala.build.options.BuildOptions diff --git a/modules/options/src/main/scala/scala/build/options/ClassPathOptions.scala b/modules/options/src/main/scala/scala/build/options/ClassPathOptions.scala index 76d886586d..be8a499d6e 100644 --- a/modules/options/src/main/scala/scala/build/options/ClassPathOptions.scala +++ b/modules/options/src/main/scala/scala/build/options/ClassPathOptions.scala @@ -1,6 +1,6 @@ package scala.build.options -import dependency._ +import dependency.* import scala.build.Positioned diff --git a/modules/options/src/main/scala/scala/build/options/JavaOptions.scala b/modules/options/src/main/scala/scala/build/options/JavaOptions.scala index 594a3055bc..0ec8181e14 100644 --- a/modules/options/src/main/scala/scala/build/options/JavaOptions.scala +++ b/modules/options/src/main/scala/scala/build/options/JavaOptions.scala @@ -6,7 +6,7 @@ import coursier.jvm.{JavaHome, JvmCache, JvmIndex} import coursier.util.Task import dependency.AnyDependency -import scala.build.internal.CsLoggerUtil._ +import scala.build.internal.CsLoggerUtil.* import scala.build.internal.OsLibc import scala.build.options.BuildOptions.JavaHomeInfo import scala.build.{Os, Position, Positioned} diff --git a/modules/options/src/main/scala/scala/build/options/PackageOptions.scala b/modules/options/src/main/scala/scala/build/options/PackageOptions.scala index 53cd58fdf0..fd76806a2e 100644 --- a/modules/options/src/main/scala/scala/build/options/PackageOptions.scala +++ b/modules/options/src/main/scala/scala/build/options/PackageOptions.scala @@ -1,7 +1,7 @@ package scala.build.options import scala.build.internal.Constants -import scala.build.options.packaging._ +import scala.build.options.packaging.* final case class PackageOptions( standalone: Option[Boolean] = None, diff --git a/modules/options/src/main/scala/scala/build/options/ScalaJsOptions.scala b/modules/options/src/main/scala/scala/build/options/ScalaJsOptions.scala index 8c56c0f0ba..22bb1bcc1d 100644 --- a/modules/options/src/main/scala/scala/build/options/ScalaJsOptions.scala +++ b/modules/options/src/main/scala/scala/build/options/ScalaJsOptions.scala @@ -1,7 +1,7 @@ package scala.build.options -import bloop.config.{Config => BloopConfig} -import dependency._ +import bloop.config.Config as BloopConfig +import dependency.* import java.util.Locale diff --git a/modules/options/src/main/scala/scala/build/options/ScalaNativeOptions.scala b/modules/options/src/main/scala/scala/build/options/ScalaNativeOptions.scala index 0857a0fd18..3491273869 100644 --- a/modules/options/src/main/scala/scala/build/options/ScalaNativeOptions.scala +++ b/modules/options/src/main/scala/scala/build/options/ScalaNativeOptions.scala @@ -1,13 +1,13 @@ package scala.build.options -import _root_.bloop.config.{Config => BloopConfig} -import dependency._ +import _root_.bloop.config.Config as BloopConfig +import dependency.* import java.nio.file.Paths import scala.build.internal.Constants +import scala.scalanative.build as sn import scala.scalanative.build.LTO -import scala.scalanative.{build => sn} enum ScalaNativeTarget: case Application, LibraryDynamic, LibraryStatic diff --git a/modules/scala3-graal/src/main/scala/scala/cli/graal/BytecodeProcessor.scala b/modules/scala3-graal/src/main/scala/scala/cli/graal/BytecodeProcessor.scala index 4026df2e46..39311c5128 100644 --- a/modules/scala3-graal/src/main/scala/scala/cli/graal/BytecodeProcessor.scala +++ b/modules/scala3-graal/src/main/scala/scala/cli/graal/BytecodeProcessor.scala @@ -1,12 +1,12 @@ package scala.cli.graal -import org.objectweb.asm._ +import org.objectweb.asm.* import java.io.{File, InputStream} import java.nio.file.{Files, StandardOpenOption} import java.util.jar.{Attributes, JarEntry, JarFile, JarOutputStream, Manifest} -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* object BytecodeProcessor { From fb66ee408b7e4f4a0f44eaefdacfc231c8e8d3dc Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Tue, 29 Oct 2024 13:08:13 +0100 Subject: [PATCH 29/30] . --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc8c861bda..4b32553e8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -197,7 +197,7 @@ jobs: if: env.SHOULD_PUBLISH == 'true' run: .github/scripts/generate-os-packages.sh - name: Copy artifacts - run: ./mill -i copyDefaultLauncher artifacts/ + run: ./mill -i copyDefaultLauncher --directory artifacts/ - uses: actions/upload-artifact@v3 with: name: linux-launchers @@ -413,7 +413,7 @@ jobs: if: env.SHOULD_PUBLISH == 'true' run: .github/scripts/generate-os-packages.sh - name: Copy artifacts - run: ./mill -i copyDefaultLauncher artifacts/ + run: ./mill -i copyDefaultLauncher --directory artifacts/ - uses: actions/upload-artifact@v3 with: name: macos-launchers @@ -616,7 +616,7 @@ jobs: if: env.SHOULD_PUBLISH == 'true' run: .github/scripts/generate-os-packages.sh - name: Copy artifacts - run: ./mill -i copyDefaultLauncher artifacts/ + run: ./mill -i copyDefaultLauncher --directory artifacts/ - uses: actions/upload-artifact@v3 with: name: macos-m1-launchers From fc61fe1045f41771a82a2ad8301bdfcf2c33bcb2 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Wed, 30 Oct 2024 14:32:05 +0100 Subject: [PATCH 30/30] Support directory with trailing slash --- build.mill.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.mill.scala b/build.mill.scala index 23121a021e..6ae6ef1bfa 100644 --- a/build.mill.scala +++ b/build.mill.scala @@ -1306,7 +1306,7 @@ def writeShortPackageVersionTo(dest: String) = T.command { def importedLauncher(workspace: os.Path, directory: String = "artifacts"): Array[Byte] = { val ext = if (Properties.isWin) ".zip" else ".gz" - val from = workspace / directory / s"scala-cli-${Upload.platformSuffix}$ext" + val from = os.Path(directory, workspace) / s"scala-cli-${Upload.platformSuffix}$ext" System.err.println(s"Importing launcher from $from") if (!os.exists(from)) sys.error(s"$from not found")