Skip to content

Commit 920df3b

Browse files
Merge pull request #748 from alexarchambault/publish
Add support for signing in publish command
2 parents 1e98bf5 + 11b0ec7 commit 920df3b

File tree

57 files changed

+1203
-249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1203
-249
lines changed

build.sc

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ object dummy extends Module {
170170

171171
class BuildMacros(val crossScalaVersion: String) extends ScalaCliCrossSbtModule
172172
with ScalaCliPublishModule
173-
with ScalaCliScalafixModule {
173+
with ScalaCliScalafixModule
174+
with HasTests {
174175
def scalacOptions = T {
175176
super.scalacOptions() ++ Seq("-Ywarn-unused")
176177
}
@@ -187,11 +188,6 @@ class BuildMacros(val crossScalaVersion: String) extends ScalaCliCrossSbtModule
187188
def scalacOptions = T {
188189
super.scalacOptions() ++ asyncScalacOptions(scalaVersion())
189190
}
190-
191-
def ivyDeps = super.ivyDeps() ++ Agg(
192-
Deps.munit
193-
)
194-
def testFramework = "munit.Framework"
195191
}
196192
}
197193

@@ -324,6 +320,8 @@ class Core(val crossScalaVersion: String) extends BuildLikeModule {
324320
|
325321
| def defaultGraalVMJavaVersion = ${deps.graalVmJavaVersion}
326322
| def defaultGraalVMVersion = "${deps.graalVmVersion}"
323+
|
324+
| def scalaCliSigningVersion = "${Deps.signingCli.dep.version}"
327325
|}
328326
|""".stripMargin
329327
if (!os.isFile(dest) || os.read(dest) != code)
@@ -398,14 +396,12 @@ class Options(val crossScalaVersion: String) extends BuildLikeModule {
398396
super.scalacOptions() ++ asyncScalacOptions(scalaVersion())
399397
}
400398

401-
def ivyDeps = super.ivyDeps() ++ Agg(Deps.bloopConfig)
399+
def ivyDeps = super.ivyDeps() ++ Agg(
400+
Deps.bloopConfig,
401+
Deps.signingCliShared
402+
)
402403

403404
object test extends Tests {
404-
def ivyDeps = super.ivyDeps() ++ Agg(
405-
Deps.munit
406-
)
407-
def testFramework = "munit.Framework"
408-
409405
// uncomment below to debug tests in attach mode on 5005 port
410406
// def forkArgs = T {
411407
// 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 {
482478
}
483479

484480
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+
)
487488
def scalaVersion = Scala.defaultInternal
489+
def repositories = super.repositories ++ customRepositories
488490
}
489491

490492
trait Cli extends SbtModule with ProtoBuildModule with CliLaunchers
@@ -517,6 +519,7 @@ trait Cli extends SbtModule with ProtoBuildModule with CliLaunchers
517519
Deps.jniUtils,
518520
Deps.jsoniterCore,
519521
Deps.scalaPackager,
522+
Deps.signingCli,
520523
Deps.metaconfigTypesafe
521524
)
522525
def compileIvyDeps = super.compileIvyDeps() ++ Agg(
@@ -551,15 +554,22 @@ trait CliIntegrationBase extends SbtModule with ScalaCliPublishModule with HasTe
551554
super.scalacOptions() ++ Seq("-Xasync", "-Ywarn-unused", "-deprecation")
552555
}
553556

554-
def sources = T.sources {
557+
def modulesPath = T {
555558
val name = mainArtifactName().stripPrefix(prefix)
556559
val baseIntegrationPath = os.Path(millSourcePath.toString.stripSuffix(name))
557-
val modulesPath = os.Path(
560+
val p = os.Path(
558561
baseIntegrationPath.toString.stripSuffix(baseIntegrationPath.baseName)
559562
)
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")
561567
super.sources() ++ Seq(mainPath)
562568
}
569+
def resources = T.sources {
570+
val mainPath = PathRef(modulesPath().path / "integration" / "src" / "main" / "resources")
571+
super.resources() ++ Seq(mainPath)
572+
}
563573

564574
def ivyDeps = super.ivyDeps() ++ Agg(
565575
Deps.osLib
@@ -582,15 +592,23 @@ trait CliIntegrationBase extends SbtModule with ScalaCliPublishModule with HasTe
582592
"SCALA_CLI_TMP" -> tmpDirBase().path.toString,
583593
"CI" -> "1"
584594
)
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+
}
585602
def sources = T.sources {
586603
val name = mainArtifactName().stripPrefix(prefix)
587604
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)
594612
}
595613
}
596614

0 commit comments

Comments
 (0)