Skip to content

Commit 08b93e3

Browse files
committed
Fix and extend CustomDevelocityConfig examples
1 parent 2366f45 commit 08b93e3

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

src/main/java/com/gradle/CustomDevelocityConfig.java

+28-5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ void configureDevelocity(DevelocityAdapter develocity) {
1616
develocity.setServer("https://enterprise-samples.gradle.com");
1717
develocity.setAllowUntrustedServer(false);
1818
19+
develocity.setProjectId("ccud-injection");
1920
*/
2021
}
2122

@@ -25,15 +26,37 @@ void configureBuildScanPublishing(BuildScanAdapter buildScan) {
2526
boolean isCiServer = System.getenv().containsKey("CI");
2627
2728
buildScan.publishAlways();
28-
buildScan.capture(capture -> capture.setTaskInputFiles(true));
2929
buildScan.setUploadInBackground(!isCiServer);
3030
31-
*/
31+
buildScan.tag("CUSTOM_TAG");
32+
buildScan.link("custom-link", "https://enterprise-samples.gradle.com/faq");
33+
buildScan.value("Custom Value Key", "Custom value");
34+
35+
buildScan.capture(capture -> {
36+
capture.setFileFingerprints(true);
37+
capture.setBuildLogging(false);
38+
capture.setTestLogging(false);
39+
});
40+
41+
buildScan.obfuscation(obfuscation -> {
42+
obfuscation.hostname(s -> "FIXED-HOSTNAME");
43+
obfuscation.username(s -> "FIXED-USERNAME");
44+
});
45+
46+
buildScan.background(adapter -> {
47+
adapter.tag("BACKGROUND_TAG");
48+
});
49+
50+
buildScan.buildFinished(adapter -> {
51+
buildScan.tag("BUILD_FINISHED_TAG");
52+
});
53+
54+
*/
3255
}
3356

3457
void configureBuildCache(BuildCacheConfigurationAdapter buildCache) {
35-
3658
/* Example of build cache configuration
59+
3760
boolean isCiServer = System.getenv().containsKey("CI");
3861
3962
// Enable the local build cache for all local and CI builds
@@ -43,9 +66,9 @@ void configureBuildCache(BuildCacheConfigurationAdapter buildCache) {
4366
// Only permit store operations to the remote build cache for CI builds
4467
// Local builds will only read from the remote build cache
4568
buildCache.getRemote().setEnabled(true);
46-
buildCache.getRemote().setStoreEnabled(isCiServer);
69+
buildCache.getRemote().setPush(isCiServer);
4770
48-
*/
71+
*/
4972
}
5073

5174
}

0 commit comments

Comments
 (0)