1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

GoogleのOSS Licenses Gradle PluginをKotlin DSL環境に導入する

1
Posted at

サードパーティーライセンスを表示するためにGoogleのOSS Licenses Gradle Pluginを導入しようとしたのですが、公式の情報が古くなっていて少し手間取ったので最新(2025/01/13 現在)の環境向けに導入する方法を書いておきます。
 

下記の内容を追加することで
app/build/generated/third_party_licenses/[debug|release]/res/raw/third_party_licenses
と
app/build/generated/third_party_licenses/[debug|release]/res/raw/third_party_license_metadata
が生成されるようになりました。

‎build.gradle.kts
plugins {
    ...
}

+ buildscript {
+     repositories {
+         google()
+     }
+     dependencies {
+         classpath(libs.oss.licenses.plugin)
+     }
+ }
app/build.gradle.kts
plugins {
    ...
+   id("com.google.android.gms.oss-licenses-plugin")
}
...
dependencies {
    ...
+   implementation(libs.play.services.oss.licenses)
}
gradle/libs.versions.toml
[versions]
...
+ ossLicensesPlugin = "0.10.6"
+ playServicesOssLicenses = "17.1.0"

[libraries]
+ oss-licenses-plugin = { module = "com.google.android.gms:oss-licenses-plugin", version.ref = "ossLicensesPlugin" }
+ play-services-oss-licenses = { module = "com.google.android.gms:play-services-oss-licenses", version.ref = "playServicesOssLicenses" }
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?