From ad013bf4024d0e61e680217669481ae8a65f8c5a Mon Sep 17 00:00:00 2001 From: Tim Froehlich Date: Wed, 22 Apr 2026 15:33:29 +0000 Subject: [PATCH 1/2] docs(oss-licenses): trim README to avoid duplication with public docs --- oss-licenses-plugin/README.md | 80 +++-------------------------------- 1 file changed, 5 insertions(+), 75 deletions(-) diff --git a/oss-licenses-plugin/README.md b/oss-licenses-plugin/README.md index f7f82c58..2ff685da 100755 --- a/oss-licenses-plugin/README.md +++ b/oss-licenses-plugin/README.md @@ -1,81 +1,11 @@ # OSS Licenses Gradle Plugin -This Gradle plugin scans the POM dependencies of a project at compile time. -When a Maven POM exists for a direct dependency of the app, the plugin processes -the [``](https://maven.apache.org/pom.html#Licenses) element and -embeds the link and title of each license in an Android asset in the final app -APK. +This Gradle plugin scans the POM dependencies of a project at compile time and embeds license information in the final app APK. -For Google Play services dependencies, the license info is gathered from -third_party_licenses.json and third_party_licenses.txt files in the distributed -.aar. +For detailed instructions on how to add the plugin to your project, configure dependencies, and display license information using the SDK, please refer to the official documentation: -The plugin will generate two text files based on the gathered licenses info: +👉 **[Include open source notices](https://developers.google.com/android/guides/opensource)** - * third_party_licenses - * third_party_licenses_metadata +## Source Code and Contributing -and registers them as raw resources so that it can be consumed by the -play-services-oss-licenses library. - -## To Use - -### Add the Gradle plugin - -In your root-level `settings.gradle.kts` make sure you are using the -[Google Maven repository](https://developer.android.com/studio/build/dependencies#google-maven): - -```kotlin -pluginManagement { - repositories { - google() - } -} -``` - -In your app-level `build.gradle.kts`, apply the plugin by adding the following line -under the existing `id("com.android.application")` at the top of the -file: - -```kotlin -plugins { - id("com.google.android.gms.oss-licenses-plugin") version "0.11.0" -} -``` - -### Add the library to your app - -In the `dependencies` section of your app-level `build.gradle.kts`, add a dependency -on the `oss-licenses` library: - -```kotlin -implementation("com.google.android.gms:play-services-oss-licenses:17.0.0") -``` - -### Displaying license information - -When the application builds, the Gradle plugin will process the licenses and -add them to the app resources. To easily display them you can trigger an -activity provided by the `play-services-oss-licenses` library at an appropriate -point in your app: - -```java -import com.google.android.gms.oss.licenses.OssLicensesMenuActivity; - -// ... - -// When the user selects an option to see the licenses: -startActivity(new Intent(this, OssLicensesMenuActivity.class)); -``` - -This will display a list of open source libraries that are compiled into the -app, whether part of Google Play services or not. Tapping the library name will -display additional license information for that library. - -### Setting the `Activity` title - -You can also set the title of the displayed activity: - -```java -OssLicensesMenuActivity.setActivityTitle(getString(R.string.custom_license_title)); -``` +The source code for this plugin is hosted in this repository. For contributing guidelines or to report issues, please see the root project documentation. From ba718dce1e8bcae02eb0cc7bc0bf72bca802b356 Mon Sep 17 00:00:00 2001 From: Tim Froehlich Date: Thu, 23 Apr 2026 19:36:51 +0000 Subject: [PATCH 2/2] restore how it works section --- oss-licenses-plugin/README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/oss-licenses-plugin/README.md b/oss-licenses-plugin/README.md index 2ff685da..9b7f776c 100755 --- a/oss-licenses-plugin/README.md +++ b/oss-licenses-plugin/README.md @@ -1,6 +1,22 @@ # OSS Licenses Gradle Plugin -This Gradle plugin scans the POM dependencies of a project at compile time and embeds license information in the final app APK. +This Gradle plugin scans the POM dependencies of a project at compile time. +When a Maven POM exists for a direct dependency of the app, the plugin processes +the [``](https://maven.apache.org/pom.html#Licenses) element and +embeds the link and title of each license in an Android asset in the final app +APK. + +For Google Play services dependencies, the license info is gathered from +third_party_licenses.json and third_party_licenses.txt files in the distributed +.aar. + +The plugin will generate two text files based on the gathered licenses info: + + * third_party_licenses + * third_party_licenses_metadata + +and registers them as raw resources so that it can be consumed by the +play-services-oss-licenses library. For detailed instructions on how to add the plugin to your project, configure dependencies, and display license information using the SDK, please refer to the official documentation: