Ensure that all kotlin files have a license header
This commit is contained in:
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -30,5 +30,5 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
|
||||
- name: Build Debug APK
|
||||
run: ./gradlew clean check assembleRelease --no-daemon
|
||||
- name: Run Gradle
|
||||
run: ./gradlew clean license check assembleRelease --no-daemon
|
||||
|
||||
13
LICENSE_HEADER
Normal file
13
LICENSE_HEADER
Normal file
@@ -0,0 +1,13 @@
|
||||
Copyright 2025 Pierre-Yves Nicolas
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation, either version 3 of the License, or (at your option)
|
||||
any later version.
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
[versions]
|
||||
agp = "8.9.2"
|
||||
kotlin = "2.1.0"
|
||||
license = "0.16.1"
|
||||
coreKtx = "1.16.0"
|
||||
junit = "4.13.2"
|
||||
junitVersion = "1.2.1"
|
||||
@@ -50,4 +51,5 @@ assertj = { group="org.assertj", name="assertj-core", version.ref = "assertj" }
|
||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
||||
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
|
||||
license = { id = "com.github.hierynomus.license", version.ref = "license" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user