Skip to content

Commit

Permalink
Add new IDE Debugging tag
Browse files Browse the repository at this point in the history
  • Loading branch information
rolgalan committed May 31, 2024
1 parent 661cc76 commit 259fc7a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/com/gradle/CustomBuildScanEnhancements.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ final class CustomBuildScanEnhancements {
private static final String PROJECT_PROP_ANDROID_STUDIO_VERSION = "android.studio.version";
private static final String SYSTEM_PROP_ECLIPSE_BUILD_ID = "eclipse.buildId";
private static final String SYSTEM_PROP_IDEA_SYNC_ACTIVE = "idea.sync.active";
private static final String SYSTEM_PROP_IDEA_DEBUGGER_PORT = "idea.debugger.dispatch.port";

private final DevelocityAdapter develocity;
private final BuildScanAdapter buildScan;
Expand Down Expand Up @@ -98,6 +99,7 @@ private void captureIde() {
ideProperties.put(PROJECT_PROP_ANDROID_STUDIO_VERSION, firstOrElseSecond(providers, gradlePropertyProvider(PROJECT_PROP_ANDROID_STUDIO_VERSION, gradle, providers), gradlePropertyProvider(PROJECT_PROP_ANDROID_STUDIO_VERSION_LEGACY, gradle, providers)));
ideProperties.put(SYSTEM_PROP_ECLIPSE_BUILD_ID, systemPropertyProvider(SYSTEM_PROP_ECLIPSE_BUILD_ID, providers));
ideProperties.put(SYSTEM_PROP_IDEA_SYNC_ACTIVE, systemPropertyProvider(SYSTEM_PROP_IDEA_SYNC_ACTIVE, providers));
ideProperties.put(SYSTEM_PROP_IDEA_DEBUGGER_PORT, systemPropertyProvider(SYSTEM_PROP_IDEA_DEBUGGER_PORT, providers));

// Process data at execution time to ensure property initialization
buildScan.buildFinished(new CaptureIdeMetadataAction(buildScan, ideProperties));
Expand Down Expand Up @@ -139,6 +141,10 @@ public void execute(BuildResultAdapter buildResult) {
if (props.get(SYSTEM_PROP_IDEA_SYNC_ACTIVE).isPresent()) {
buildScan.tag("IDE sync");
}

if (props.get(SYSTEM_PROP_IDEA_DEBUGGER_PORT).isPresent()) {
buildScan.tag("IDE debugging");
}
}

private String getOrEmpty(Provider<String> p) {
Expand Down

0 comments on commit 259fc7a

Please sign in to comment.