License sources
The library can work with license information files generated by:
Setup
Add the dependency to your project
build.gradle.kts
dependencies {
implementation("com.geekorum.aboutoss:core:<latest-version>")
}
OSS Licenses Gradle Plugin
The OSS Licenses Gradle Plugin stores license information in Android resources.
Create a GmsLicenseInfoRepository to retrieves it.
The GmsLicenseInfoRepository is only available on Android platform.
val licenseInfoRepository = GmsLicenseInfoRepository(
appContext = application
)
Licensee
licensee report file can be used as a source of license information.
Create a LicenseeLicenseInfoRepository to read the report file.
on iOS and Desktop
val licenseInfoRepository = LicenseeLicenseInfoRepository()
on Android
val licenseInfoRepository = LicenseeLicenseInfoRepository(
assetManager = application.assets
)
LicensePlist (Experimental)
On iOS, LicensePlist can be use to automatically generates a Plist of all your dependencies.
Use LicensePlistLicenseInfoRepository to parse license information stored in your resources bundle.
The LicensePlistLicenseInfoRepository is only available on iOS platform.
val licenseInfoRepository = LicensePlistLicenseInfoRepository()