gradle-dependencies-sorter
gradle-dependencies-sorter copied to clipboard
Feature request: silently-no-op on build files with no dependencies blocks
trafficstars
The following build file results in a parse error
import slack.gradle.Platforms
plugins {
alias(libs.plugins.slack.base)
`java-platform`
}
val catalogExtension =
extensions.findByType<VersionCatalogsExtension>() ?: error("Could not find any version catalogs!")
for (name in catalogExtension.catalogNames) {
val catalog = catalogExtension.named(name)
Platforms.applyFromCatalog(project, catalog)
}
This is the log file
INFO: Sorting build.gradle(.kts) scripts in the following paths: /Users/zacsweers/dev/slack/slack-android-ng/tooling/slack-platform/build.gradle.kts
INFO: It took 31 ms to find 1 build scripts.
WARN: Parsing error: /Users/zacsweers/dev/slack/slack-android-ng/tooling/slack-platform/build.gradle.kts
1: extraneous input 'project' expecting {<EOF>, DEPENDENCIES, 'file(', 'files(', 'buildscript', '{', '}', '(', ')', ''', '"', '=', ';', '\', UNICODE_LATIN, ID, DIGIT, WS}
INFO: Metrics:
Successful sorts: 0
Already sorted: 0
Parse errors: 1
Sort duration: 45 ms.
Thanks for the issue. Seems valid! PRs welcome.
I think this might already work? I have a test for empty build files.