@@ -10,6 +10,7 @@ import complete.DefaultParsers._
10
10
import pl .project13 .scala .sbt .JmhPlugin
11
11
import pl .project13 .scala .sbt .JmhPlugin .JmhKeys .Jmh
12
12
import com .gradle .develocity .agent .sbt .DevelocityPlugin .autoImport ._
13
+ import com .gradle .develocity .agent .sbt .api .experimental .buildcache
13
14
import com .typesafe .sbt .packager .Keys ._
14
15
import com .typesafe .sbt .packager .MappingsHelper .directory
15
16
import com .typesafe .sbt .packager .universal .UniversalPlugin
@@ -339,24 +340,27 @@ object Build {
339
340
buildScan
340
341
.withPublishing(Publishing .onlyIf(_.authenticated))
341
342
.withBackgroundUpload(! isInsideCI)
342
- .tag (if (isInsideCI) " CI" else " Local" )
343
+ .withTag (if (isInsideCI) " CI" else " Local" )
343
344
.withLinks(buildScan.links ++ GithubEnv .develocityLinks)
344
345
.withValues(buildScan.values ++ GithubEnv .develocityValues)
345
346
.withObfuscation(buildScan.obfuscation.withIpAddresses(_.map(_ => " 0.0.0.0" )))
346
347
)
347
348
.withBuildCache(
348
349
buildCache
349
- .withLocal(buildCache.local.withEnabled(false ))
350
- .withRemote(buildCache.remote.withEnabled(false ))
350
+ .withLocal(buildCache.local.withEnabled(true ).withStoreEnabled( true ))
351
+ .withRemote(buildCache.remote.withEnabled(true ).withStoreEnabled(isInsideCI ))
351
352
)
352
- .withTestRetryConfiguration (
353
- config.testRetryConfiguration
353
+ .withTestRetry (
354
+ config.testRetry
354
355
.withFlakyTestPolicy(FlakyTestPolicy .Fail )
355
356
.withMaxRetries(if (isInsideCI) 1 else 0 )
356
357
.withMaxFailures(10 )
357
358
.withClassesFilter((className, _) => ! noRetryTestClasses.contains(className))
358
359
)
359
- }
360
+ },
361
+ // Deactivate Develocity's test caching because it caches all tests or nothing.
362
+ // Also at the moment, it does not take compilation files as inputs.
363
+ Test / develocityBuildCacheClient := None ,
360
364
)
361
365
362
366
// Settings shared globally (scoped in Global). Used in build.sbt
@@ -604,7 +608,10 @@ object Build {
604
608
assert(docScalaInstance.loaderCompilerOnly == base.loaderCompilerOnly)
605
609
docScalaInstance
606
610
},
607
- Compile / doc / scalacOptions ++= scalacOptionsDocSettings()
611
+ Compile / doc / scalacOptions ++= scalacOptionsDocSettings(),
612
+ // force recompilation of bootstrapped modules when the compiler changes
613
+ Compile / compile / buildcache.develocityTaskCacheKeyComponents +=
614
+ (`scala3-compiler` / Compile / compile / buildcache.develocityTaskCacheKey).taskValue
608
615
)
609
616
610
617
lazy val commonBenchmarkSettings = Seq (
@@ -1015,10 +1022,6 @@ object Build {
1015
1022
sjsSources
1016
1023
} (Set (scalaJSIRSourcesJar)).toSeq
1017
1024
}.taskValue,
1018
-
1019
- // Develocity's Build Cache does not work with our compilation tests
1020
- // at the moment: it does not take compilation files as inputs.
1021
- Test / develocityBuildCacheClient := None ,
1022
1025
)
1023
1026
1024
1027
def insertClasspathInArgs (args : List [String ], cp : String ): List [String ] = {
@@ -1117,7 +1120,7 @@ object Build {
1117
1120
libraryDependencies += " org.scala-lang" % " scala-library" % stdlibVersion,
1118
1121
(Compile / scalacOptions) ++= Seq (
1119
1122
// Needed so that the library sources are visible when `dotty.tools.dotc.core.Definitions#init` is called
1120
- " -sourcepath" , (Compile / sourceDirectories).value.map(_.getAbsolutePath ).distinct.mkString(File .pathSeparator),
1123
+ " -sourcepath" , (Compile / sourceDirectories).value.map(_.getCanonicalPath ).distinct.mkString(File .pathSeparator),
1121
1124
" -Yexplicit-nulls" ,
1122
1125
),
1123
1126
(Compile / doc / scalacOptions) ++= ScaladocConfigs .DefaultGenerationSettings .value.settings,
0 commit comments