Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import complete.DefaultParsers._
import pl.project13.scala.sbt.JmhPlugin
import pl.project13.scala.sbt.JmhPlugin.JmhKeys.Jmh
import com.gradle.develocity.agent.sbt.DevelocityPlugin.autoImport._
import com.gradle.develocity.agent.sbt.api.experimental.buildcache
import com.typesafe.sbt.packager.Keys._
import com.typesafe.sbt.packager.MappingsHelper.directory
import com.typesafe.sbt.packager.universal.UniversalPlugin
Expand Down Expand Up @@ -339,24 +340,27 @@ object Build {
buildScan
.withPublishing(Publishing.onlyIf(_.authenticated))
.withBackgroundUpload(!isInsideCI)
.tag(if (isInsideCI) "CI" else "Local")
.withTag(if (isInsideCI) "CI" else "Local")
.withLinks(buildScan.links ++ GithubEnv.develocityLinks)
.withValues(buildScan.values ++ GithubEnv.develocityValues)
.withObfuscation(buildScan.obfuscation.withIpAddresses(_.map(_ => "0.0.0.0")))
)
.withBuildCache(
buildCache
.withLocal(buildCache.local.withEnabled(false))
.withRemote(buildCache.remote.withEnabled(false))
.withLocal(buildCache.local.withEnabled(true).withStoreEnabled(true))
.withRemote(buildCache.remote.withEnabled(true).withStoreEnabled(isInsideCI))
)
.withTestRetryConfiguration(
config.testRetryConfiguration
.withTestRetry(
config.testRetry
.withFlakyTestPolicy(FlakyTestPolicy.Fail)
.withMaxRetries(if (isInsideCI) 1 else 0)
.withMaxFailures(10)
.withClassesFilter((className, _) => !noRetryTestClasses.contains(className))
)
}
},
// Deactivate Develocity's test caching because it caches all tests or nothing.
// Also at the moment, it does not take compilation files as inputs.
Test / develocityBuildCacheClient := None,
)

// Settings shared globally (scoped in Global). Used in build.sbt
Expand Down Expand Up @@ -604,7 +608,10 @@ object Build {
assert(docScalaInstance.loaderCompilerOnly == base.loaderCompilerOnly)
docScalaInstance
},
Compile / doc / scalacOptions ++= scalacOptionsDocSettings()
Compile / doc / scalacOptions ++= scalacOptionsDocSettings(),
// force recompilation of bootstrapped modules when the compiler changes
Compile / compile / buildcache.develocityTaskCacheKeyComponents +=
(`scala3-compiler` / Compile / compile / buildcache.develocityTaskCacheKey).taskValue
)

lazy val commonBenchmarkSettings = Seq(
Expand Down Expand Up @@ -1015,10 +1022,6 @@ object Build {
sjsSources
} (Set(scalaJSIRSourcesJar)).toSeq
}.taskValue,

// Develocity's Build Cache does not work with our compilation tests
// at the moment: it does not take compilation files as inputs.
Test / develocityBuildCacheClient := None,
)

def insertClasspathInArgs(args: List[String], cp: String): List[String] = {
Expand Down Expand Up @@ -1117,7 +1120,7 @@ object Build {
libraryDependencies += "org.scala-lang" % "scala-library" % stdlibVersion,
(Compile / scalacOptions) ++= Seq(
// Needed so that the library sources are visible when `dotty.tools.dotc.core.Definitions#init` is called
"-sourcepath", (Compile / sourceDirectories).value.map(_.getAbsolutePath).distinct.mkString(File.pathSeparator),
"-sourcepath", (Compile / sourceDirectories).value.map(_.getCanonicalPath).distinct.mkString(File.pathSeparator),
"-Yexplicit-nulls",
),
(Compile / doc / scalacOptions) ++= ScaladocConfigs.DefaultGenerationSettings.value.settings,
Expand Down
7 changes: 6 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@ addSbtPlugin("ch.epfl.scala" % "sbt-tasty-mima" % "1.0.0")

addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.10.0")

addSbtPlugin("com.gradle" % "sbt-develocity" % "1.1.1")
addSbtPlugin("com.gradle" % "sbt-develocity" % "1.1.2")

resolvers +=
"Develocity Artifactory" at "https://repo.grdev.net/artifactory/public/"

addSbtPlugin("com.gradle" % "sbt-develocity" % "1.2-rc-2")
Loading