### Run WASM Sample
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/CLAUDE.md
Start the development server for the WebAssembly (WASM) sample. Use for testing the web version.
```bash
./gradlew :sample:web:wasmJsBrowserDevelopmentRun
```
--------------------------------
### Run Android App
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/sample/README.md
Use this Gradle task to install the debug version of the Android sample application onto a connected device or emulator.
```bash
./gradlew :sample:installDebug
```
--------------------------------
### Access Library Details Programmatically with AboutLibraries Core
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Example of how to build and use the AboutLibraries core module to retrieve library and license information programmatically.
```kotlin
val libs = Libs.Builder()
.withJson(aboutLibsJson) // provide the metaData (alternative APIs available)
.build()
val libraries = libs.libraries // retrieve all libraries defined in the metadata
val licenses = libs.licenses // retrieve all licenses defined in the metadata
for (lib in libraries) {
Log.i("AboutLibraries", "${lib.name}")
}
```
--------------------------------
### Display AboutLibraries Information with Compose (Multiplatform - Manual Loading)
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Example for multiplatform projects demonstrating manual loading of the AboutLibraries JSON file. You will need to implement your specific resource loading logic.
```kotlin
// Multiplatform: Manually loading JSON
val libraries by produceLibraries {
// Replace with your specific resource loading logic
useResource("aboutlibraries.json") { res -> res.bufferedReader().readText() }
}
LibrariesContainer(libraries, Modifier.fillMaxSize())
```
--------------------------------
### Get All Libraries
Source: https://github.com/mikepenz/aboutlibraries/wiki/HOWTO:-Custom
Retrieve a list of all available libraries, including internal and external ones.
```java
libs.getLibraries();
```
--------------------------------
### Find All Libraries
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
List all detected libraries along with their name, version, and identifier. This task helps in getting a comprehensive overview of the project's dependencies.
```bash
# Outputs all dependencies with name, version and their identifier
./gradlew app:findLibraries
```
--------------------------------
### Display AboutLibraries Information with Compose (Multiplatform - compose-resources)
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Example for multiplatform projects using the `compose-resources` API to load AboutLibraries information from a JSON file located in `src/commonMain/composeResources/files/`.
```kotlin
// Multiplatform: Using compose-resources API (e.g., src/commonMain/composeResources/files/aboutlibraries.json)
val libraries by produceLibraries {
Res.readBytes("files/aboutlibraries.json").decodeToString()
}
LibrariesContainer(libraries, Modifier.fillMaxSize())
```
--------------------------------
### Display AboutLibraries Information with Compose (Android)
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Example of how to load and display AboutLibraries information using Compose for Android applications. Requires providing the resource identifier for `R.raw.aboutlibraries`.
```kotlin
// Android: Provide resource identifier for the `R.raw.aboutlibraries` file.
val libraries by produceLibraries(R.raw.aboutlibraries)
LibrariesContainer(libraries, Modifier.fillMaxSize())
```
--------------------------------
### Add Custom Licenses via JSON
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Licenses can be added or modified using a JSON file. This example shows the structure for providing license content.
```json
{
"content": "This is the Android Software Development Kit License Agreement\n
\n1. Introduction\n
\n1.1 The Android Software Development Kit (referred to in the License Agreement as the \"SDK\" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of the License Agreement. The License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK.\n
\n1.2 \"Android\" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time.\n
\n1.3 A \"compatible implementation\" means any Android device that (i) complies with the Android Compatibility Definition document, which can be found at the Android compatibility website (http://source.android.com/compatibility) and which may be updated from time to time; and (ii) successfully passes the Android Compatibility Test Suite (CTS).\n
\n1.4 \"Google\" means Google LLC, a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.\n
\n2. Accepting this License Agreement\n
\n2.1 In order to use the SDK, you must first agree to the License Agreement. You may not use the SDK if you do not accept the License Agreement.\n
\n2.2 By clicking to accept, you hereby agree to the terms of the License Agreement.\n
\n2.3 You may not use the SDK and may not accept the License Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries, including the country in which you are resident or from which you use the SDK.\n
\n2.4 If you are agreeing to be bound by the License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to the License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the SDK on behalf of your employer or other entity.\n
\n3. SDK License from Google\n
\n3.1 Subject to the terms of the License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable, non-exclusive, and non-sublicensable license to use the SDK solely to develop applications for compatible implementations of Android.\n
\n3.2 You may not use this SDK to develop applications for other platforms (including non-compatible implementations of Android) or to develop another SDK. You are of course free to develop applications for other platforms, including non-compatible implementations of Android, provided that this SDK is not used for that purpose.\n
\n3.3 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. \"Intellectual Property Rights\" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you.\n
\n3.4 You may not use the SDK for any purpose not expressly permitted by the License Agreement. Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK.\n
\n3.5 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not the License Agreement.\n
\n3.6 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you.\n
\n3.7 Nothing in the License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features.\n
\n3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK.\n
\n4. Use of the SDK by You\n
\n4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under the License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights that subsist in those applications.\n
```
--------------------------------
### Conventional Commits Structure
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/CLAUDE.md
Example of the Conventional Commits format for commit messages. Adhere to this structure for consistency.
```markdown
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Overview
AboutLibraries is a **Kotlin Multiplatform (KMP)** library that automatically collects dependency and license information from Gradle projects at build time (via a Gradle plugin) and provides Compose/View-based UI to display it at runtime.
The Gradle plugin lives in a **separate Gradle build** under `plugin-build/`. The main project and `plugin-build/` are independent Gradle projects — commands for one do not apply to the other.
## Common Commands
### Main Project
```bash
./gradlew build # Build all modules
./gradlew lintDebug # Lint Android modules
./gradlew apiCheck # Binary compatibility validation
./gradlew :sample:android:assembleDebug # Build Android sample
./gradlew :sample:android:validateDebugScreenshotTest # Run Paparazzi screenshot tests
./gradlew :sample:android:updateDebugScreenshotTest # Update screenshot baselines
./gradlew :sample:desktop:run # Run desktop sample
./gradlew :sample:web:wasmJsBrowserDevelopmentRun # Run WASM sample
```
### Gradle Plugin (run from `plugin-build/`)
```bash
cd plugin-build
./gradlew build # Build the plugin
./gradlew test # Run all plugin tests
./gradlew test --tests FunctionalTest # Run a single test class
./gradlew plugin:lint # Lint the plugin
```
### Core Module Tests
```bash
./gradlew :aboutlibraries-core:jvmTest # Run JVM tests for core module
```
### Generating Library Definitions (for sample/app)
```bash
./gradlew :app:exportLibraryDefinitions
./gradlew :sample:android:exportLibraryDefinitionsDebug
./gradlew :sample:shared:exportLibraryDefinitions
```
## Architecture
### Module Structure
```
aboutlibraries-core/ # KMP data models + JSON parsing (all platforms)
aboutlibraries-compose/ # Base Compose UI (no Material dependency)
aboutlibraries-compose-m2/ # Material 2 Compose UI
aboutlibraries-compose-m3/ # Material 3 Compose UI
aboutlibraries-compose-wear-m3/ # Wear OS Material 3 (Android-only)
app/ # Full showcase Android app
sample/shared/ # KMP shared sample code
sample/android/ # Android sample (has Paparazzi screenshot tests)
sample/desktop/ # JVM desktop Compose sample
sample/web/ # WebAssembly Compose sample
plugin-build/plugin/ # Gradle plugin (separate Gradle project)
config/ # Sample library/license JSON config overrides
```
### How It Works
1. **Build time**: The Gradle plugin (`com.mikepenz.aboutlibraries.plugin` or `.android` variant) scans project dependencies, reads POM files, and generates a JSON file (`aboutlibraries.json`) that is bundled into the app's assets/resources.
2. **Runtime**: `aboutlibraries-core` reads and parses that JSON to produce `Libs` data objects. The Compose modules provide `LibrariesContainer` and related composables to display the data.
### KMP Targets
- **Android** (API 24+)
- **JVM** (desktop)
- **Native** (iOS, Linux, macOS)
- **JS** (browser)
- **WebAssembly** (experimental)
### Plugin Architecture
The plugin provides two Gradle plugins:
- `com.mikepenz.aboutlibraries.plugin` — Manual task-based approach
- `com.mikepenz.aboutlibraries.plugin.android` — Auto-hooks into Android build variants
Plugin tests use **JUnit 5 + Gradle TestKit** (`GradleRunner`). The plugin is built with Java 11 toolchain.
### Compose UI Pattern
All Compose modules follow the same pattern: `aboutlibraries-compose` provides the core composables with no Material dependency, and the `-m2`/`-m3` modules add Material-styled wrappers. Downstream users pick the variant matching their Material version.
## Key Technologies
- **Kotlin 2.2**, **AGP 9.0+**, **Compose 1.10.x**
- **Kotlin Serialization** — JSON parsing in core module
- **Paparazzi** — Screenshot testing in `sample/android`
- **Gradle TestKit** — Functional plugin tests
- **Binary Compatibility Validator** — `apiCheck` enforces public API stability
## Version & Publishing
- Published to **Maven Central** as `com.mikepenz:aboutlibraries-*`
- Gradle plugin published to **Gradle Plugin Portal**
- Versions managed via external version catalog (`com.mikepenz:version-catalog`)
- Convention plugins from the same catalog handle shared build configuration (`com.mikepenz.convention.*`)
## Commit Conventions
All commits must follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/):
```
():
[optional body]
[optional footer(s)]
```
Common types: `feat`, `fix`, `chore`, `refactor`, `docs`, `test`, `ci`, `perf`, `build`.
```
--------------------------------
### Get External Libraries
Source: https://github.com/mikepenz/aboutlibraries/wiki/HOWTO:-Custom
Retrieve only the external libraries, which are those that include their definition file within the library itself.
```java
libs.getExternLibraries();
```
--------------------------------
### Get Library by Identifier
Source: https://github.com/mikepenz/aboutlibraries/wiki/HOWTO:-Custom
Retrieve a specific library from the Libs object using its unique identifier string.
```java
libs.getLibrary("ActionBarSherlock")
```
--------------------------------
### Get Internal Libraries
Source: https://github.com/mikepenz/aboutlibraries/wiki/HOWTO:-Custom
Retrieve only the internal libraries, which are those included directly within the aboutLibraries library itself.
```java
libs.getInternLibraries();
```
--------------------------------
### Retrieve All Libraries
Source: https://github.com/mikepenz/aboutlibraries/wiki/HOWTO:-Custom
Get all combined libraries (auto-detected, internal, and external), eliminating duplicates. This method requires careful consideration of the 'true, true' parameters which control the inclusion of internal and external libraries.
```java
//get all combined (autoDetected, intern, extern) + eliminate duplicates
//look at the sourceCode for more information
libs.prepareLibraries(null, null, true, true)
```
--------------------------------
### Run Desktop Sample
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/CLAUDE.md
Execute the JVM desktop sample application. Use for testing the desktop version.
```bash
./gradlew :sample:desktop:run
```
--------------------------------
### Run Desktop App
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/sample/README.md
Execute this Gradle task to run the desktop version of the sample application.
```bash
./gradlew :sample:desktop:run
```
--------------------------------
### Build Android Sample
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/CLAUDE.md
Assemble the debug version of the Android sample application. Use to test the Android sample.
```bash
./gradlew :sample:android:assembleDebug
```
--------------------------------
### Create and Configure LibsFragment
Source: https://github.com/mikepenz/aboutlibraries/wiki/HOWTO:-Fragment
Instantiate a `LibsFragment` and pass application fields to it. The fragment will then find all external library information.
```java
LibsFragment fragment = new LibsBuilder()
//Pass the fields of your application to the lib so it can find all external lib information
.withFields(R.string.class.getFields())
//get the fragment
.fragment();
```
--------------------------------
### Build Gradle Plugin
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/CLAUDE.md
Build the Gradle plugin located in the `plugin-build/` directory. Run this command after navigating into the directory.
```bash
cd plugin-build
./gradlew build
```
--------------------------------
### Run Demo Apps for Multiplatform
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Execute the demo applications for Compose Multiplatform targets. This includes running the JVM Desktop application and the WASM Web application.
```bash
# JVM Desktop app
./gradlew :app-desktop:run
# WASM Web app
./gradlew :app-wasm:run
```
--------------------------------
### Run Wasm App
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/sample/README.md
This Gradle task launches the WebAssembly version of the sample application in a browser for development.
```bash
./gradlew :sample:web:wasmJsBrowserDevelopmentRun
```
--------------------------------
### List Funding Options for Libraries
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Query and list all identified funding options for the included projects, typically by leveraging information from sources like the GitHub API. This helps in identifying ways to support the libraries used.
```bash
# List all funding options for included projects (as identified via the e.g.: GitHub API)
./gradlew app:fundLibraries
```
--------------------------------
### Initialize Libs Object
Source: https://github.com/mikepenz/aboutlibraries/wiki/HOWTO:-Custom
Create an instance of the Libs object, passing the context and string fields for external information. This is recommended to ensure the library can find all relevant external information files.
```java
Libs libs = Libs(context, Libs.toStringArray(R.string.class.getFields()));
```
--------------------------------
### AboutLibraries Version Catalog Configuration
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Recommended way to manage AboutLibraries dependencies using a `libs.versions.toml` file. Ensure you replace `{latest-version}` with the actual latest version.
```toml
[versions]
aboutLibraries = "{latest-version}"
[libraries]
# Core module (required for accessing library data)
aboutlibraries-core = { module = "com.mikepenz:aboutlibraries-core", version.ref = "aboutLibraries" }
# Compose UI modules (choose one or both)
aboutlibraries-compose-core = { module = "com.mikepenz:aboutlibraries-compose-core", version.ref = "aboutLibraries" } # Common compose core
aboutlibraries-compose-m2 = { module = "com.mikepenz:aboutlibraries-compose", version.ref = "aboutLibraries" } # Material 2 UI
aboutlibraries-compose-m3 = { module = "com.mikepenz:aboutlibraries-compose-m3", version.ref = "aboutLibraries" } # Material 3 UI
[plugins]
aboutLibraries = { id = "com.mikepenz.aboutlibraries.plugin", version.ref = "aboutLibraries" }
```
--------------------------------
### Define Library Information in XML
Source: https://github.com/mikepenz/aboutlibraries/wiki/HOWTODEV:-Include-in-your-library
Use this XML structure in your values folder to define details for a library. Prefixes like 'define_*' are used for your own libraries, while 'define_int_*' is for AboutLibraries inclusion. Ensure all required fields like author, name, description, version, license, and repository link are provided.
```xml
Jake Wharton
http://jakewharton.com/
ActionBarSherlock
ActionBarSherlock is an standalone library
designed to facilitate the use of the action bar design pattern across all versions of Android through a single
API.
4.3.1
http://actionbarsherlock.com/
apache_2_0
true
https://github.com/JakeWharton/ActionBarSherlock
```
--------------------------------
### Generate All Library Definitions
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/app/README.md
Execute this Gradle task to export all library definitions for the project. Ensure you are in the project's root directory.
```bash
./gradlew :app:exportLibraryDefinitions
```
--------------------------------
### Run Gradle Plugin Tests
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/CLAUDE.md
Execute all tests for the Gradle plugin. Run this command from the `plugin-build/` directory.
```bash
cd plugin-build
./gradlew test
```
--------------------------------
### Build Main Project Modules
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/CLAUDE.md
Execute Gradle tasks to build all modules of the main project. Use for general project compilation.
```bash
./gradlew build
```
--------------------------------
### Apply Default Gradle Plugin - All Subprojects
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Apply the default AboutLibraries Gradle plugin to all subprojects by declaring it in the root build.gradle file using the plugins DSL.
```gradle
id("com.mikepenz.aboutlibraries.plugin") version "${latestAboutLibsRelease}"
```
--------------------------------
### Generate Library Definitions
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/sample/README.md
Execute these Gradle tasks to export library definitions for different modules of the sample app. Ensure the Gradle wrapper is available in your project.
```bash
./gradlew :sample:shared:exportLibraryDefinitions
```
```bash
./gradlew :sample:desktop:exportLibraryDefinitions
```
```bash
./gradlew :sample:web:exportLibraryDefinitions
```
--------------------------------
### Export Library Definitions for Android Sample
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/CLAUDE.md
Generate library definition JSON files for the debug variant of the Android sample. Use for testing sample data.
```bash
./gradlew :sample:android:exportLibraryDefinitionsDebug
```
--------------------------------
### Export Library Definitions for Shared Sample
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/CLAUDE.md
Generate library definition JSON files for the shared sample code. Use for testing shared logic.
```bash
./gradlew :sample:shared:exportLibraryDefinitions
```
--------------------------------
### Generate Dependency Information with Gradle
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/app-test/README.md
Execute this Gradle task to export library definitions from the app-test module. Ensure you are in the project root directory.
```bash
./gradlew :app-test:exportLibraryDefinitions
```
--------------------------------
### Configure Manual JSON Export in Gradle
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Configure the AboutLibraries plugin in your `build.gradle.kts` file to manually define the output path for the `aboutlibraries.json` file. This is useful for environments requiring full control over the JSON generation.
```kotlin
// build.gradle.kts
aboutLibraries {
export {
// Define the output path for manual generation
// Adjust the path based on your project structure (e.g., composeResources, Android res/raw)
outputFile = file("src/commonMain/composeResources/files/aboutlibraries.json")
// Optionally specify the variant for export
// variant = "release"
}
}
```
--------------------------------
### Run Core Module JVM Tests
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/CLAUDE.md
Execute JVM unit tests specifically for the `aboutlibraries-core` module. Use for testing core logic.
```bash
./gradlew :aboutlibraries-core:jvmTest
```
--------------------------------
### Generate Test Reference Images
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/sample/README.md
Run this Gradle task to record Paparazzi screenshots for the Android sample app. This is typically used for generating baseline images for visual regression tests.
```bash
./gradlew :sample:android:recordPaparazzi
```
--------------------------------
### Apply Default Gradle Plugin - Multiplatform
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Apply the default AboutLibraries Gradle plugin for multiplatform projects using the plugins DSL. Ensure the plugin is applied in the root build.gradle.kts and the app build.gradle.kts.
```kotlin
id("com.mikepenz.aboutlibraries.plugin") version "${latestAboutLibsRelease}" apply false
id("com.mikepenz.aboutlibraries.plugin")
```
--------------------------------
### Verify Screenshot Tests
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/sample/README.md
Execute this Gradle task to verify the ScreenshotTests report for the Android sample app. It compares current screenshots against recorded baselines.
```bash
./gradlew :sample:android:verifyPaparazzi
```
--------------------------------
### Export Funding Information with Gradle
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Use the `exportFunding` Gradle task to automatically generate funding data. Ensure a GitHub API Key is provided. This task will overwrite existing files.
```bash
./gradlew app:exportFunding
```
--------------------------------
### Apply Legacy Gradle Plugin
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Apply the AboutLibraries Gradle plugin using the legacy plugin application method. This involves adding the classpath to the root build.gradle and applying the plugin in the app build.gradle.
```gradle
classpath("com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:${latestAboutLibsRelease}")
apply plugin: 'com.mikepenz.aboutlibraries.plugin'
```
--------------------------------
### Keep AboutLibraries JSON during Resource Shrinking
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Add this XML resource to your project to prevent the `aboutlibraries.json` file from being removed when optimized resource shrinking is enabled.
```xml
```
--------------------------------
### Update LibrariesContainer Padding and Dimensions (v11 to v12)
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/MIGRATION.md
Illustrates the API changes in LibrariesContainer from v11.x.y to v12.x.y, showing how padding and dimensions are now configured using default utility functions.
```kotlin
LibrariesContainer(
itemContentPadding = PaddingValues(16.dp),
itemSpacing = 2.dp
)
```
```kotlin
LibrariesContainer(
padding = LibraryDefaults.libraryPadding(contentPadding = PaddingValues(16.dp)),
dimensions = LibraryDefaults.libraryDimensions(itemSpacing = 2.dp),
)
```
--------------------------------
### Configure AboutLibraries Gradle Plugin
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Use this configuration block in your build script to customize the AboutLibraries plugin's behavior, such as enabling offline mode, setting configuration paths, and managing license fetching.
```kotlin
aboutLibraries {
// Allow to enable "offline mode", will disable any network check of the plugin (including [fetchRemoteLicense] or pulling spdx license texts)
offlineMode = false
collect {
// Define the path configuration files are located in. E.g. additional libraries, licenses to add to the target .json
// Warning: Please do not use the parent folder of a module as path, as this can result in issues. More details: https://github.com/mikepenz/AboutLibraries/issues/936
// The path provided is relative to the modules path (not project root)
configPath = file("../config")
// (optional) GitHub token to raise API request limit to allow fetching more licenses
gitHubApiToken = if (hasProperty("github.pat")) property("github.pat")?.toString() else null
// Enable fetching of "remote" licenses. Uses the API of supported source hosts
// See https://github.com/mikepenz/AboutLibraries#special-repository-support
// A `gitHubApiToken` is required for this to work as it fetches information from GitHub's API.
fetchRemoteLicense = false
// Enables fetching of "remote" funding information. Uses the API of supported source hosts
// See https://github.com/mikepenz/AboutLibraries#special-repository-support
// A `gitHubApiToken` is required for this to work as it fetches information from GitHub's API.
fetchRemoteFunding = false
// Allows to only collect dependencies of specific variants during the `collectDependencies` step.
// filterVariants.addAll("debug", "release")
// Enable inclusion of `platform` dependencies in the library report
includePlatform = true
}
export {
// Define the output path (including fileName). Modifying this will disable the automatic meta data discovery for supported platforms.
outputFile = file("src/commonMain/composeResources/files/aboutlibraries.json")
// The default export variant to use for this module.
// variant = "release"
// Allows to exclude some fields from the generated meta data field.
// If the class name is specified, the field is only excluded for that class; without a class name, the exclusion is global.
excludeFields.addAll("License.name", "developers", "funding")
// Enable pretty printing for the generated JSON file
prettyPrint = true
}
exports {
// Define export configuration per variant.
create("jvm") {
outputFile = file("files/jvm/aboutlibraries.json")
}
create("wasmJs") {
outputFile = file("files/wasmJs/aboutlibraries.json")
}
}
license {
// Define the strict mode, will fail if the project uses licenses not allowed
// - This will only automatically fail for Android projects using the Android-specific plugin (com.mikepenz.aboutlibraries.plugin.android)
// For other projects, execute `exportLibraryDefinitions` manually
strictMode = com.mikepenz.aboutlibraries.plugin.StrictMode.FAIL
// Allowed set of licenses, this project will be able to use without build failure
allowedLicenses.addAll("Apache-2.0", "asdkl")
// Allowed set of licenses for specific dependencies, this project will be able to use without build failure
allowedLicensesMap = mapOf(
"asdkl" to listOf("androidx.jetpack.library"),
"NOASSERTION" to listOf("org.jetbrains.kotlinx"),
)
// Full license text for license IDs mentioned here will be included, even if no detected dependency uses them.
// additionalLicenses.addAll("mit", "mpl_2_0")
}
library {
// Enable the duplication mode, allows to merge, or link dependencies which relate
duplicationMode = com.mikepenz.aboutlibraries.plugin.DuplicateMode.MERGE
// Configure the duplication rule, to match "duplicates" with
duplicationRule = com.mikepenz.aboutlibraries.plugin.DuplicateRule.SIMPLE
}
}
```
--------------------------------
### Lint Gradle Plugin
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/CLAUDE.md
Run lint checks on the Gradle plugin. Use for code quality. Run from `plugin-build/`.
```bash
cd plugin-build
./gradlew plugin:lint
```
--------------------------------
### Include AboutLibraries Core Module in Gradle
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Add the core module dependency to your `build.gradle.kts` file. This allows programmatic access to library information.
```gradle
// build.gradle.kts
// Recommended: Using version catalog
implementation(libs.aboutlibraries.core)
// Alternative: Direct dependency declaration
// implementation("com.mikepenz:aboutlibraries-core:${latestAboutLibsRelease}")
```
--------------------------------
### Export Compliance Libraries
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Generate comprehensive compliance reports for all dependencies. By default, this task creates `export.csv`, `export.txt`, and a `dependencies` folder in the project root.
```bash
# Exports all dependencies in a format helpful for compliance reports.
# By default writes `export.csv` and `export.txt` and `dependencies` folder in the root of the project.
./gradlew app:exportComplianceLibraries${Variant} -PaboutLibraries.exportPath=complianceReport/
```
--------------------------------
### Update Android Screenshot Baselines
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/CLAUDE.md
Update the baseline screenshots for the Android sample's Paparazzi tests. Use when UI changes are intentional.
```bash
./gradlew :sample:android:updateDebugScreenshotTest
```
--------------------------------
### Manually Generate Library Definitions JSON
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Generate the `aboutlibraries.json` file manually using Gradle tasks. This allows you to commit the generated file to your SCM for later use. You can specify a custom path and override the export variant.
```bash
# Generate using the configured location and variant
./gradlew :app:exportLibraryDefinitions
# Generate providing a custom path and variant override
./gradlew :app:exportLibraryDefinitions -PaboutLibraries.outputFile=src/main/res/raw/libraries.json -PaboutLibraries.exportVariant=release
```
--------------------------------
### Include AboutLibraries Compose UI Modules in Gradle
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Add the Compose UI module dependencies to your `build.gradle.kts` file for easy integration into Jetpack Compose applications. Choose Material 2, Material 3, or both.
```gradle
// build.gradle.kts
// Recommended: Using version catalog (choose M2 or M3, or both)
implementation(libs.aboutlibraries.compose.m2) // Material 2
implementation(libs.aboutlibraries.compose.m3) // Material 3
// Alternative: Direct dependency declaration
// implementation("com.mikepenz:aboutlibraries-compose:${latestAboutLibsRelease}") // Material 2
// implementation("com.mikepenz:aboutlibraries-compose-m3:${latestAboutLibsRelease}") // Material 3
```
--------------------------------
### Set Activity Style in Java
Source: https://github.com/mikepenz/aboutlibraries/wiki/HOWTO:-Style
Use this method to apply predefined styles like LIGHT_DARK_TOOLBAR to the AboutLibraries activity. Ensure the Libs class is imported.
```java
.withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR)
```
--------------------------------
### Export Libraries to CLI in CSV Format
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Export all library dependencies to the command line interface in CSV format. This can be useful for quick checks or integration with other tools.
```bash
# Export dependencies to CLI in CSV format
./gradlew app:exportLibraries
./gradlew app:exportLibraries${Variant}
```
--------------------------------
### Apply Android Gradle Plugin - Multiplatform
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Apply the Android-specific AboutLibraries Gradle plugin for automatic metadata generation during the Android build process. This plugin is recommended for Android projects and should be applied in both root and app build.gradle.kts files.
```kotlin
id("com.mikepenz.aboutlibraries.plugin.android") version "${latestAboutLibsRelease}" apply false
id("com.mikepenz.aboutlibraries.plugin.android")
```
--------------------------------
### Define AboutLibraries Theme Attributes in XML
Source: https://github.com/mikepenz/aboutlibraries/wiki/HOWTO:-Style
Customize specific UI elements of AboutLibraries by defining their colors using these theme attributes in your styles.xml. Refer to attrs.xml for a complete list.
```xml
-
@color/about_libraries_window_background
-
@color/about_libraries_card
-
@color/about_libraries_title_description
-
@color/about_libraries_text_description
-
@color/about_libraries_title_openSource
-
@color/about_libraries_text_openSource
-
@color/about_libraries_special_button_openSource
-
@color/about_libraries_dividerDark_openSource
-
@color/about_libraries_dividerLight_openSource
```
--------------------------------
### Validate Android Screenshot Tests
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/CLAUDE.md
Run Paparazzi screenshot tests for the Android sample. Ensures UI consistency.
```bash
./gradlew :sample:android:validateDebugScreenshotTest
```
--------------------------------
### Custom Header, Divider, and Footer in Compose
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Customize the appearance of the LibrariesContainer by providing custom composable functions for the header, divider, and footer. This allows for a more tailored UI experience.
```kotlin
LibrariesContainer(
libraries = libraries,
modifier = Modifier.fillMaxSize().padding(it),
header = {
item {
Box(modifier = Modifier.fillMaxWidth().padding(16.dp), contentAlignment = Alignment.Center) {
Text("Hello Header")
}
}
},
divider = { HorizontalDivider() },
footer = {
item {
Box(modifier = Modifier.fillMaxWidth().padding(16.dp), contentAlignment = Alignment.Center) {
Text("Hello Footer")
}
}
}
)
```
--------------------------------
### Export Library Definitions for Multiplatform
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Manually export library definitions to a JSON file, which is necessary for non-Android platforms or when not using the Android-specific plugin. You can specify the output file and filter by variant.
```bash
# Export definitions to the specified file (e.g., for desktop)
./gradlew :app-desktop:exportLibraryDefinitions -PaboutLibraries.outputFile=src/main/resources/libraries.json
# Filter exported definition by variant (e.g., for wasmJs target)
./gradlew :app-wasm:exportLibraryDefinitions -PaboutLibraries.outputFile=src/jsMain/resources/aboutlibraries.json -PaboutLibraries.exportVariant=wasmJs
```
--------------------------------
### Add or Override Library Funding Details
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Provide additional or modify existing library details by placing a `.json` file in the `funding` directory. If the `uniqueId` overlaps, a merge will occur.
```json
{
"uniqueId": "com.mikepenz:materialdrawer",
"developers": [
{
"name": "Mike Penz",
"organisationUrl": "https://mikepenz.dev"
}
],
"description": "(Merged) The flexible, easy to use, all in one drawer library for your Android project.",
"name": "ABC MaterialDrawer Library",
"website": "https://github.com/mikepenz/MaterialDrawer"
}
```
--------------------------------
### Manually Export Library Definitions with Custom Path
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/README.md
Manually trigger the Gradle task to export library definitions to a specified file path. This is useful for committing the definitions to SCM or for specific build configurations.
```bash
# Manually generate the dependency metaData in the provided location. Allows to commit it in SCM
# Exports the metaData in `src/main/resources/` relative to the module root
./gradlew app-desktop:exportLibraryDefinitions -PaboutLibraries.outputFile=src/main/resources/libraries.json
# Export only for a specific variant: `release`
./gradlew app-desktop:exportLibraryDefinitions -PaboutLibraries.outputFile=src/main/resources/libraries.json -PaboutLibraries.exportVariant=release
```
--------------------------------
### Extract Version Name using Gradle
Source: https://github.com/mikepenz/aboutlibraries/wiki/HOWTODEV:-Include-in-your-library
This Gradle snippet demonstrates how to define version names for different build types, including suffixes for debug builds. It shows how to use `resValue` to inject the version string into your Android resources, making it accessible as `app_version`.
```gradle
// lib/build.gradle
buildTypes {
debug {
versionNameSuffix ".debug"
resValue "string", "app_version",
"${defaultConfig.versionName}${versionNameSuffix}"
}
release {
resValue “string”, “app_version”,
“${defaultConfig.versionName}”
}
}
```
--------------------------------
### Configure Duplicate Handling in Gradle Plugin
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/MIGRATION.md
To revert to the prior behavior of keeping duplicate libraries instead of merging them, configure the duplication mode and rule within your build script.
```kotlin
aboutLibraries {
library {
duplicationMode = DuplicateMode.KEEP
duplicationRule = DuplicateRule.SIMPLE
}
}
```
--------------------------------
### Run Specific Plugin Test Class
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/CLAUDE.md
Execute a single test class within the Gradle plugin. Useful for targeted testing. Run from `plugin-build/`.
```bash
cd plugin-build
./gradlew test --tests FunctionalTest
```
--------------------------------
### Define Default Colors in colors.xml
Source: https://github.com/mikepenz/aboutlibraries/wiki/HOWTO:-Style
This section shows the default color definitions for AboutLibraries, including window background, card, text, and divider colors. These can be overridden in your project.
```xml
#2196F3
#1976D2
#FF4081
#ECECEC
#FAFAFA
#212121
#727272
#212121
#AAA
#DADADA
@color/about_libraries_title_openSource
@color/about_libraries_text_openSource
@color/about_libraries_dividerDark_openSource
```
--------------------------------
### Add AboutLibraries as Maven Dependency
Source: https://github.com/mikepenz/aboutlibraries/wiki/HOWTO:-Include
Include this dependency in your build.gradle file to add the AboutLibraries library to your project. Ensure transitive dependencies are enabled.
```gradle
compile('com.mikepenz:aboutlibraries:x.y.z@aar') {
transitive = true
}
```
--------------------------------
### Generate Debug Library Definitions (Android)
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/app/README.md
Use this Gradle task to export library definitions specifically for the debug build type on Android. This is useful for development and testing.
```bash
./gradlew :app:exportLibraryDefinitionsDebug
```
--------------------------------
### Search for Libraries
Source: https://github.com/mikepenz/aboutlibraries/wiki/HOWTO:-Custom
Search for libraries using a search term and an optional limit for the number of results. This is useful for finding libraries based on keywords.
```java
libs.findLibrary("Action", 5)
```
--------------------------------
### Apply Android Auto-Registering Gradle Plugin
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/MIGRATION.md
To automatically register the Android auto-generation task as part of the Android build process, apply this plugin to your module.
```gradle
id("com.mikepenz.aboutlibraries.plugin.android")
```
--------------------------------
### Validate API Compatibility
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/CLAUDE.md
Perform binary compatibility validation for the project's public API. Ensures backward compatibility.
```bash
./gradlew apiCheck
```
--------------------------------
### Define Dark Theme Colors in colors.xml
Source: https://github.com/mikepenz/aboutlibraries/wiki/HOWTO:-Style
This section provides the default color definitions for AboutLibraries when using a dark theme. It includes specific dark variants for window background, card, text, and divider colors.
```xml
#2196F3
#1976D2
#FF4081
#303030
#666666
#ffffffff
#DEDEDE
#ffffffff
#303030
#303030
@color/about_libraries_title_openSource
@color/about_libraries_text_openSource
@color/about_libraries_dividerDark_openSource
```
--------------------------------
### Dynamically Generate Library ID
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/DEV/definition-file-builder/index.html
This JavaScript code listens for input on the library name dialog. If the library ID dialog is empty, it generates a library ID from the library name, converts it to lowercase, replaces spaces with underscores, and updates both a hidden input field and the displayed text for the library ID.
```javascript
var nlform = new NLForm( document.getElementById( 'nl-form' ) ); document.getElementsByName("libraryName_dialog")[0].addEventListener('input', function() { if(document.getElementsByName("libraryId_dialog")[0].value == "") { var libraryNameId = fixString(document.getElementsByName("libraryName_dialog")[0].value).toLowerCase().replace(/ /g, '').replace(/-/g, '\_'); document.getElementsByName("libraryId_text")[0].innerHTML = libraryNameId; document.getElementsByName("libraryId")[0].value = libraryNameId; } });
```
--------------------------------
### Lint Android Modules
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/CLAUDE.md
Run lint checks on Android modules to identify potential issues. Useful for maintaining code quality.
```bash
./gradlew lintDebug
```
--------------------------------
### Dependency Update Commit Format
Source: https://github.com/mikepenz/aboutlibraries/blob/develop/CLAUDE.md
Use this format for dependency update commits to ensure all changed dependencies are listed explicitly with their old and new versions. Include transitive dependency changes under a 'via' section when using a shared version catalog.
```markdown
chore(deps): update dependencies
- ->
via -> :
- ->
```
--------------------------------
### Override Window Background Color
Source: https://github.com/mikepenz/aboutlibraries/wiki/HOWTO:-Style
To change the main background color of the AboutLibraries activity, use the standard Android `android:windowBackground` attribute instead of `about_libraries_window_background`.
```xml
- @color/custom_color
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.