@@ -6,6 +6,8 @@ import ScaladocGeneration._
6
6
import com .jsuereth .sbtpgp .PgpKeys
7
7
import sbt .Keys .*
8
8
import sbt .*
9
+ import sbt .nio .FileStamper
10
+ import sbt .nio .Keys .*
9
11
import complete .DefaultParsers ._
10
12
import pl .project13 .scala .sbt .JmhPlugin
11
13
import pl .project13 .scala .sbt .JmhPlugin .JmhKeys .Jmh
@@ -279,6 +281,8 @@ object Build {
279
281
280
282
val fetchScalaJSSource = taskKey[File ](" Fetch the sources of Scala.js" )
281
283
284
+ val extraDevelocityCacheInputFiles = taskKey[Seq [Path ]](" Extra input files for caching" )
285
+
282
286
lazy val SourceDeps = config(" sourcedeps" )
283
287
284
288
// Settings shared by the build (scoped in ThisBuild). Used in build.sbt
@@ -362,6 +366,8 @@ object Build {
362
366
// Deactivate Develocity's test caching because it caches all tests or nothing.
363
367
// Also at the moment, it does not take compilation files as inputs.
364
368
Test / develocityBuildCacheClient := None ,
369
+ extraDevelocityCacheInputFiles := Seq .empty,
370
+ extraDevelocityCacheInputFiles / outputFileStamper := FileStamper .Hash ,
365
371
)
366
372
367
373
// Settings shared globally (scoped in Global). Used in build.sbt
@@ -442,7 +448,17 @@ object Build {
442
448
Compile / packageBin / packageOptions +=
443
449
Package .ManifestAttributes (
444
450
" Automatic-Module-Name" -> s " ${dottyOrganization.replaceAll(" -" ," ." )}. ${moduleName.value.replaceAll(" -" ," ." )}"
445
- )
451
+ ),
452
+
453
+ // add extraDevelocityCacheInputFiles in cache key components
454
+ Compile / compile / buildcache.develocityTaskCacheKeyComponents +=
455
+ (Compile / extraDevelocityCacheInputFiles / outputFileStamps).taskValue,
456
+ Test / test / buildcache.develocityTaskCacheKeyComponents +=
457
+ (Test / extraDevelocityCacheInputFiles / outputFileStamps).taskValue,
458
+ Test / testOnly / buildcache.develocityInputTaskCacheKeyComponents +=
459
+ (Test / extraDevelocityCacheInputFiles / outputFileStamps).taskValue,
460
+ Test / testQuick / buildcache.develocityInputTaskCacheKeyComponents +=
461
+ (Test / extraDevelocityCacheInputFiles / outputFileStamps).taskValue
446
462
)
447
463
448
464
// Settings used for projects compiled only with Java
@@ -611,8 +627,8 @@ object Build {
611
627
},
612
628
Compile / doc / scalacOptions ++= scalacOptionsDocSettings(),
613
629
// force recompilation of bootstrapped modules when the compiler changes
614
- Compile / compile / buildcache.develocityTaskCacheKeyComponents +=
615
- (`scala3-compiler` / Compile / compile / buildcache.develocityTaskCacheKey).taskValue
630
+ Compile / extraDevelocityCacheInputFiles + +=
631
+ (`scala3-compiler` / Compile / fullClasspathAsJars).value.map(_.data.toPath)
616
632
)
617
633
618
634
lazy val commonBenchmarkSettings = Seq (
0 commit comments