From 1cdb9a0117c3180eeade52955080868e37c2ba35 Mon Sep 17 00:00:00 2001 From: Ryan Brooks Date: Thu, 5 Oct 2023 16:50:10 -0700 Subject: [PATCH] Move local performance task to be registered on app module, add some debug logging (#76) --- .../kotlin/com/emergetools/android/gradle/EmergePlugin.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gradle-plugin/plugin/src/main/kotlin/com/emergetools/android/gradle/EmergePlugin.kt b/gradle-plugin/plugin/src/main/kotlin/com/emergetools/android/gradle/EmergePlugin.kt index 07b91a02..69dcfb98 100644 --- a/gradle-plugin/plugin/src/main/kotlin/com/emergetools/android/gradle/EmergePlugin.kt +++ b/gradle-plugin/plugin/src/main/kotlin/com/emergetools/android/gradle/EmergePlugin.kt @@ -58,6 +58,9 @@ class EmergePlugin : Plugin { val rootProject = appProject.rootProject val perfProjectPath = emergeExtension.perfOptions.projectPath val performanceProject = rootProject.subprojects.find { subProject -> + appProject.logger.debug( + "Checking subproject ${subProject.path} from rootProject ${rootProject.path}, resolving perfProjectPath: ${perfProjectPath.orNull}" + ) rootProject.absoluteProjectPath(subProject.path) == perfProjectPath.orNull } performanceProject?.let { perfProject -> @@ -233,7 +236,7 @@ class EmergePlugin : Plugin { val perfVariantName = performanceVariant.name.capitalize() val taskName = "emergeLocal${perfVariantName}Test" - val task = performanceProject.tasks.register(taskName, LocalPerfTest::class.java) { + val task = appProject.tasks.register(taskName, LocalPerfTest::class.java) { it.group = EMERGE_TASK_GROUP it.description = "Installs and runs tests for ${performanceVariant.name} on" + " connected devices. For testing and debugging."