[go: nahoru, domu]

Only run tasks dumpDependencies and createDependencyVersions when 'publish = true'

Bug: b/126999060

Test: ./gradlew createDependencyGraph && grep "-benchmark" ../../out/host/gradle/frameworks/support/dependencyGraph/AndroidXDependencyGraph.json | wc -l | xargs echo "Benchmark Instances: "
Change-Id: Ia146f6736ae561957d0ffc93f86acf600aedf292
diff --git a/buildSrc/src/main/kotlin/androidx/build/AndroidXPlugin.kt b/buildSrc/src/main/kotlin/androidx/build/AndroidXPlugin.kt
index 1093ace..e52874a 100644
--- a/buildSrc/src/main/kotlin/androidx/build/AndroidXPlugin.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/AndroidXPlugin.kt
@@ -100,7 +100,10 @@
                     project.configureResourceApiChecks()
                     val verifyDependencyVersionsTask = project.createVerifyDependencyVersionsTask()
                     val checkNoWarningsTask = project.tasks.register(CHECK_NO_WARNINGS_TASK)
-                    project.createDumpDependenciesTask()
+                    // Only dump dependencies of published projects
+                    if (project.extra.has("publish")) {
+                        project.createDumpDependenciesTask()
+                    }
                     project.createCheckReleaseReadyTask(listOf(verifyDependencyVersionsTask,
                         checkNoWarningsTask))
                     extension.libraryVariants.all { libraryVariant ->