1
1
# AboutLibraries
2
2
3
- .. collects all dependency details including licenses at compile time, and offers simple APIs to visualize these in the app.
4
- * No runtime overhead.* Strong caching. Any gradle dependency is supported.
3
+ <!-- Badges -->
4
+ [ ![ Maven Central] ( https://img.shields.io/maven-central/v/com.mikepenz/aboutlibraries-core?style=for-the-badge )] ( https://search.maven.org/artifact/com.mikepenz/aboutlibraries-core )
5
+ [ ![ Gradle Plugin Portal] ( https://img.shields.io/gradle-plugin-portal/v/com.mikepenz.aboutlibraries.plugin?label=Gradle%20Plugin&style=for-the-badge )] ( https://plugins.gradle.org/plugin/com.mikepenz.aboutlibraries.plugin )
6
+ [ ![ Apache 2.0 License] ( https://img.shields.io/github/license/mikepenz/AboutLibraries?style=for-the-badge )] ( https://github.com/mikepenz/AboutLibraries/blob/develop/LICENSE )
7
+
8
+ This library collects dependency details, including licenses at compile time, and offers simple APIs to visualize these in the app.
9
+ * No runtime overhead.* Strong caching. Supports any Gradle dependency.
5
10
6
11
-------
7
12
8
13
<p align =" center " >
9
- <a href="#whats-included-">What's included 🚀</a> •
10
- <a href="#setup">Setup 🛠️</a> •
11
- <a href="#gradle-api">Gradle API️ </a> •
14
+ <a href="#whats-included-">What's Included 🚀</a> •
15
+ <a href="#setup">Setup Guide 🛠️</a> •
16
+ <a href="#gradle-api">Gradle Tasks ⚙️ </a> •
12
17
<a href="MIGRATION.md">Migration Guide 🧬</a> •
13
- <a href="https://play.google.com/store/apps/details?id=com.mikepenz.aboutlibraries.sample">Sample App</a>
14
18
</p >
15
19
16
20
-------
31
35
32
36
# Screenshots
33
37
34
- ![ Screenshots] ( https://raw.githubusercontent.com/mikepenz/AboutLibraries/develop/DEV/screenshots/Screenshots.png )
38
+ ![ AboutLibraries Screenshots] ( https://raw.githubusercontent.com/mikepenz/AboutLibraries/develop/DEV/screenshots/Screenshots.png )
35
39
36
40
# Setup
37
41
42
46
43
47
## Gradle Plugin
44
48
45
- > The gradle plugin is hosted
46
- > via [ Gradle Plugins ] ( https:// plugins.gradle.org/plugin/com.mikepenz.aboutlibraries.plugin ) .
49
+ > The Gradle plugin is hosted via the [ Gradle Plugin Portal ] ( https://plugins.gradle.org/plugin/com.mikepenz.aboutlibraries.plugin ) .
50
+ > Using the ` plugins ` DSL is the recommended approach .
47
51
48
- <details open ><summary ><b >Using the plugins DSL (for single modules )</b ></summary >
52
+ <details open ><summary ><b >Using the plugins DSL (Recommended )</b ></summary >
49
53
<p >
50
54
51
55
``` gradle
@@ -59,7 +63,7 @@ id("com.mikepenz.aboutlibraries.plugin")
59
63
</p >
60
64
</details >
61
65
62
- <details ><summary ><b >Using the plugins DSL (for whole project )</b ></summary >
66
+ <details ><summary ><b >Using the plugins DSL (Apply to all subprojects )</b ></summary >
63
67
<p >
64
68
65
69
``` gradle
@@ -84,12 +88,12 @@ apply plugin: 'com.mikepenz.aboutlibraries.plugin'
84
88
</p >
85
89
</details >
86
90
87
- <details ><summary ><b >Gradle Plugin Configuration</b ></summary >
91
+ <details ><summary ><b >Gradle Plugin Configuration Options </b ></summary >
88
92
<p >
89
93
90
94
## Gradle Plugin Configuration
91
95
92
- It is possible to provide custom configurations / adjustments to the automatic detection. This can be done via the gradle plugin .
96
+ The plugin allows customization via the ` aboutLibraries ` extension in your build script .
93
97
94
98
``` kts
95
99
aboutLibraries {
@@ -142,6 +146,16 @@ aboutLibraries {
142
146
// Enable pretty printing for the generated JSON file
143
147
prettyPrint = true
144
148
}
149
+
150
+ exports {
151
+ // Define export configuration per variant.
152
+ create(" jvm" ) {
153
+ outputFile = file(" files/jvm/aboutlibraries.json" )
154
+ }
155
+ create(" wasmJs" ) {
156
+ outputFile = file(" files/wasmJs/aboutlibraries.json" )
157
+ }
158
+ }
145
159
146
160
license {
147
161
// Define the strict mode, will fail if the project uses licenses not allowed
@@ -172,13 +186,19 @@ aboutLibraries {
172
186
```
173
187
174
188
Full documentation of all available gradle plugin
175
- configurations: https://github.com/mikepenz/AboutLibraries/blob/develop/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesExtension.kt
189
+ configurations can be found in the [ AboutLibrariesExtension.kt] ( https://github.com/mikepenz/AboutLibraries/blob/develop/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesExtension.kt ) source file.
190
+
191
+ </p >
192
+ </details >
193
+
194
+ <details ><summary ><b >Modify Libraries / Licenses</b ></summary >
195
+ <p >
176
196
177
197
## Modify libraries / licenses
178
198
179
- The plugin offers the ability to add additional libraries or licenses by specifying these under the
180
- ` libraries ` and respectively ` licenses ` directory, within the defined ` configPath ` .
181
- This can be seen here: https://github.com/mikepenz/AboutLibraries/blob/develop/config/
199
+ The plugin offers the ability to add or override library and license details by placing JSON files
200
+ in the ` libraries ` and ` licenses ` directories within the configured ` configPath ` .
201
+ See the [ config directory ] ( https://github.com/mikepenz/AboutLibraries/blob/develop/config/ ) for examples.
182
202
183
203
### Libraries
184
204
@@ -218,33 +238,40 @@ Provide additional or modify existing licenses via a `.json` file per license.
218
238
219
239
## Dependencies
220
240
221
- > The AboutLibraries Library is pushed
222
- > to [ Maven Central ] ( https://search.maven.org/artifact/com.mikepenz/aboutlibraries-core ) .
241
+ > The AboutLibraries libraries are published to [ Maven Central ] ( https://search.maven.org/artifact/com.mikepenz/aboutlibraries-core ) .
242
+ > Using a version catalog ( ` libs.versions.toml ` ) is the recommended way to manage dependencies .
223
243
224
- ### ` libs.versions.toml `
244
+ ### ` libs.versions.toml ` (Recommended)
225
245
226
246
``` toml
227
247
[versions ]
228
248
aboutLibraries = " {latest-version}"
229
249
230
250
[libraries ]
251
+ # Core module (required for accessing library data)
231
252
aboutlibraries-core = { module = " com.mikepenz:aboutlibraries-core" , version.ref = " aboutLibraries" }
232
- aboutlibraries-compose-core = { module = " com.mikepenz:aboutlibraries-compose-core" , version.ref = " aboutLibraries" }
233
- aboutlibraries-compose-m2 = { module = " com.mikepenz:aboutlibraries-compose" , version.ref = " aboutLibraries" }
234
- aboutlibraries-compose-m3 = { module = " com.mikepenz:aboutlibraries-compose-m3" , version.ref = " aboutLibraries" }
235
- # Deprecated module
236
- aboutlibraries-compose-view = { module = " com.mikepenz:aboutlibraries" , version.ref = " aboutLibraries" }
253
+ # Compose UI modules (choose one or both)
254
+ aboutlibraries-compose-core = { module = " com.mikepenz:aboutlibraries-compose-core" , version.ref = " aboutLibraries" } # Common compose core
255
+ aboutlibraries-compose-m2 = { module = " com.mikepenz:aboutlibraries-compose" , version.ref = " aboutLibraries" } # Material 2 UI
256
+ aboutlibraries-compose-m3 = { module = " com.mikepenz:aboutlibraries-compose-m3" , version.ref = " aboutLibraries" } # Material 3 UI
257
+ # Deprecated View-based UI module
258
+ aboutlibraries-view = { module = " com.mikepenz:aboutlibraries" , version.ref = " aboutLibraries" }
237
259
238
260
[plugins ]
239
261
aboutLibraries = { id = " com.mikepenz.aboutlibraries.plugin" , version.ref = " aboutLibraries" }
240
262
```
241
263
242
264
## Core-module
243
265
266
+ Include the core module to access the generated library information programmatically.
267
+
244
268
``` gradle
245
- implementation("com.mikepenz:aboutlibraries-core:${latestAboutLibsRelease}")
246
- // or
269
+ // build.gradle.kts
270
+ // Recommended: Using version catalog
247
271
implementation(libs.aboutlibraries.core)
272
+
273
+ // Alternative: Direct dependency declaration
274
+ // implementation("com.mikepenz:aboutlibraries-core:${latestAboutLibsRelease}")
248
275
```
249
276
250
277
<details ><summary ><b >(Advanced) Usage</b ></summary >
@@ -269,34 +296,41 @@ for (lib in libraries) {
269
296
</p >
270
297
</details >
271
298
272
- ## UI-module
299
+ ## UI-module (Compose)
300
+
301
+ Include the Compose UI module(s) for easy integration into Jetpack Compose applications.
273
302
274
303
``` gradle
275
- implementation("com.mikepenz:aboutlibraries-compose:${latestAboutLibsRelease}") // material 2
276
- implementation("com.mikepenz:aboutlibraries-compose-m3:${latestAboutLibsRelease}") // material 3
277
- // or
278
- implementation(libs.aboutlibraries.compose.m2) // material 2
279
- implementation(libs.aboutlibraries.compose.m3) // material 3
304
+ // build.gradle.kts
305
+ // Recommended: Using version catalog (choose M2 or M3, or both)
306
+ implementation(libs.aboutlibraries.compose.m2) // Material 2
307
+ implementation(libs.aboutlibraries.compose.m3) // Material 3
308
+
309
+ // Alternative: Direct dependency declaration
310
+ // implementation("com.mikepenz:aboutlibraries-compose:${latestAboutLibsRelease}") // Material 2
311
+ // implementation("com.mikepenz:aboutlibraries-compose-m3:${latestAboutLibsRelease}") // Material 3
280
312
```
281
313
282
314
### Usage
283
315
284
316
``` kotlin
285
- // android (when using the default resource location
317
+ // Android: Auto-discovery using default resource location (src/main/res/raw/aboutlibraries.json)
286
318
LibrariesContainer (
287
319
Modifier .fillMaxSize()
288
320
)
289
321
290
- // compose resource API
322
+ // Multiplatform: Using compose-resources API (e.g., src/commonMain/composeResources/files/aboutlibraries.json)
291
323
val libraries by rememberLibraries {
292
324
Res .readBytes(" files/aboutlibraries.json" ).decodeToString()
293
325
}
326
+ LibrariesContainer (libraries, Modifier .fillMaxSize())
294
327
295
- // compose manually
328
+
329
+ // Multiplatform: Manually loading JSON
296
330
val libraries by rememberLibraries {
331
+ // Replace with your specific resource loading logic
297
332
useResource(" aboutlibraries.json" ) { res -> res.bufferedReader().readText() }
298
333
}
299
-
300
334
LibrariesContainer (libraries, Modifier .fillMaxSize())
301
335
```
302
336
@@ -305,7 +339,7 @@ LibrariesContainer(libraries, Modifier.fillMaxSize())
305
339
306
340
### Advanced Usage
307
341
308
- Provide custom header, divider, and footer for the libraries container .
342
+ Provide custom header, divider, and footer items for the ` LibrariesContainer ` .
309
343
310
344
``` kotlin
311
345
// custom header, divider, footer
@@ -334,21 +368,22 @@ LibrariesContainer(
334
368
</details >
335
369
336
370
337
- <details ><summary ><b >Compose-jb </b ></summary >
371
+ <details ><summary ><b >Compose Multiplatform (Desktop, Wasm, etc.) </b ></summary >
338
372
<p >
339
373
340
- The core module and the compose module are Kotlin-Multiplatform projects.
341
- Find a sample application as the ` app-desktop ` module. It showcases the usage to manually generate
342
- the dependency meta information and include as part of the SCM.
374
+ The core and compose modules are Kotlin Multiplatform compatible.
375
+ The ` app-desktop ` and ` app-wasm ` modules demonstrate usage outside of Android, including manual generation and inclusion of the dependency metadata.
343
376
344
377
### Generate Dependency Information
345
378
379
+ Manually export the definitions using the Gradle task. This is typically needed for non-Android platforms or when ` registerAndroidTasks ` is disabled.
380
+
346
381
``` bash
382
+ # Export definitions to the specified file (e.g., for desktop)
347
383
./gradlew :app-desktop:exportLibraryDefinitions -PaboutLibraries.outputFile=src/main/resources/libraries.json
348
384
349
- # Filter exported definition by variant by passing `-PaboutLibraries.exportVariant==<VARIANT>`
350
- ./gradlew :app-wasm:exportLibraryDefinitions -PaboutLibraries.outputFile=src/main/resources/libraries.json -PaboutLibraries.exportVariant=wasmJs
351
- ./gradlew :app-wasm:exportLibraryDefinitions -PaboutLibraries.outputFile=src/main/resources/libraries.json -PaboutLibraries.exportVariant=jvm
385
+ # Filter exported definition by variant (e.g., for wasmJs target)
386
+ ./gradlew :app-wasm:exportLibraryDefinitions -PaboutLibraries.outputFile=src/jsMain/resources/aboutlibraries.json -PaboutLibraries.exportVariant=wasmJs
352
387
```
353
388
354
389
### Run Demo app(s)
@@ -363,24 +398,29 @@ the dependency meta information and include as part of the SCM.
363
398
364
399
### Screenshot
365
400
366
- ![ Compose-jb Screenshot] ( https://raw.githubusercontent.com/mikepenz/AboutLibraries/develop/DEV/screenshots/compose-jb.png )
401
+ ![ Compose Multiplatform Screenshot] ( https://raw.githubusercontent.com/mikepenz/AboutLibraries/develop/DEV/screenshots/compose-jb.png )
367
402
368
403
</p >
369
404
</details >
370
405
371
- ## (Legacy) UI-module
406
+ ## (Legacy) UI-module (View-based)
372
407
373
- > [ !NOTE ]
374
- > The legacy view based UI will be deprecated in the future. Please consider moving to the compose based UI .
375
- > For view based use cases please check out the [ ComposeView ] ( https://developer.android.com/develop/ui/compose/migrate/interoperability-apis/compose-in-views ) provided by Compose .
376
- > Alternatively, the legacy module will be supported as long as the ` core ` data format isn't changed. Generally newer versions of the gradle plugin are compatible with older
377
- > versions of the ui modules.
408
+ > [ !WARNING ]
409
+ > ** Deprecated: ** The legacy View- based UI module ( ` com.mikepenz:aboutlibraries ` ) is deprecated and will receive limited support .
410
+ > Please migrate to the [ Compose UI module ] ( #ui-module-compose ) .
411
+ > For embedding Compose in Views, consider using [ ComposeView ] ( https://developer.android.com/develop/ui/compose/migrate/interoperability-apis/compose-in-views ) .
412
+ > While newer Gradle plugin versions * might * be compatible with older UI modules regarding the data format, migration is strongly recommended .
378
413
379
414
``` gradle
380
- implementation("com.mikepenz:aboutlibraries:${latestAboutLibsRelease}")
415
+ // build.gradle.kts
416
+ // Recommended: Using version catalog
417
+ implementation(libs.aboutlibraries.view)
418
+
419
+ // Alternative: Direct dependency declaration
420
+ // implementation("com.mikepenz:aboutlibraries:${latestAboutLibsRelease}")
381
421
```
382
422
383
- <details ><summary ><b >Usage</b ></summary >
423
+ <details ><summary ><b >Legacy Usage</b ></summary >
384
424
<p >
385
425
386
426
### Usage
@@ -460,49 +500,40 @@ Create a custom style for the AboutLibraries UI.
460
500
</p >
461
501
</details >
462
502
463
- ## Enterprise
503
+ ## Enterprise / Manual JSON Handling
464
504
465
- Since v10 of the AboutLibraries plugin it is possible to disable the automatic registration of the plugin task as part of the build system .
505
+ For environments requiring full control over the included ` aboutlibraries.json ` (e.g., manual verification, CI generation), you can disable automatic task registration and handle generation manually .
466
506
467
507
``` kts
508
+ // build.gradle.kts
468
509
aboutLibraries {
469
510
android {
470
- // Disable the automatic task
511
+ // Disable automatic task registration for Android builds
471
512
registerAndroidTasks = false
472
513
}
473
514
export {
474
- // Define the output path (including fileName)
515
+ // Define the output path for manual generation
516
+ // Adjust the path based on your project structure (e.g., composeResources, Android res/raw)
475
517
outputFile = file(" src/commonMain/composeResources/files/aboutlibraries.json" )
476
- variant = " release" // Optional, if not set the default variant will be used
518
+ // Optionally specify the variant for export
519
+ // variant = "release"
477
520
}
478
521
}
479
522
```
480
523
481
- This is especially beneficial for enterprise environments where it is required to be in full control of the included ` aboutlibraries.json ` .
482
- After disabling the integration it is possible to manually update the definitions, or do it on your CI environment.
524
+ Generate the file manually using the Gradle task:
483
525
484
526
``` bash
485
- # Generate using the configured location
486
- ./gradlew app:exportLibraryDefinitions
487
- # Generate providing a custom path and variant
488
- ./gradlew app:exportLibraryDefinitions -PaboutLibraries.outputFile=src/main/res/raw/libraries.json -PaboutLibraries.exportVariant=release
489
- ```
490
-
491
- This generated file can be either included in your SCM, and every build will use this exact verified and approved state.
492
- Additionally, this helps to ensure no issues occur during the apps delivery phase, as the respective file is already generated and included.
527
+ # Generate using the configured location and variant
528
+ ./gradlew :app:exportLibraryDefinitions
493
529
494
- The library offers complete customisation for this behavior and location or name for the generated files can be adjusted as needed.
495
- A full compose code example providing the ` Libs ` manually:
496
-
497
- ``` kotlin
498
- LibrariesContainer (
499
- librariesBlock = { ctx ->
500
- Libs .Builder ().withJson(ctx, R .raw.aboutlibraries).build()
501
- }
502
- )
530
+ # Generate providing a custom path and variant override
531
+ ./gradlew :app:exportLibraryDefinitions -PaboutLibraries.outputFile=src/main/res/raw/libraries.json -PaboutLibraries.exportVariant=release
503
532
```
504
533
505
- ## Gradle API
534
+ Commit the generated ` aboutlibraries.json ` to your SCM. The library will then need to load this file manually. See details in [ Usage] ( #usage ) .
535
+
536
+ ## Gradle API / Tasks
506
537
507
538
By default, the gradle plugin is automatically executed for Android projects, generating the library
508
539
metadata where it's automatically discovered by the ` ui ` modules.
0 commit comments