@@ -231,7 +231,7 @@ trait DocsTests extends CrossSbtModule with ScalaCliScalafixModule with HasTests
231
231
object packager extends ScalaModule with Bloop .Module {
232
232
def skipBloop = true
233
233
def scalaVersion : Target [String ] = Scala .scala213
234
- def ivyDeps : Target [Agg [Dep ]] = Agg (
234
+ def ivyDeps : Target [Agg [Dep ]] = Agg (
235
235
Deps .scalaPackagerCli
236
236
)
237
237
def mainClass : Target [Option [String ]] = Some (" packager.cli.PackagerCli" )
@@ -263,7 +263,7 @@ object dummy extends Module {
263
263
// versions are used in the fmt and repl commands, and ensure Ammonite is available
264
264
// for all Scala versions we support.
265
265
object amm extends Cross [Amm ](Scala .listMaxAmmoniteScalaVersion)
266
- trait Amm extends Cross .Module [String ] with CrossScalaModule with Bloop .Module {
266
+ trait Amm extends Cross .Module [String ] with CrossScalaModule with Bloop .Module {
267
267
def crossScalaVersion : String = crossValue
268
268
def skipBloop = true
269
269
def ivyDeps : Target [Agg [Dep ]] = {
@@ -276,27 +276,27 @@ object dummy extends Module {
276
276
object scalafmt extends ScalaModule with Bloop .Module {
277
277
def skipBloop = true
278
278
def scalaVersion : Target [String ] = Scala .defaultInternal
279
- def ivyDeps : Target [Agg [Dep ]] = Agg (
279
+ def ivyDeps : Target [Agg [Dep ]] = Agg (
280
280
Deps .scalafmtCli
281
281
)
282
282
}
283
283
object pythonInterface extends JavaModule with Bloop .Module {
284
- def skipBloop = true
284
+ def skipBloop = true
285
285
def ivyDeps : Target [Agg [Dep ]] = Agg (
286
286
Deps .pythonInterface
287
287
)
288
288
}
289
289
object scalaPy extends ScalaModule with Bloop .Module {
290
290
def skipBloop = true
291
291
def scalaVersion : Target [String ] = Scala .defaultInternal
292
- def ivyDeps : Target [Agg [Dep ]] = Agg (
292
+ def ivyDeps : Target [Agg [Dep ]] = Agg (
293
293
Deps .scalaPy
294
294
)
295
295
}
296
296
object scalafix extends ScalaModule with Bloop .Module {
297
297
def skipBloop = true
298
298
def scalaVersion : Target [String ] = Scala .defaultInternal
299
- def ivyDeps : Target [Agg [Dep ]] = Agg (
299
+ def ivyDeps : Target [Agg [Dep ]] = Agg (
300
300
Deps .scalafixInterfaces
301
301
)
302
302
}
@@ -306,7 +306,7 @@ trait BuildMacros extends ScalaCliCrossSbtModule
306
306
with ScalaCliPublishModule
307
307
with ScalaCliScalafixModule
308
308
with HasTests {
309
- def crossScalaVersion : String = crossValue
309
+ def crossScalaVersion : String = crossValue
310
310
def compileIvyDeps : Target [Agg [Dep ]] = Task {
311
311
if (crossScalaVersion.startsWith(" 3" )) super .compileIvyDeps()
312
312
else super .compileIvyDeps() ++ Agg (Deps .scalaReflect(crossScalaVersion))
@@ -326,7 +326,7 @@ trait BuildMacros extends ScalaCliCrossSbtModule
326
326
}
327
327
328
328
def testNegativeCompilation (): Command [Unit ] = Task .Command {
329
- val base = Task .workspace / " modules" / " build-macros" / " src"
329
+ val base = Task .workspace / " modules" / " build-macros" / " src"
330
330
val negativeTests = Seq (
331
331
" MismatchedLeft.scala" -> Seq (
332
332
" Found\\ : +EE1" .r,
@@ -338,7 +338,7 @@ trait BuildMacros extends ScalaCliCrossSbtModule
338
338
val cpsSource = base / " main" / " scala" / " scala" / " build" / " EitherCps.scala"
339
339
assert(os.exists(cpsSource))
340
340
341
- val sv = scalaVersion()
341
+ val sv = scalaVersion()
342
342
def compile (extraSources : os.Path * ): CommandResult =
343
343
os.proc(" scala-cli" , " compile" , " -S" , sv, cpsSource, extraSources).call(
344
344
check = false ,
@@ -434,8 +434,8 @@ trait Core extends ScalaCliCrossSbtModule
434
434
}
435
435
436
436
def constantsFile : Target [PathRef ] = Task (persistent = true ) {
437
- val dir = Task .dest / " constants"
438
- val dest = dir / " Constants.scala"
437
+ val dir = Task .dest / " constants"
438
+ val dest = dir / " Constants.scala"
439
439
val testRunnerMainClass = `test-runner`(Scala .runnerScala3)
440
440
.mainClass()
441
441
.getOrElse(sys.error(" No main class defined for test-runner" ))
@@ -579,7 +579,7 @@ trait Directives extends ScalaCliCrossSbtModule
579
579
with ScalaCliPublishModule
580
580
with HasTests
581
581
with ScalaCliScalafixModule {
582
- def crossScalaVersion : String = crossValue
582
+ def crossScalaVersion : String = crossValue
583
583
def moduleDeps : Seq [PublishModule ] = Seq (
584
584
options(crossScalaVersion),
585
585
core(crossScalaVersion),
@@ -643,7 +643,7 @@ trait Config extends ScalaCliCrossSbtModule
643
643
with ScalaCliScalafixModule {
644
644
def crossScalaVersion : String = crossValue
645
645
def moduleDeps : Seq [PublishModule ] = Seq (`specification-level`(crossScalaVersion))
646
- def ivyDeps : Target [Agg [Dep ]] = {
646
+ def ivyDeps : Target [Agg [Dep ]] = {
647
647
val maybeCollectionCompat =
648
648
if (crossScalaVersion.startsWith(" 2.12." )) Seq (Deps .collectionCompat)
649
649
else Nil
@@ -668,7 +668,7 @@ trait Config extends ScalaCliCrossSbtModule
668
668
669
669
trait Options extends ScalaCliCrossSbtModule with ScalaCliPublishModule with HasTests
670
670
with ScalaCliScalafixModule {
671
- def crossScalaVersion : String = crossValue
671
+ def crossScalaVersion : String = crossValue
672
672
def moduleDeps : Seq [PublishModule ] = Seq (
673
673
core(crossScalaVersion)
674
674
)
@@ -733,8 +733,8 @@ trait Build extends ScalaCliCrossSbtModule
733
733
with ScalaCliPublishModule
734
734
with HasTests
735
735
with ScalaCliScalafixModule {
736
- def crossScalaVersion : String = crossValue
737
- def millSourcePath : os.Path = super .millSourcePath / os.up / " build"
736
+ def crossScalaVersion : String = crossValue
737
+ def millSourcePath : os.Path = super .millSourcePath / os.up / " build"
738
738
def moduleDeps : Seq [PublishModule ] = Seq (
739
739
options(crossScalaVersion),
740
740
directives(crossScalaVersion),
@@ -815,9 +815,9 @@ trait Build extends ScalaCliCrossSbtModule
815
815
816
816
trait SpecificationLevel extends ScalaCliCrossSbtModule
817
817
with ScalaCliPublishModule {
818
- def crossScalaVersion : String = crossValue
818
+ def crossScalaVersion : String = crossValue
819
819
def scalacOptions : Target [Seq [String ]] = Task {
820
- val isScala213 = crossScalaVersion.startsWith(" 2.13." )
820
+ val isScala213 = crossScalaVersion.startsWith(" 2.13." )
821
821
val extraOptions =
822
822
if (isScala213) Seq (" -Xsource:3" )
823
823
else Nil
@@ -897,7 +897,7 @@ trait Cli extends CrossSbtModule with ProtoBuildModule with CliLaunchers
897
897
super .generatedSources() ++ Seq (constantsFile(), optionsConstantsFile())
898
898
899
899
def defaultFilesResources : Target [PathRef ] = Task (persistent = true ) {
900
- val dir = Task .dest / " resources"
900
+ val dir = Task .dest / " resources"
901
901
def transformWorkflow (content : Array [Byte ]): Array [Byte ] =
902
902
new String (content, " UTF-8" )
903
903
.replaceAll(" ./scala-cli" , " scala-cli" )
@@ -1040,8 +1040,8 @@ trait CliIntegration extends SbtModule with ScalaCliPublishModule with HasTests
1040
1040
)
1041
1041
1042
1042
def constantsFile : Target [PathRef ] = Task (persistent = true ) {
1043
- val dir = Task .dest / " constants"
1044
- val dest = dir / " Constants.scala"
1043
+ val dir = Task .dest / " constants"
1044
+ val dest = dir / " Constants.scala"
1045
1045
val mostlyStaticDockerfile =
1046
1046
Task .workspace / " .github" / " scripts" / " docker" / " ScalaCliSlimDockerFile"
1047
1047
assert(
@@ -1203,7 +1203,7 @@ trait CliIntegration extends SbtModule with ScalaCliPublishModule with HasTests
1203
1203
)
1204
1204
1205
1205
private def debugTestArgs (args : Seq [String ]): Seq [String ] = {
1206
- val debugReg = " ^--debug$|^--debug:([0-9]+)$" .r
1206
+ val debugReg = " ^--debug$|^--debug:([0-9]+)$" .r
1207
1207
val debugPortOpt = args.find(debugReg.matches).flatMap {
1208
1208
case debugReg(port) => Option (port).orElse(Some (" 5005" ))
1209
1209
case _ => None
@@ -1260,20 +1260,20 @@ trait CliIntegration extends SbtModule with ScalaCliPublishModule with HasTests
1260
1260
1261
1261
trait CliIntegrationDocker extends SbtModule with ScalaCliPublishModule with HasTests {
1262
1262
def scalaVersion : T [String ] = Scala .scala213
1263
- def ivyDeps : T [Agg [Dep ]] = super .ivyDeps() ++ Agg (
1263
+ def ivyDeps : T [Agg [Dep ]] = super .ivyDeps() ++ Agg (
1264
1264
Deps .osLib
1265
1265
)
1266
1266
}
1267
1267
1268
1268
trait Runner extends ScalaCliCrossSbtModule
1269
1269
with ScalaCliPublishModule
1270
1270
with ScalaCliScalafixLegacyModule {
1271
- def crossScalaVersion : String = crossValue
1271
+ def crossScalaVersion : String = crossValue
1272
1272
def scalacOptions : Target [Seq [String ]] = Task {
1273
1273
super .scalacOptions() ++ Seq (" -release" , " 8" )
1274
1274
}
1275
1275
def mainClass : Target [Option [String ]] = Some (" scala.cli.runner.Runner" )
1276
- def sources : Target [Seq [PathRef ]] = Task .Sources {
1276
+ def sources : Target [Seq [PathRef ]] = Task .Sources {
1277
1277
val scala3DirNames =
1278
1278
if (crossScalaVersion.startsWith(" 3." )) {
1279
1279
val name =
@@ -1291,7 +1291,7 @@ trait Runner extends ScalaCliCrossSbtModule
1291
1291
trait TestRunner extends ScalaCliCrossSbtModule
1292
1292
with ScalaCliPublishModule
1293
1293
with ScalaCliScalafixLegacyModule {
1294
- def crossScalaVersion : String = crossValue
1294
+ def crossScalaVersion : String = crossValue
1295
1295
def scalacOptions : Target [Seq [String ]] = Task {
1296
1296
super .scalacOptions() ++ Seq (" -release" , " 8" )
1297
1297
}
@@ -1306,7 +1306,7 @@ trait TestRunner extends ScalaCliCrossSbtModule
1306
1306
trait TastyLib extends ScalaCliCrossSbtModule
1307
1307
with ScalaCliPublishModule
1308
1308
with ScalaCliScalafixLegacyModule {
1309
- def crossScalaVersion : String = crossValue
1309
+ def crossScalaVersion : String = crossValue
1310
1310
def constantsFile : Target [PathRef ] = Task (persistent = true ) {
1311
1311
val dir = Task .dest / " constants"
1312
1312
val dest = dir / " Constants.scala"
@@ -1364,7 +1364,7 @@ def copyTo(task: mill.main.Tasks[PathRef], dest: String): Command[Unit] = Task.C
1364
1364
def writePackageVersionTo (dest : String ): Command [Unit ] = Task .Command {
1365
1365
val destPath = os.Path (dest, Task .workspace)
1366
1366
val rawVersion = cli(Scala .defaultInternal).publishVersion()
1367
- val version =
1367
+ val version =
1368
1368
if (rawVersion.contains(" +" )) rawVersion.stripSuffix(" -SNAPSHOT" )
1369
1369
else rawVersion
1370
1370
os.write.over(destPath, version)
@@ -1438,7 +1438,7 @@ def copyJvmBootstrappedLauncher(directory: String = "artifacts"): Command[Unit]
1438
1438
def uploadLaunchers (directory : String = " artifacts" ): Command [Unit ] = Task .Command {
1439
1439
val version = cli(Scala .defaultInternal).publishVersion()
1440
1440
1441
- val path = os.Path (directory, Task .workspace)
1441
+ val path = os.Path (directory, Task .workspace)
1442
1442
val launchers = os.list(path).filter(os.isFile(_)).map { path =>
1443
1443
path -> path.last
1444
1444
}
@@ -1561,8 +1561,8 @@ object ci extends Module {
1561
1561
gitClone(repo, branch, targetDir)
1562
1562
setupGithubRepo(mainDir)
1563
1563
1564
- val setupScript = os.read(setupScriptPath)
1565
- val scalaCliVersionRegex = " const scalaCLIVersion = '.*'" .r
1564
+ val setupScript = os.read(setupScriptPath)
1565
+ val scalaCliVersionRegex = " const scalaCLIVersion = '.*'" .r
1566
1566
val updatedSetupScriptPath =
1567
1567
scalaCliVersionRegex.replaceFirstIn(setupScript, s " const scalaCLIVersion = ' $version' " )
1568
1568
os.write.over(setupScriptPath, updatedSetupScriptPath)
@@ -1590,14 +1590,14 @@ object ci extends Module {
1590
1590
gitClone(repo, branch, targetDir)
1591
1591
setupGithubRepo(scalaCliDir)
1592
1592
1593
- val launcherScript = os.read(standaloneLauncherPath)
1594
- val scalaCliVersionRegex = " SCALA_CLI_VERSION=\" .*\" " .r
1593
+ val launcherScript = os.read(standaloneLauncherPath)
1594
+ val scalaCliVersionRegex = " SCALA_CLI_VERSION=\" .*\" " .r
1595
1595
val updatedLauncherScript =
1596
1596
scalaCliVersionRegex.replaceFirstIn(launcherScript, s """ SCALA_CLI_VERSION=" $version" """ )
1597
1597
os.write.over(standaloneLauncherPath, updatedLauncherScript)
1598
1598
1599
- val launcherWindowsScript = os.read(standaloneWindowsLauncherPath)
1600
- val scalaCliWindowsVersionRegex = " SCALA_CLI_VERSION=.*\" " .r
1599
+ val launcherWindowsScript = os.read(standaloneWindowsLauncherPath)
1600
+ val scalaCliWindowsVersionRegex = " SCALA_CLI_VERSION=.*\" " .r
1601
1601
val updatedWindowsLauncherScript =
1602
1602
scalaCliWindowsVersionRegex.replaceFirstIn(
1603
1603
launcherWindowsScript,
@@ -1744,8 +1744,8 @@ object ci extends Module {
1744
1744
gitClone(repo, branch, targetDir)
1745
1745
setupGithubRepo(packagesDir)
1746
1746
1747
- val installationScript = os.read(installationScriptPath)
1748
- val scalaCliVersionRegex = " SCALA_CLI_VERSION=\" .*\" " .r
1747
+ val installationScript = os.read(installationScriptPath)
1748
+ val scalaCliVersionRegex = " SCALA_CLI_VERSION=\" .*\" " .r
1749
1749
val updatedInstallationScript =
1750
1750
scalaCliVersionRegex.replaceFirstIn(installationScript, s """ SCALA_CLI_VERSION=" $version" """ )
1751
1751
os.write.over(installationScriptPath, updatedInstallationScript)
@@ -1923,8 +1923,8 @@ object ci extends Module {
1923
1923
distName : String = " vc_redist.x64.exe"
1924
1924
): Command [Unit ] =
1925
1925
Task .Command {
1926
- def vcVersions = Seq (" 2022" , " 2019" , " 2017" )
1927
- def vcEditions = Seq (" Enterprise" , " Community" , " BuildTools" )
1926
+ def vcVersions = Seq (" 2022" , " 2019" , " 2017" )
1927
+ def vcEditions = Seq (" Enterprise" , " Community" , " BuildTools" )
1928
1928
def candidateBaseDirs =
1929
1929
for {
1930
1930
vsBasePath <- vsBasePaths
@@ -1965,12 +1965,12 @@ object ci extends Module {
1965
1965
1966
1966
val vcVersions = Seq (" 2022" , " 2019" , " 2017" )
1967
1967
val vcEditions = Seq (" Enterprise" , " Community" , " BuildTools" )
1968
- val vsDirs = Seq (
1968
+ val vsDirs = Seq (
1969
1969
os.Path (""" C:\Program Files\Microsoft Visual Studio""" ),
1970
1970
os.Path (""" C:\Program Files (x86)\Microsoft Visual Studio""" )
1971
1971
)
1972
- val fileNamePrefix = " Microsoft_VC" .toLowerCase(Locale .ROOT )
1973
- val fileNameSuffix = " _CRT_x64.msm" .toLowerCase(Locale .ROOT )
1972
+ val fileNamePrefix = " Microsoft_VC" .toLowerCase(Locale .ROOT )
1973
+ val fileNameSuffix = " _CRT_x64.msm" .toLowerCase(Locale .ROOT )
1974
1974
def candidatesIt : Iterator [os.Path ] =
1975
1975
for {
1976
1976
vsDir <- vsDirs.iterator
@@ -2004,7 +2004,7 @@ object ci extends Module {
2004
2004
os.write.over(dest0, content.getBytes(Charset .defaultCharset()), createFolders = true )
2005
2005
}
2006
2006
def setShouldPublish (): Command [Unit ] = publish.setShouldPublish()
2007
- def shouldPublish (): Command [Unit ] = Task .Command {
2007
+ def shouldPublish (): Command [Unit ] = Task .Command {
2008
2008
println(publish.shouldPublish())
2009
2009
}
2010
2010
def copyJvm (jvm : String = deps.graalVmJvmId, dest : String = " jvm" ): Command [Path ] = Task .Command {
0 commit comments