Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the isolated project violation #4571

Merged
merged 1 commit into from
Jan 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix the isolated project violation
`dependency.group` would be accessed which, for project dependencies, would cause an isolated project violation. Now project dependencies are filtered out.

This partially fixes #4423

Closes #4570

RELNOTES=Fix project isolation violation when checking that Hilt libraries are applied along the Gradle plugin.
PiperOrigin-RevId: 714428280
ansman authored and Dagger Team committed Jan 11, 2025
commit 91450da6a09845e86d92407dfda33b906a6c71bf
Original file line number Diff line number Diff line change
@@ -51,6 +51,7 @@ import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ExternalDependency
import org.gradle.api.artifacts.component.ProjectComponentIdentifier
import org.gradle.api.attributes.Attribute
import org.gradle.api.provider.ProviderFactory
@@ -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 =