gradle-dependencies-sorter icon indicating copy to clipboard operation
gradle-dependencies-sorter copied to clipboard

Feature request: support dependency configuration syntax

Open ZacSweers opened this issue 2 years ago • 2 comments
trafficstars

Some dependences can include a trailing lambda to further configure the dependency

implementation(libs.someExternalSdk) {
  artifact {
    name = "some-external-sdk"
    type = "aar"
  }
}

ZacSweers avatar Feb 07 '23 04:02 ZacSweers

Is this a feature request or a bug? I thought the grammar could already handle trailing lambas? For example, I think we have a test verifying that it supports { because 'reason' }.

autonomousapps avatar Jul 17 '23 04:07 autonomousapps

@autonomousapps one example where sorting currently produces invalid code:

 dependencies {
-    apiImplementation project(":Utils")
-
     implementation(project(":MyProject")) {
         capabilities {
             requireCapability("com.my.lib:api")
         }
-    }
+
+    apiImplementation project(":Utils")
+}
     runtimeOnly project(":OtherProject")

technoir42 avatar Aug 17 '23 16:08 technoir42