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

Ignore dependency order for injected implementations #6

Closed
jbaxleyiii opened this issue Sep 14, 2022 · 2 comments
Closed

Ignore dependency order for injected implementations #6

jbaxleyiii opened this issue Sep 14, 2022 · 2 comments
Labels

Comments

@jbaxleyiii
Copy link

When using a gradle plugin (internal or external such as detekt) it can sometimes inject implementations at the top of the list. These can 1) have a version and 2) aren't injected in the correct order so the version checking and order checking features of the analysis plugins don't really work.

Is there a way when doing the filtering (

val declaredInBuildFile = filter {
// Ignore Gradle internal dependency types - like gradleApi()
(it is ProjectDependency || it is ExternalModuleDependency) &&
// Ignore dependencies to another variant of the project itself - used by test fixtures
!(it is ProjectDependency && it.dependencyProject == project) &&
// Ignore the platform dependencies added in plugins
it.name != "platform"
}
) to ignore injected depedencies?

@jjohannes
Copy link
Owner

Yes - you already found the right place to handle such 'special cases'. There is no way, as far as I know, to identify such dependencies automatically. The plugins use the same Gradle API as the build scripts when adding a dependency. You would have to explicitly ignore those dependencies. For example by adding a condition like this:

&& !(it is ExternalModuleDependency && it.group == "org.jetbrains.kotlin" && it.name == "kotlin-stdlib")

@jjohannes
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants