-
Notifications
You must be signed in to change notification settings - Fork 20
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
Misc dependency rake improvements #444
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I make a comment about the lack of tests? :D
To run dependency rake in a project, use the below command | ||
|
||
```bash | ||
$ ./gradlew rakeDependencies -Pslack.gradle.config.enableAnalysisPlugin=true --no-configuration-cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--no-configuration-cache
so sad, I should fix that.
|
||
Sometimes dependency rake will try to replace identifiers with ones that are not present in any available | ||
version catalogs. Sometimes this is acceptable, but often times it can result in "missing" dependencies from | ||
the build after it runs. To help fix these, DR will write all missing identifiers out to a build output file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about this, can you elaborate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically we have a lot of transitive deps that DAGP offers as "add" advice but don't exist in our version catalogs, so this is intended to help make setting those up easier
@@ -129,7 +143,7 @@ constructor(objects: ObjectFactory, providers: ProviderFactory) : AbstractPostPr | |||
advices | |||
.filter { it.isRemove() } | |||
.filterNot { it.coordinates.identifier in MANAGED_DEPENDENCIES } | |||
.associateBy { it.toDependencyString("UNUSED") } | |||
.associateBy { it.toDependencyString("UNUSED", missingIdentifiers) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also just curious about these magic strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just debug logging!
@@ -110,16 +117,23 @@ constructor(objects: ObjectFactory, providers: ProviderFactory) : AbstractPostPr | |||
val redundantPlugins = projectAdvice.pluginAdvice | |||
val advices: Set<Advice> = projectAdvice.dependencyAdvice | |||
val buildFile = buildFileProperty.asFile.get() | |||
val missingIdentifiers = mutableSetOf<String>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing identifiers just means missing from your version catalog, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup!
See individual commits!