1414 * limitations under the License.
1515 */
1616
17- package com.rubensousa.projectguard.plugin.internal.report
17+ package com.rubensousa.projectguard.plugin.internal
1818
19- import com.rubensousa.projectguard.plugin.internal.DependencyGraph
19+ import com.rubensousa.projectguard.plugin.internal.report.DependencyGraphDump
2020import org.gradle.api.Project
2121import org.gradle.api.artifacts.ExternalModuleDependency
2222import org.gradle.api.artifacts.ProjectDependency
@@ -50,7 +50,7 @@ internal class DependencyGraphBuilder {
5050
5151 fun buildFromProject (project : Project ): List <DependencyGraph > {
5252 return project.configurations
53- .filter { config -> config.isCanBeResolved && isConfigurationSupported(config.name) }
53+ .filter { config -> config.isCanBeResolved && DependencyConfiguration . isConfigurationSupported(config.name) }
5454 .map { config ->
5555 val graph = DependencyGraph (
5656 configurationId = config.name,
@@ -69,45 +69,14 @@ internal class DependencyGraphBuilder {
6969 }
7070
7171 is ExternalModuleDependency -> {
72- if (dependency.group == null ) {
73- // Java/Kotlin libraries provided to android modules are treated as external modules
74- // TODO: Improve detection
75- graph.addInternalDependency(
76- module = moduleId,
77- dependency = " :${dependency.name} :${dependency.versionConstraint.displayName} "
78- )
79- } else {
80- graph.addExternalDependency(
81- module = moduleId,
82- dependency = " ${dependency.group} :${dependency.name} " ,
83- )
84- }
72+ graph.addExternalDependency(
73+ module = moduleId,
74+ dependency = " ${dependency.group} :${dependency.name} " ,
75+ )
8576 }
8677 }
8778 }
8879 graph
8980 }
9081 }
91-
92-
93- companion object {
94- private val supportedConfigurations = mutableSetOf (
95- " androidTestUtil" ,
96- " compileClasspath" ,
97- " testCompileClasspath" ,
98- " testFixturesCompileClasspath" ,
99- )
100-
101- fun isConfigurationSupported (configurationId : String ): Boolean {
102- return supportedConfigurations.any { pattern ->
103- configurationId.lowercase().contains(pattern.lowercase())
104- }
105- }
106-
107- fun isReleaseConfiguration (configurationId : String ): Boolean {
108- return configurationId == " compileClasspath"
109- || configurationId.lowercase().contains(" releasecompileclasspath" )
110- }
111- }
112-
113- }
82+ }
0 commit comments