MR3Y
04/04/2024, 9:50 PMpluginManager.withPlugin()
/ hasPlugin()
but for dependencies.Vampire
04/04/2024, 9:53 PMMR3Y
04/04/2024, 9:56 PMandroidx.compose.material3.ExperimentalMaterial3Api is unresolved. Please make sure it's present in the module dependencies
it is not a major issue as a I said it is just a warning but I wanted to ask if there is something I can use for this.MR3Y
04/04/2024, 9:59 PMval configurationName = "implementation"
val dependencyGroupId = "com.example"
val dependencyArtifactId = "my-library"
val matchingConfiguration = project.configurations.findByName(configurationName)
if (matchingConfiguration != null) {
val foundDependency = matchingConfiguration.artifacts.find {
it.group == dependencyGroupId && it.name == dependencyArtifactId
}
if (foundDependency != null) {
println("Dependency '${dependencyGroupId}:${dependencyArtifactId}' exists in configuration '${configurationName}'")
} else {
println("Dependency '${dependencyGroupId}:${dependencyArtifactId}' not found in configuration '${configurationName}'")
}
} else {
println("Configuration '${configurationName}' not found")
}
Is something like this is fine? haven't tested it thoughVampire
04/04/2024, 10:05 PMVampire
04/04/2024, 10:05 PMMR3Y
04/04/2024, 10:06 PMVampire
04/04/2024, 10:06 PMConfiguration#withDependencies
is your friendVampire
04/04/2024, 10:07 PMVampire
04/04/2024, 10:07 PMimplementation
but on resolvable configurations, for example runtimeClasspath
or compileClasspath
MR3Y
04/04/2024, 10:09 PMimplementation
) because I'm interested in those? or there can't be because I'm misunderstanding something?Vampire
04/04/2024, 10:14 PMVampire
04/04/2024, 10:15 PMimplementation
MR3Y
04/04/2024, 10:25 PM