diff -r 33ee5f3d6466 -r f1e51fe391c2 docs/license-sources.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/license-sources.md Mon May 05 17:10:13 2025 -0400 @@ -0,0 +1,62 @@ +License sources +=============== + +Setup +===== + +Add the dependency to your project + +```kotlin title="build.gradle.kts" +dependencies { + implementation("com.geekorum.aboutoss:core:") +} +``` + +OSS Licenses Gradle Plugin +-------------------------- + +The [OSS Licenses Gradle Plugin](https://github.com/google/play-services-plugins/tree/main/oss-licenses-plugin) stores license information in Android resources. + +Create a [GmsLicenseInfoRepository](api/core/com.geekorum.aboutoss.core.gms/-gms-license-info-repository/index.html) to retrieves it. + +The `GmsLicenseInfoRepository` is only available on Android platform. + +```kotlin + val licenseInfoRepository = GmsLicenseInfoRepository( + appContext = application + ) +``` + + +Licensee +-------- + +[licensee](https://github.com/cashapp/licensee) report file can be used as a source of license information. + +Create a [LicenseeLicenseInfoRepository](api/core/com.geekorum.aboutoss.core.licensee/-licensee-license-info-repository/index.html) to read the report file. + + +```kotlin title="on iOS and Desktop" +val licenseInfoRepository = LicenseeLicenseInfoRepository() +``` + +```kotlin title="on Android" +val licenseInfoRepository = LicenseeLicenseInfoRepository( + assetManager = application.assets +) +``` + +LicensePlist +------------ + +On iOS, [LicensePlist](https://github.com/mono0926/LicensePlist) can be use to automatically generates a Plist of all your dependencies. + +Use [LicensePlistLicenseInfoRepository](api/core/com.geekorum.aboutoss.core.licenseplist/-license-plist-license-info-repository/index.html) +to parse license information stored in your resources bundle. + +The `LicensePlistLicenseInfoRepository` is only available on iOS platform. + +```kotlin +val licenseInfoRepository = LicensePlistLicenseInfoRepository() +``` +