square / gradle-dependencies-sorter

A CLI app and Gradle plugin to sort the dependencies in your Gradle build scripts
Apache License 2.0
261 stars 12 forks source link

Add support for build scripts that are renamed from build.gradle #111

Open changusmc opened 3 months ago

changusmc commented 3 months ago

Hey! Our devs were asking for exactly something like this and I was happy to see it already exists. However, this currently doesn't work for us because we rename all of our build.gradle files to contain the module name e.g. featureBoards.gradle.

This check https://github.com/square/gradle-dependencies-sorter/blob/7496c0a0281bcc61aac8c84db2c80de982efbe20/app/src/main/kotlin/com/squareup/sort/BuildDotGradleFinder.kt could be updated to return filename.endsWith(".gradle") || filename == "build.gradle.kts" and it would work for us.

Locally, I made that change and ran it for our codebase and it only updated our script files. It didn't touch any of our utility or settings files.

If you are willing to consider this change, I'd be happy to put up a PR and update any tests.

autonomousapps commented 1 month ago

Thanks for the issue! We're open to such an enhancement. If you're concerned about whether a PR will be accepted, please post your design ideas here before writing the code 👍