gradle-dependencies-sorter

Introduction: A CLI app and Gradle plugin to sort the dependencies in your Gradle build scripts
More: Author   ReportBugs   
Tags:

This JVM CLI app and companion Gradle plugin can sort the dependencies of a build.gradle[.kts] script.

Usage

CLI

./path/to/sort <path(s) that contain build.gradle[.kts] scripts>

# for example, use this to sort the full repo
./path/to/sort .

# for example, use this to sort a sub-tree
./path/to/sort features

# for example, use this to sort a single file
./path/to/sort my/app/build.gradle[.kts]

# Check sort status
./path/to/sort -m check <paths as above>
./path/to/sort --mode check <paths as above>

Gradle plugin

Apply it

// build.gradle[.kts]
plugins {
  id("com.squareup.sort-dependencies") version "<<version>>"
}

Sort it

./gradlew :my:app:sortDependencies

# Identical to the above
./gradlew :my:app:sortDependencies --mode sort

Check it

./gradlew :my:app:sortDependencies --mode check

Test it

./gradlew check

Build it

Publish everything to maven local

./gradlew publishToMavenLocal

This will push all of this project's artifacts to ~/.m2/repository/.

Build zip distribution

./gradlew :app:shadowDistZip

This creates a zip file of the distribution at app/build/distributions/. This archive may be installed anywhere you like.

Install CLI app

./gradlew :app:installShadowDist

This will install the app to app/build/install/app-shadow/.

Pre-OSS Contributors

License

Copyright 2022 Square, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Apps
About Me
GitHub: Trinea
Facebook: Dev Tools