Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activate Develocity's Build Cache #22523

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
21 changes: 10 additions & 11 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -339,24 +339,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 @@ -1015,10 +1018,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 +1116,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