Skip to content

Commit

Permalink
Chore: Build Caching (#211)
Browse files Browse the repository at this point in the history
![Ready for
review](https://badgen.net/badge/Status/Ready%20for%20review/green)<!--
PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->

Sets up build caching to work efficiently.
  • Loading branch information
sgammon authored Apr 2, 2023
2 parents 91800db + ceaf852 commit 132596e
Show file tree
Hide file tree
Showing 11 changed files with 124 additions and 1 deletion.
14 changes: 14 additions & 0 deletions packages/cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -455,3 +455,17 @@ configurations.all {
.using(module("net.java.dev.jna:jna:${libs.versions.jna.get()}"))
}
}

afterEvaluate {
listOf(
"buildLayers",
"optimizedBuildLayers",
"optimizedJitJarAll",
"shadowJar",
).forEach {
tasks.named(it).configure {
doNotTrackState("too big for build cache")
}
}
}

11 changes: 11 additions & 0 deletions packages/ssg/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,14 @@ graalvmNative {
}
}
}

afterEvaluate {
listOf(
"buildLayers",
"optimizedBuildLayers",
).forEach {
tasks.named(it).configure {
doNotTrackState("too big for build cache")
}
}
}
12 changes: 12 additions & 0 deletions samples/fullstack/basic/server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,15 @@ tasks.named<com.bmuschko.gradle.docker.tasks.image.DockerBuildImage>("optimizedD
"${project.properties["elide.publish.repo.docker.samples"]}/fullstack/basic/native:opt-latest"
))
}

afterEvaluate {
listOf(
"buildLayers",
"optimizedBuildLayers",
).forEach {
tasks.named(it).configure {
doNotTrackState("too big for build cache")
}
}
}

12 changes: 12 additions & 0 deletions samples/fullstack/react-ssr/server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,15 @@ graalvmNative {
}
}
}

afterEvaluate {
listOf(
"buildLayers",
"optimizedBuildLayers",
).forEach {
tasks.named(it).configure {
doNotTrackState("too big for build cache")
}
}
}

12 changes: 12 additions & 0 deletions samples/fullstack/react/server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,15 @@ tasks.named<com.bmuschko.gradle.docker.tasks.image.DockerBuildImage>("optimizedD
"${project.properties["elide.publish.repo.docker.samples"]}/fullstack/react/native:opt-latest"
))
}

afterEvaluate {
listOf(
"buildLayers",
"optimizedBuildLayers",
).forEach {
tasks.named(it).configure {
doNotTrackState("too big for build cache")
}
}
}

12 changes: 12 additions & 0 deletions samples/fullstack/ssr/server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,15 @@ tasks.named<com.bmuschko.gradle.docker.tasks.image.DockerBuildImage>("optimizedD
"${project.properties["elide.publish.repo.docker.samples"]}/fullstack/ssr/native:opt-latest"
))
}

afterEvaluate {
listOf(
"buildLayers",
"optimizedBuildLayers",
).forEach {
tasks.named(it).configure {
doNotTrackState("too big for build cache")
}
}
}

12 changes: 12 additions & 0 deletions samples/server/hellocss/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,15 @@ tasks.named<com.bmuschko.gradle.docker.tasks.image.DockerBuildImage>("optimizedD
"${project.properties["elide.publish.repo.docker.samples"]}/server/hellocss/native:opt-latest"
))
}

afterEvaluate {
listOf(
"buildLayers",
"optimizedBuildLayers",
).forEach {
tasks.named(it).configure {
doNotTrackState("too big for build cache")
}
}
}

12 changes: 12 additions & 0 deletions samples/server/helloworld/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,15 @@ tasks.named<com.bmuschko.gradle.docker.tasks.image.DockerBuildImage>("optimizedD
"${project.properties["elide.publish.repo.docker.samples"]}/server/helloworld/native:opt-latest"
))
}

afterEvaluate {
listOf(
"buildLayers",
"optimizedBuildLayers",
).forEach {
tasks.named(it).configure {
doNotTrackState("too big for build cache")
}
}
}

3 changes: 2 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ buildCache {
remote<HttpBuildCache> {
isEnabled = true
isPush = (cachePush ?: System.getenv("GRADLE_CACHE_PUSH")) == "true"
url = uri("https://buildcache.dyme.cloud/gradle/cache/")
isUseExpectContinue = true
url = uri(System.getenv("CACHE_ENDPOINT") ?: "https://global.less.build/cache/generic/")
credentials {
username = cacheUsername ?: System.getenv("GRADLE_CACHE_USERNAME") ?: error("Failed to resolve cache username")
password = cachePassword ?: System.getenv("GRADLE_CACHE_PASSWORD") ?: error("Failed to resolve cache password")
Expand Down
11 changes: 11 additions & 0 deletions site/docs/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -412,3 +412,14 @@ configurations.all {
.using(module("io.micronaut.serde:micronaut-serde-jackson:${libs.versions.micronaut.serde.get()}"))
}
}

afterEvaluate {
listOf(
"buildLayers",
"optimizedBuildLayers",
).forEach {
tasks.named(it).configure {
doNotTrackState("too big for build cache")
}
}
}
14 changes: 14 additions & 0 deletions tools/bundler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -454,3 +454,17 @@ configurations.all {
.using(module("net.java.dev.jna:jna:${libs.versions.jna.get()}"))
}
}

afterEvaluate {
listOf(
"buildLayers",
"optimizedBuildLayers",
"shadowJar",
"optimizedJitJarAll",
).forEach {
tasks.named(it).configure {
doNotTrackState("too big for build cache")
}
}
}

0 comments on commit 132596e

Please sign in to comment.