Skip to content

Commit cfcf097

Browse files
committed
Include TeamCity build configuration as custom value and search link
Fixes #74
1 parent 3c1b5b9 commit cfcf097

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
All notable changes to this project will be documented in this file.
33

44
## [Unreleased]
5+
- Add TeamCity build configuration as a custom value and search link
6+
- Fix configuration-cache support
57

68
## [1.2] - 2021-03-03
79

src/main/java/com/gradle/CustomBuildScanEnhancements.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ private static void captureCiMetadata(BuildScanExtension buildScan, Gradle gradl
8181
Optional<String> teamCityConfigFile = projectProperty(gradle, "teamcity.configuration.properties.file");
8282
Optional<String> buildNumber = projectProperty(gradle, "build.number");
8383
Optional<String> buildTypeId = projectProperty(gradle, "teamcity.buildType.id");
84-
Optional<String> agentName = projectProperty(gradle, "agent.name");
8584
if (teamCityConfigFile.isPresent()
8685
&& buildNumber.isPresent()
8786
&& buildTypeId.isPresent()) {
@@ -94,9 +93,10 @@ private static void captureCiMetadata(BuildScanExtension buildScan, Gradle gradl
9493
}
9594
buildNumber.ifPresent(value ->
9695
buildScan.value("CI build number", value));
97-
agentName.ifPresent(value ->
96+
buildTypeId.ifPresent(value ->
97+
addCustomValueAndSearchLink(buildScan, "CI build config", value));
98+
projectProperty(gradle, "agent.name").ifPresent(value ->
9899
addCustomValueAndSearchLink(buildScan, "CI agent", value));
99-
100100
});
101101
}
102102

0 commit comments

Comments
 (0)