mikepenz / AboutLibraries

AboutLibraries automatically collects all dependencies and licenses of any gradle project (Kotlin MultiPlatform), and provides easy to integrate UI components for Android and Compose-jb environments
http://mikepenz.github.io/AboutLibraries/
Apache License 2.0
3.62k stars 419 forks source link

[Feature Request] Configure library name substitutions #1012

Closed dgmltn closed 3 weeks ago

dgmltn commented 4 weeks ago

Consider the attached library. I'd like it to display a better name. It would be nice to override the name with a custom name in my gradle config.

    {
      "artifactVersion": "1.3.2",
      "description": "Common Annotations for the JavaTM Platform API",
      "developers": [
        {
          "name": "Linda De Michiel"
        }
      ],
      "funding": [],
      "licenses": [
        "9be0c4d7964ad9a68deb2e9706266b8c"
      ],
      "name": "${extension.name} API",
      "organization": {
        "name": "GlassFish Community",
        "url": "https://javaee.github.io/glassfish"
      },
      "scm": {
        "connection": "scm:git:https://github.com/javaee/javax.annotation.git",
        "developerConnection": "scm:git:git@github.com:javaee/javax.annotation.git",
        "url": "https://github.com/javaee/javax.annotation"
      },
      "uniqueId": "javax.annotation:javax.annotation-api",
      "website": "http://jcp.org/en/jsr/detail?id=250"
    },

What if I could override the library name like:

aboutLibraries {
    nameOverrides = mapOf(
        "javax.annotation:javax.annotation-api" to "javax.annotation API"
    )
}
mikepenz commented 3 weeks ago

Good day.

While not possible directly in the gradle, it is possible to do this with config files you can provide. You can see this being done in the sample app:

That way you can provide new ones not detected, but also overwrite existing ones via their unique id:

dgmltn commented 3 weeks ago

That works for me, thanks!