Ensure that all kotlin files have a license header

This commit is contained in:
Pierre-Yves Nicolas
2025-06-06 08:27:32 +02:00
parent e9f5ec2cf0
commit 6388e96cc7
4 changed files with 37 additions and 3 deletions

View File

@@ -3,4 +3,23 @@ plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.compose) apply false
}
alias(libs.plugins.license)
}
license {
header = rootProject.file("LICENSE_HEADER")
exclude("**/*.xml")
//strictCheck = true
mapping("java", "SLASHSTAR_STYLE")
mapping("kt", "SLASHSTAR_STYLE")
}
// See https://github.com/hierynomus/license-gradle-plugin/issues/155
tasks.register("licenseCheckForKotlin", com.hierynomus.gradle.license.tasks.LicenseCheck::class) {
source = fileTree(project.projectDir) { include("**/*.kt") }
}
tasks["license"].dependsOn("licenseCheckForKotlin")
tasks.register("licenseFormatForKotlin", com.hierynomus.gradle.license.tasks.LicenseFormat::class) {
source = fileTree(project.projectDir) { include("**/*.kt") }
}
tasks["licenseFormat"].dependsOn("licenseFormatForKotlin")