Skip to content

Commit ccbf2cc

Browse files
Gedochaotgodzik
andcommitted
Apply suggestions from code review
Co-authored-by: Tomasz Godzik <[email protected]>
1 parent a316831 commit ccbf2cc

File tree

7 files changed

+12
-145
lines changed

7 files changed

+12
-145
lines changed

build.mill.scala

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,8 @@ object integration extends CliIntegration {
151151
)
152152
}
153153
}
154-
@unused
154+
155155
object `docker-slim` extends CliIntegrationDocker {
156-
@unused
157156
object test extends ScalaCliTests {
158157
def sources: Target[Seq[PathRef]] = Task.Sources {
159158
integration.docker.test.sources()
@@ -170,7 +169,6 @@ object integration extends CliIntegration {
170169
}
171170
}
172171

173-
@unused
174172
object `docs-tests` extends Cross[DocsTests](Scala.scala3MainVersions)
175173
with CrossScalaDefaultToInternal
176174

@@ -239,7 +237,6 @@ object packager extends ScalaModule with Bloop.Module {
239237
def mainClass: Target[Option[String]] = Some("packager.cli.PackagerCli")
240238
}
241239

242-
@unused
243240
object `generate-reference-doc` extends Cross[GenerateReferenceDoc](Scala.scala3MainVersions)
244241
with CrossScalaDefaultToInternal
245242

@@ -261,12 +258,10 @@ trait GenerateReferenceDoc extends CrossSbtModule with ScalaCliScalafixModule {
261258
)
262259
}
263260

264-
@unused
265261
object dummy extends Module {
266262
// dummy projects to get scala steward updates for Ammonite and scalafmt, whose
267263
// versions are used in the fmt and repl commands, and ensure Ammonite is available
268264
// for all Scala versions we support.
269-
@unused
270265
object amm extends Cross[Amm](Scala.listMaxAmmoniteScalaVersion)
271266
trait Amm extends Cross.Module[String] with CrossScalaModule with Bloop.Module {
272267
def crossScalaVersion: String = crossValue
@@ -278,30 +273,26 @@ object dummy extends Module {
278273
Agg(ammoniteDep)
279274
}
280275
}
281-
@unused
282276
object scalafmt extends ScalaModule with Bloop.Module {
283277
def skipBloop = true
284278
def scalaVersion: Target[String] = Scala.defaultInternal
285279
def ivyDeps: Target[Agg[Dep]] = Agg(
286280
Deps.scalafmtCli
287281
)
288282
}
289-
@unused
290283
object pythonInterface extends JavaModule with Bloop.Module {
291284
def skipBloop = true
292285
def ivyDeps: Target[Agg[Dep]] = Agg(
293286
Deps.pythonInterface
294287
)
295288
}
296-
@unused
297289
object scalaPy extends ScalaModule with Bloop.Module {
298290
def skipBloop = true
299291
def scalaVersion: Target[String] = Scala.defaultInternal
300292
def ivyDeps: Target[Agg[Dep]] = Agg(
301293
Deps.scalaPy
302294
)
303295
}
304-
@unused
305296
object scalafix extends ScalaModule with Bloop.Module {
306297
def skipBloop = true
307298
def scalaVersion: Target[String] = Scala.defaultInternal
@@ -1353,7 +1344,6 @@ object `local-repo` extends LocalRepo {
13531344
}
13541345

13551346
// Helper CI commands
1356-
13571347
def publishSonatype(tasks: mill.main.Tasks[PublishModule.PublishData]) = Task.Command {
13581348
publish.publishSonatype(
13591349
data = define.Target.sequence(tasks.value)(),
@@ -1362,7 +1352,6 @@ def publishSonatype(tasks: mill.main.Tasks[PublishModule.PublishData]) = Task.Co
13621352
)
13631353
}
13641354

1365-
@unused
13661355
def copyTo(task: mill.main.Tasks[PathRef], dest: String): Command[Unit] = Task.Command {
13671356
val destPath = os.Path(dest, Task.workspace)
13681357
if (task.value.length > 1)
@@ -1372,7 +1361,6 @@ def copyTo(task: mill.main.Tasks[PathRef], dest: String): Command[Unit] = Task.C
13721361
os.copy.over(ref.path, destPath)
13731362
}
13741363

1375-
@unused
13761364
def writePackageVersionTo(dest: String): Command[Unit] = Task.Command {
13771365
val destPath = os.Path(dest, Task.workspace)
13781366
val rawVersion = cli(Scala.defaultInternal).publishVersion()
@@ -1382,7 +1370,6 @@ def writePackageVersionTo(dest: String): Command[Unit] = Task.Command {
13821370
os.write.over(destPath, version)
13831371
}
13841372

1385-
@unused
13861373
def writeShortPackageVersionTo(dest: String): Command[Unit] = Task.Command {
13871374
val destPath = os.Path(dest, Task.workspace)
13881375
val rawVersion = cli(Scala.defaultInternal).publishVersion()
@@ -1429,7 +1416,6 @@ def copyLauncher(directory: String = "artifacts"): Command[Path] = Task.Command
14291416
)
14301417
}
14311418

1432-
@unused
14331419
def copyJvmLauncher(directory: String = "artifacts"): Command[Unit] = Task.Command {
14341420
val launcher = cli(Scala.defaultInternal).standaloneLauncher().path
14351421
os.copy(
@@ -1439,7 +1425,6 @@ def copyJvmLauncher(directory: String = "artifacts"): Command[Unit] = Task.Comma
14391425
replaceExisting = true
14401426
)
14411427
}
1442-
@unused
14431428
def copyJvmBootstrappedLauncher(directory: String = "artifacts"): Command[Unit] = Task.Command {
14441429
val launcher = cliBootstrapped.jar().path
14451430
os.copy(
@@ -1450,7 +1435,6 @@ def copyJvmBootstrappedLauncher(directory: String = "artifacts"): Command[Unit]
14501435
)
14511436
}
14521437

1453-
@unused
14541438
def uploadLaunchers(directory: String = "artifacts"): Command[Unit] = Task.Command {
14551439
val version = cli(Scala.defaultInternal).publishVersion()
14561440

@@ -1467,7 +1451,6 @@ def uploadLaunchers(directory: String = "artifacts"): Command[Unit] = Task.Comma
14671451
)
14681452
}
14691453

1470-
@unused
14711454
def unitTests(): Command[(String, Seq[TestResult])] = Task.Command {
14721455
`build-module`(Scala.defaultInternal).test.test()()
14731456
`build-macros`(Scala.defaultInternal).test.test()()
@@ -1484,25 +1467,21 @@ def debug(port: Int, args: Task[Args] = Task.Anon(Args())) = Task.Command {
14841467
cli(Scala.defaultInternal).debug(port, args)()
14851468
}
14861469

1487-
@unused
14881470
def defaultNativeImage(): Command[PathRef] =
14891471
Task.Command {
14901472
cli(Scala.defaultInternal).nativeImage()
14911473
}
14921474

1493-
@unused
14941475
def nativeIntegrationTests(): Command[(String, Seq[TestResult])] =
14951476
Task.Command {
14961477
integration.test.native()()
14971478
}
14981479

1499-
@unused
15001480
def copyDefaultLauncher(directory: String = "artifacts"): Command[Path] =
15011481
Task.Command {
15021482
copyLauncher(directory)()
15031483
}
15041484

1505-
@unused
15061485
def copyMostlyStaticLauncher(directory: String = "artifacts"): Command[Path] = Task.Command {
15071486
val nativeLauncher = cli(Scala.defaultInternal).nativeImageMostlyStatic().path
15081487
Upload.copyLauncher0(
@@ -1515,7 +1494,6 @@ def copyMostlyStaticLauncher(directory: String = "artifacts"): Command[Path] = T
15151494
)
15161495
}
15171496

1518-
@unused
15191497
def copyStaticLauncher(directory: String = "artifacts"): Command[Path] = Task.Command {
15201498
val nativeLauncher = cli(Scala.defaultInternal).nativeImageStatic().path
15211499
Upload.copyLauncher0(
@@ -1559,13 +1537,10 @@ private def commitChanges(
15591537
}
15601538

15611539
// TODO Move most CI-specific tasks there
1562-
@unused
15631540
object ci extends Module {
1564-
@unused
15651541
def publishVersion(): Command[Unit] = Task.Command {
15661542
println(cli(Scala.defaultInternal).publishVersion())
15671543
}
1568-
@unused
15691544
def updateScalaCliSetup(): Command[Unit] = Task.Command {
15701545
val version = cli(Scala.defaultInternal).publishVersion()
15711546

@@ -1595,7 +1570,6 @@ object ci extends Module {
15951570
os.proc("git", "switch", "-c", targetBranch).call(cwd = mainDir)
15961571
commitChanges(s"Update scala-cli version to $version", targetBranch, mainDir, force = true)
15971572
}
1598-
@unused
15991573
def updateStandaloneLauncher(): Command[CommandResult] = Task.Command {
16001574
val version = cli(Scala.defaultInternal).publishVersion()
16011575

@@ -1665,7 +1639,6 @@ object ci extends Module {
16651639

16661640
(x86Sha256, arm64Sha256)
16671641
}
1668-
@unused
16691642
def updateScalaCliBrewFormula(): Command[Unit] = Task.Command {
16701643
val version = cli(Scala.defaultInternal).publishVersion()
16711644

@@ -1709,7 +1682,6 @@ object ci extends Module {
17091682

17101683
commitChanges(s"Update for $version", branch, homebrewFormulaDir)
17111684
}
1712-
@unused
17131685
def updateScalaExperimentalBrewFormula(): Command[Unit] = Task.Command {
17141686
val version = cli(Scala.defaultInternal).publishVersion()
17151687

@@ -1753,7 +1725,6 @@ object ci extends Module {
17531725

17541726
commitChanges(s"Update for $version", branch, homebrewFormulaDir)
17551727
}
1756-
@unused
17571728
def updateInstallationScript(): Command[Unit] = Task.Command {
17581729
val version = cli(Scala.defaultInternal).publishVersion()
17591730

@@ -1781,7 +1752,6 @@ object ci extends Module {
17811752

17821753
commitChanges(s"Update installation script for $version", branch, packagesDir)
17831754
}
1784-
@unused
17851755
def updateDebianPackages(): Command[Unit] = Task.Command {
17861756
val version = cli(Scala.defaultInternal).publishVersion()
17871757

@@ -1850,7 +1820,6 @@ object ci extends Module {
18501820

18511821
commitChanges(s"Update Debian packages for $version", branch, packagesDir)
18521822
}
1853-
@unused
18541823
def updateChocolateyPackage(): Command[CommandResult] = Task.Command {
18551824
val version = cli(Scala.defaultInternal).publishVersion()
18561825

@@ -1895,7 +1864,6 @@ object ci extends Module {
18951864
chocoKey
18961865
).call(cwd = chocoDir)
18971866
}
1898-
@unused
18991867
def updateCentOsPackages(): Command[Unit] = Task.Command {
19001868
val version = cli(Scala.defaultInternal).publishVersion()
19011869

@@ -1950,7 +1918,6 @@ object ci extends Module {
19501918
os.Path("C:\\Program Files\\Microsoft Visual Studio"),
19511919
os.Path("C:\\Program Files (x86)\\Microsoft Visual Studio")
19521920
)
1953-
@unused
19541921
def copyVcRedist(
19551922
directory: String = "artifacts",
19561923
distName: String = "vc_redist.x64.exe"
@@ -1992,7 +1959,6 @@ object ci extends Module {
19921959
val destDir = os.Path(directory, Task.workspace)
19931960
os.copy(orig, destDir / distName, createFolders = true, replaceExisting = true)
19941961
}
1995-
@unused
19961962
def writeWixConfigExtra(dest: String = "wix-visual-cpp-redist.xml"): Command[Unit] =
19971963
Task.Command {
19981964
val msmPath = {
@@ -2037,13 +2003,10 @@ object ci extends Module {
20372003
val dest0 = os.Path(dest, Task.workspace)
20382004
os.write.over(dest0, content.getBytes(Charset.defaultCharset()), createFolders = true)
20392005
}
2040-
@unused
20412006
def setShouldPublish(): Command[Unit] = publish.setShouldPublish()
2042-
@unused
20432007
def shouldPublish(): Command[Unit] = Task.Command {
20442008
println(publish.shouldPublish())
20452009
}
2046-
@unused
20472010
def copyJvm(jvm: String = deps.graalVmJvmId, dest: String = "jvm"): Command[Path] = Task.Command {
20482011
import sys.process._
20492012
val command = Seq(
@@ -2063,7 +2026,6 @@ object ci extends Module {
20632026
destJavaHome
20642027
}
20652028

2066-
@unused
20672029
def checkScalaVersions(): Command[Unit] = Task.Command {
20682030
website.checkMainScalaVersions(
20692031
Task.workspace / "website" / "docs" / "reference" / "scala-versions.md"

modules/cli/src/main/scala/scala/cli/exportCmd/MavenProjectDescriptor.scala

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ final case class MavenProjectDescriptor(
3232
logger: Logger
3333
) extends ProjectDescriptor {
3434

35-
System.lineSeparator()
36-
3735
private def sources(sourcesMain: Sources, sourcesTest: Sources): MavenProject = {
3836
val mainSources = ProjectDescriptor.sources(sourcesMain)
3937
val testSources = ProjectDescriptor.sources(sourcesTest)
@@ -124,7 +122,6 @@ final case class MavenProjectDescriptor(
124122
testDeps: ShadowingSeq[Positioned[AnyDependency]],
125123
isCompileOnly: Boolean
126124
): Seq[MavenLibraryDependency] = {
127-
List()
128125
val mainDependenciesMaven = buildMavenDepModels(mainDeps, isCompileOnly)
129126
val testDependenciesMaven = buildMavenDepModels(testDeps, isCompileOnly)
130127
val resolvedDeps = (mainDependenciesMaven ++ testDependenciesMaven).groupBy(k =>
@@ -176,8 +173,6 @@ final case class MavenProjectDescriptor(
176173

177174
val javacOptions = javacOptionsSettings(options)
178175

179-
javaOptionsSettings(options)
180-
181176
val mavenJavaPlugin = buildJavaCompilerPlugin(javacOptions, jdkVersion)
182177
val mavenExecPlugin = buildJavaExecPlugin(javacOptions, jdkVersion)
183178
val scalaPlugin = buildScalaPlugin(javacOptions, jdkVersion, getScalaVersion(options))
@@ -195,17 +190,6 @@ final case class MavenProjectDescriptor(
195190
jdkVersion: String,
196191
scalaVersion: String
197192
): MavenPlugin = {
198-
199-
buildNode("scalaVersion", scalaVersion)
200-
locally {
201-
val opts = javacOptions.map { opt =>
202-
buildNode("javacArg", opt)
203-
}
204-
<javacArgs>
205-
{opts}
206-
</javacArgs>
207-
}
208-
209193
val execElements =
210194
<executions>
211195
<execution>

0 commit comments

Comments
 (0)