@@ -170,7 +170,8 @@ object dummy extends Module {
170
170
171
171
class BuildMacros (val crossScalaVersion : String ) extends ScalaCliCrossSbtModule
172
172
with ScalaCliPublishModule
173
- with ScalaCliScalafixModule {
173
+ with ScalaCliScalafixModule
174
+ with HasTests {
174
175
def scalacOptions = T {
175
176
super .scalacOptions() ++ Seq (" -Ywarn-unused" )
176
177
}
@@ -187,11 +188,6 @@ class BuildMacros(val crossScalaVersion: String) extends ScalaCliCrossSbtModule
187
188
def scalacOptions = T {
188
189
super .scalacOptions() ++ asyncScalacOptions(scalaVersion())
189
190
}
190
-
191
- def ivyDeps = super .ivyDeps() ++ Agg (
192
- Deps .munit
193
- )
194
- def testFramework = " munit.Framework"
195
191
}
196
192
}
197
193
@@ -324,6 +320,8 @@ class Core(val crossScalaVersion: String) extends BuildLikeModule {
324
320
|
325
321
| def defaultGraalVMJavaVersion = ${deps.graalVmJavaVersion}
326
322
| def defaultGraalVMVersion = " ${deps.graalVmVersion}"
323
+ |
324
+ | def scalaCliSigningVersion = " ${Deps .signingCli.dep.version}"
327
325
|}
328
326
| """ .stripMargin
329
327
if (! os.isFile(dest) || os.read(dest) != code)
@@ -398,14 +396,12 @@ class Options(val crossScalaVersion: String) extends BuildLikeModule {
398
396
super .scalacOptions() ++ asyncScalacOptions(scalaVersion())
399
397
}
400
398
401
- def ivyDeps = super .ivyDeps() ++ Agg (Deps .bloopConfig)
399
+ def ivyDeps = super .ivyDeps() ++ Agg (
400
+ Deps .bloopConfig,
401
+ Deps .signingCliShared
402
+ )
402
403
403
404
object test extends Tests {
404
- def ivyDeps = super .ivyDeps() ++ Agg (
405
- Deps .munit
406
- )
407
- def testFramework = " munit.Framework"
408
-
409
405
// uncomment below to debug tests in attach mode on 5005 port
410
406
// def forkArgs = T {
411
407
// super.forkArgs() ++ Seq("-agentlib:jdwp=transport=dt_socket,server=n,address=localhost:5005,suspend=y")
@@ -482,9 +478,15 @@ class Build(val crossScalaVersion: String) extends BuildLikeModule {
482
478
}
483
479
484
480
trait CliOptions extends SbtModule with ScalaCliPublishModule with settings.ScalaCliCompile {
485
- def ivyDeps =
486
- super .ivyDeps() ++ Agg (Deps .caseApp, Deps .jsoniterCore, Deps .jsoniterMacros, Deps .osLib)
481
+ def ivyDeps = super .ivyDeps() ++ Agg (
482
+ Deps .caseApp,
483
+ Deps .jsoniterCore,
484
+ Deps .jsoniterMacros,
485
+ Deps .osLib,
486
+ Deps .signingCliShared
487
+ )
487
488
def scalaVersion = Scala .defaultInternal
489
+ def repositories = super .repositories ++ customRepositories
488
490
}
489
491
490
492
trait Cli extends SbtModule with ProtoBuildModule with CliLaunchers
@@ -517,6 +519,7 @@ trait Cli extends SbtModule with ProtoBuildModule with CliLaunchers
517
519
Deps .jniUtils,
518
520
Deps .jsoniterCore,
519
521
Deps .scalaPackager,
522
+ Deps .signingCli,
520
523
Deps .metaconfigTypesafe
521
524
)
522
525
def compileIvyDeps = super .compileIvyDeps() ++ Agg (
@@ -551,15 +554,22 @@ trait CliIntegrationBase extends SbtModule with ScalaCliPublishModule with HasTe
551
554
super .scalacOptions() ++ Seq (" -Xasync" , " -Ywarn-unused" , " -deprecation" )
552
555
}
553
556
554
- def sources = T .sources {
557
+ def modulesPath = T {
555
558
val name = mainArtifactName().stripPrefix(prefix)
556
559
val baseIntegrationPath = os.Path (millSourcePath.toString.stripSuffix(name))
557
- val modulesPath = os.Path (
560
+ val p = os.Path (
558
561
baseIntegrationPath.toString.stripSuffix(baseIntegrationPath.baseName)
559
562
)
560
- val mainPath = PathRef (modulesPath / " integration" / " src" / " main" / " scala" )
563
+ PathRef (p)
564
+ }
565
+ def sources = T .sources {
566
+ val mainPath = PathRef (modulesPath().path / " integration" / " src" / " main" / " scala" )
561
567
super .sources() ++ Seq (mainPath)
562
568
}
569
+ def resources = T .sources {
570
+ val mainPath = PathRef (modulesPath().path / " integration" / " src" / " main" / " resources" )
571
+ super .resources() ++ Seq (mainPath)
572
+ }
563
573
564
574
def ivyDeps = super .ivyDeps() ++ Agg (
565
575
Deps .osLib
@@ -582,15 +592,23 @@ trait CliIntegrationBase extends SbtModule with ScalaCliPublishModule with HasTe
582
592
" SCALA_CLI_TMP" -> tmpDirBase().path.toString,
583
593
" CI" -> " 1"
584
594
)
595
+ private def updateRef (name : String , ref : PathRef ): PathRef = {
596
+ val rawPath = ref.path.toString.replace(
597
+ File .separator + name + File .separator,
598
+ File .separator
599
+ )
600
+ PathRef (os.Path (rawPath))
601
+ }
585
602
def sources = T .sources {
586
603
val name = mainArtifactName().stripPrefix(prefix)
587
604
super .sources().flatMap { ref =>
588
- val rawPath = ref.path.toString.replace(
589
- File .separator + name + File .separator,
590
- File .separator
591
- )
592
- val base = PathRef (os.Path (rawPath))
593
- Seq (base, ref)
605
+ Seq (updateRef(name, ref), ref)
606
+ }
607
+ }
608
+ def resources = T .sources {
609
+ val name = mainArtifactName().stripPrefix(prefix)
610
+ super .resources().flatMap { ref =>
611
+ Seq (updateRef(name, ref), ref)
594
612
}
595
613
}
596
614
0 commit comments