Skip to content

Commit

Permalink
Fix the isolated project violation
Browse files Browse the repository at this point in the history
Dependency.group would be accessed which, for project dependencies, would cause an isolated project violation. Now project dependencies are filtered out.

This partially fixes google#4423
  • Loading branch information
ansman authored Jan 10, 2025
1 parent 347cfe1 commit 5ae1756
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.component.ProjectComponentIdentifier
import org.gradle.api.artifacts.ExternalDependency
import org.gradle.api.attributes.Attribute
import org.gradle.api.provider.ProviderFactory
import org.gradle.api.tasks.compile.JavaCompile
Expand Down Expand Up @@ -421,7 +422,9 @@ class HiltGradlePlugin @Inject constructor(private val providers: ProviderFactor
it.name.startsWith("hiltAnnotationProcessor") || it.name.startsWith("hiltCompileOnly")
}
.flatMap { configuration ->
configuration.dependencies.map { dependency -> dependency.group to dependency.name }
configuration.dependencies
.filterIsInstance<ExternalDependency>()
.map { dependency -> dependency.group to dependency.name }
}
.toSet()
fun getMissingDepMsg(depCoordinate: String): String =
Expand Down

0 comments on commit 5ae1756

Please sign in to comment.