Displaying used open source libraries and their licenses not only shows appreciations for the effort of library authors, but they could be also license requirements of those libraries. Apps are responsible for appropriately displaying the notices for the open source libraries, and this Gradle plugin automates this process by collecting the licenses from libraries and generates the source code for apps to display.
Xuke comes from 许可 (License in Chinese)
Add the following scripts to your Gradle scripts:
plugins {
id("io.github.chao2zhang.xuke")
}
configure<XukeExtension> {
// The Gradle build configurations from which we collect dependencies
configurations.set(listOf("runtimeClasspath"))
// The output file of the licenses collected - Only supporting .kt file as of now
outputFile.set(project.layout.buildDirectory.file("generated/license/SoftwareLicense.kt"))
// The output package name of the output file
outputPackage.set("io.github.chao2zhang.example")
}
Now you can run Gradle task xuke
to generate the sources.