Skip to content

Commit

Permalink
Collecting Compiler Plugins now.
Browse files Browse the repository at this point in the history
  • Loading branch information
handstandsam committed May 15, 2024
1 parent fba11db commit 4827dfd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,14 @@ internal abstract class InvertCollectDependenciesTask : DefaultTask() {
monitoredConfigurationsMap.set(resolvedMonitoredConfigurationsMap)

val annotationProcessors = setOf("kapt", "ksp", "annotationProcessor")
val kotlinCompilerPlugins = setOf("kotlinCompilerPluginClasspath")

directDependencies.set(
project.configurations
.toSet()
.filter {
filteredConfigurationNames.contains(it.name)
|| annotationProcessors.contains(it.name)
|| kotlinCompilerPlugins.contains(it.name)
|| it.name.contains("kotlinCompilerPluginClasspath")
}
.associate { configuration ->
configuration.name to configuration.allDependencies.mapNotNull { dependency: Dependency ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,13 @@ fun KotlinCompilerPluginsComposable(
val configurationNameToDependencyIdAndGradlePaths =
mutableMapOf<ConfigurationName, MutableMap<DependencyId, MutableSet<GradlePath>>>()

val annotationProcessorConfigs = setOf("kotlinCompilerPluginClasspath")

allDirectDependencies.forEach { (gradlePath, configNameToDepIds) ->
configNameToDepIds.filterKeys { annotationProcessorConfigs.contains(it) }
configNameToDepIds
.filterKeys { it.contains("kotlinCompilerPluginClasspath") }
.forEach { (configName, dependencyIds) ->
println("THIS $configName")
//
val curr = configNameToAnnotationProcessorMap[configName] ?: mutableSetOf()
configNameToAnnotationProcessorMap[configName] = curr.apply { addAll(dependencyIds) }

// -----
dependencyIds.forEach { dependencyId ->
val currOne = configurationNameToDependencyIdAndGradlePaths[configName] ?: mutableMapOf()
currOne[dependencyId] = (currOne[dependencyId] ?: mutableSetOf()).apply { add(gradlePath) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,13 @@ fun ModuleDetailComposable(
}
return
}
H1 { Text("Direct Dependencies") }
BootstrapTabPane(tabs)

val tabs2 = mutableListOf<BootstrapTabData>()
val configurationToDependencyMap = configurationToDependencyMapCollected!!
configurationToDependencyMap.keys.forEach { configurationName ->
tabs.add(
tabs2.add(
BootstrapTabData("Transitive Dependencies for $configurationName") {
val rows = configurationToDependencyMap[configurationName]
?.filter { it.startsWith(":") }
Expand All @@ -149,13 +152,15 @@ fun ModuleDetailComposable(
}
)
}
tabs.add(BootstrapTabData("Module Used By...") {
H1 { Text("Transitive Dependencies") }
BootstrapTabPane(tabs2)
H1 { Text("Module Used By...") }
val moduleUsageCollected by reportDataRepo.moduleUsedBy(modulePath).collectAsState(null)
if (moduleUsageCollected == null) {
H1 {
BootstrapLoadingMessageWithSpinner("Loading Module Usage...")
}
return@BootstrapTabData
return
}
val moduleUsage = moduleUsageCollected!!
BootstrapTable(
Expand All @@ -171,6 +176,5 @@ fun ModuleDetailComposable(
)
}
)
})
BootstrapTabPane(tabs)

}

0 comments on commit 4827dfd

Please sign in to comment.