Skip to content

Commit 0e76e5d

Browse files
committed
Add configuration to cache build
1 parent cc55158 commit 0e76e5d

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

.sbtopts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# read build from develocity cache
2+
-Ddevelocity.scan.metaBuild

project/build.sbt

+18
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,21 @@
22
libraryDependencies += "org.eclipse.jgit" % "org.eclipse.jgit" % "4.11.0.201803080745-r"
33

44
libraryDependencies += Dependencies.`jackson-databind`
5+
6+
// Configuration to publish build compilation to local and remote cache
7+
ThisBuild / develocityConfiguration := {
8+
val isInsideCI = insideCI.value
9+
val config = develocityConfiguration.value
10+
val buildScan = config.buildScan
11+
val buildCache = config.buildCache
12+
config
13+
.withProjectId(ProjectId("scala3-build"))
14+
.withServer(config.server.withUrl(Some(url("https://develocity.scala-lang.org"))))
15+
.withBuildScan(buildScan.withPublishing(Publishing.onlyIf(_ => false)))
16+
.withBuildCache(
17+
buildCache
18+
.withLocal(buildCache.local.withEnabled(true).withStoreEnabled(true))
19+
.withRemote(buildCache.remote.withEnabled(true).withStoreEnabled(isInsideCI))
20+
.withRequireClean(!isInsideCI) // always cache inside CI
21+
)
22+
}

project/project/plugins.sbt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resolvers += "Develocity Artifactory" at "https://repo.grdev.net/artifactory/public/"
2+
3+
addSbtPlugin("com.gradle" % "sbt-develocity" % "1.2-rc-2")

0 commit comments

Comments
 (0)