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

How to add a custom license entry in aboutlibraries-compose #687

Closed fuomag9 closed 2 years ago

fuomag9 commented 2 years ago

About this issue

Can anybody guide me on how to add a custom entry in aboutlibraries-compose? The current examples are not very clear and they do not seem to work

For example, where would I need to put this?

<resources>
    <!-- identifier used to reference this library -->
    <string name="define_plu_myLibrary">year;owner</string>
    <string name="library_myLibrary_author">Author</string>
    <string name="library_myLibrary_authorWebsite">https://mikepenz.dev</string>
    <string name="library_myLibrary_libraryName">My Library</string>
    <string name="library_myLibrary_libraryDescription">Some text</string>
    <string name="library_myLibrary_libraryVersion">10.1.1</string>
    <string name="library_myLibrary_libraryWebsite">https://mikepenz.dev</string>
    <!-- you can also reference custom licenses here e.g. myLicense -->
    <string name="library_myLibrary_licenseIds">apache_2_0</string>
    <string name="library_myLibrary_isOpenSource">true</string>
    <string name="library_myLibrary_repositoryLink">https://mikepenz.dev</string>
    <!-- Custom variables section -->
    <string name="library_myLibrary_owner">Owner</string>
    <string name="library_myLibrary_year">2020</string>
</resources>

Details

Checklist

mikepenz commented 2 years ago

@fuomag9


Disclaimer:

v10.x is still in very early stages, so the README has not yet been updated to reflect all changes. v10 is considered a major upgrade and not backwards compatible.


if you want to add additional custom libraries to be included when generating the data via the gradle plugin there is now a simplified approach.

Configure the config path in the gradle plugin. E.g. in the sample app config.

https://github.com/mikepenz/AboutLibraries/blob/feature/remote_licenses/app/build.gradle#L90-L91 (the folder is relative to the root of the project)

After that create a libraries folder within, and there you just add .json files containing libraries you want to add (1 file per library)

See demo libraries here: https://github.com/mikepenz/AboutLibraries/tree/feature/remote_licenses/config/libraries

A full library with all data would look like:

{
  "uniqueId": "com.mikepenz:materialdrawer",
  "developers": [
    {
      "organisationUrl": "https://mikepenz.dev",
      "name": "Mike Penz"
    }
  ],
  "artifactVersion": "9.0.0-a02",
  "description": "The flexible, easy to use, all in one drawer library for your Android project.",
  "scm": {
    "connection": "scm:git@github.com:mikepenz/MaterialDrawer.git",
    "url": "https://github.com/mikepenz/MaterialDrawer",
    "developerConnection": "scm:git@github.com:mikepenz/MaterialDrawer.git"
  },
  "name": "ABC MaterialDrawer Library",
  "website": "https://github.com/mikepenz/MaterialDrawer",
  "licenses": [
    "133a737bef925d338a857868bf2a1db5"
  ]
}
fuomag9 commented 2 years ago

@fuomag9

Disclaimer:

v10.x is still in very early stages, so the README has not yet been updated to reflect all changes. v10 is considered a major upgrade and not backwards compatible.

if you want to add additional custom libraries to be included when generating the data via the gradle plugin there is now a simplified approach.

Configure the config path in the gradle plugin. E.g. in the sample app config.

https://github.com/mikepenz/AboutLibraries/blob/feature/remote_licenses/app/build.gradle#L90-L91 (the folder is relative to the root of the project)

After that create a libraries folder within, and there you just add .json files containing libraries you want to add (1 file per library)

See demo libraries here: https://github.com/mikepenz/AboutLibraries/tree/feature/remote_licenses/config/libraries

A full library with all data would look like:

{
  "uniqueId": "com.mikepenz:materialdrawer",
  "developers": [
    {
      "organisationUrl": "https://mikepenz.dev",
      "name": "Mike Penz"
    }
  ],
  "artifactVersion": "9.0.0-a02",
  "description": "The flexible, easy to use, all in one drawer library for your Android project.",
  "scm": {
    "connection": "scm:git@github.com:mikepenz/MaterialDrawer.git",
    "url": "https://github.com/mikepenz/MaterialDrawer",
    "developerConnection": "scm:git@github.com:mikepenz/MaterialDrawer.git"
  },
  "name": "ABC MaterialDrawer Library",
  "website": "https://github.com/mikepenz/MaterialDrawer",
  "licenses": [
    "133a737bef925d338a857868bf2a1db5"
  ]
}

Thank you, this worked!

mikepenz commented 2 years ago

Documentation and references in the repo will soon be updated when we reach beta stage of this new release.

Thank you for being an early tester, please report back in the v10 ticket with input to make v10 even better