From 259fc7a751e815cfe1f993697f04633da81a6340 Mon Sep 17 00:00:00 2001 From: rolgalan Date: Fri, 31 May 2024 15:02:42 +0200 Subject: [PATCH] Add new IDE Debugging tag --- src/main/java/com/gradle/CustomBuildScanEnhancements.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/gradle/CustomBuildScanEnhancements.java b/src/main/java/com/gradle/CustomBuildScanEnhancements.java index 873bb13c..33065ec9 100644 --- a/src/main/java/com/gradle/CustomBuildScanEnhancements.java +++ b/src/main/java/com/gradle/CustomBuildScanEnhancements.java @@ -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; @@ -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)); @@ -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 p) {