Skip to content

Instantly share code, notes, and snippets.

@gabrielfeo
gabrielfeo / captureFingerprints.gradle
Last active March 13, 2025 18:52 — forked from ghale/captureFingerprints.gradle
Capture task classpath fingerprints in a configuration cache–compatible way
def fingerprinter = services.get(org.gradle.internal.fingerprint.classpath.ClasspathFingerprinter)
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { task ->
def objectFactory = task.project.objects
def buildScan = rootProject.buildScan
doFirst {
ClassLoader classLoader = task.getClass().classLoader
while (classLoader instanceof URLClassLoader) {
def fingerprints = [] as Set
def allFiles = [] as Set
classLoader.getURLs().each {
@gabrielfeo
gabrielfeo / cashapp_gradle_enterprise.gradle
Created January 22, 2025 16:02 — forked from jrodbx/cashapp_gradle_enterprise.gradle
Example Gradle Enterprise config
import groovy.json.JsonSlurper
import static java.nio.charset.Charset.defaultCharset
import static java.util.concurrent.TimeUnit.SECONDS
// Captures build and environment data and stores it in build scans via custom tags, links,
// and values, for one-off and trend analyses.
gradleEnterprise {
buildScan {