| author | Da Risk <da_risk@geekorum.com> |
| Fri, 08 May 2026 15:42:24 -0400 | |
| changeset 1416 | 1346d5bbc585 |
| parent 1370 | 13e39ef920a8 |
| permissions | -rw-r--r-- |
|
137
5464f07a306c
Update copyright headers for 2019
Da Risk <da_risk@geekorum.com>
parents:
0
diff
changeset
|
1 |
/* |
| 0 | 2 |
* Geekttrss is a RSS feed reader application on the Android Platform. |
3 |
* |
|
| 1370 | 4 |
* Copyright (C) 2017-2025 by Frederic-Charles Barthelery. |
| 0 | 5 |
* |
6 |
* This file is part of Geekttrss. |
|
7 |
* |
|
8 |
* Geekttrss is free software: you can redistribute it and/or modify |
|
9 |
* it under the terms of the GNU General Public License as published by |
|
10 |
* the Free Software Foundation, either version 3 of the License, or |
|
11 |
* (at your option) any later version. |
|
12 |
* |
|
13 |
* Geekttrss is distributed in the hope that it will be useful, |
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
* GNU General Public License for more details. |
|
17 |
* |
|
18 |
* You should have received a copy of the GNU General Public License |
|
19 |
* along with Geekttrss. If not, see <http://www.gnu.org/licenses/>. |
|
20 |
*/ |
|
21 |
package com.geekorum.build |
|
22 |
||
23 |
import com.hierynomus.gradle.license.LicenseBasePlugin |
|
24 |
import com.hierynomus.gradle.license.tasks.LicenseCheck |
|
25 |
import com.hierynomus.gradle.license.tasks.LicenseFormat |
|
|
1416
1346d5bbc585
build: fix SourceLicenseChecker not compatible with gradle configuration cache
Da Risk <da_risk@geekorum.com>
parents:
1370
diff
changeset
|
26 |
import nl.javadude.gradle.plugins.license.License |
| 0 | 27 |
import nl.javadude.gradle.plugins.license.LicenseExtension |
28 |
import nl.javadude.gradle.plugins.license.LicensePlugin |
|
29 |
import org.gradle.api.Project |
|
30 |
import org.gradle.api.Task |
|
31 |
import org.gradle.kotlin.dsl.apply |
|
32 |
import org.gradle.kotlin.dsl.configure |
|
33 |
import org.gradle.kotlin.dsl.invoke |
|
34 |
import org.gradle.kotlin.dsl.named |
|
|
1416
1346d5bbc585
build: fix SourceLicenseChecker not compatible with gradle configuration cache
Da Risk <da_risk@geekorum.com>
parents:
1370
diff
changeset
|
35 |
import org.gradle.kotlin.dsl.withType |
| 0 | 36 |
|
37 |
internal fun Project.configureSourceLicenseChecker(): Unit {
|
|
38 |
apply<LicensePlugin>() |
|
39 |
||
40 |
configure<LicenseExtension> {
|
|
41 |
header = file("$rootDir/config/license/header.txt")
|
|
|
846
ac0863af5ef6
build: update licence header check
Da Risk <da_risk@geekorum.com>
parents:
611
diff
changeset
|
42 |
mapping("java", "SLASHSTAR_STYLE")
|
|
ac0863af5ef6
build: update licence header check
Da Risk <da_risk@geekorum.com>
parents:
611
diff
changeset
|
43 |
mapping("kt", "SLASHSTAR_STYLE")
|
| 0 | 44 |
excludes(listOf("**/*.webp", "**/*.png"))
|
45 |
} |
|
46 |
||
47 |
tasks {
|
|
48 |
val checkKotlinFilesLicenseTask = register("checkKotlinFilesLicense", LicenseCheck::class.java) {
|
|
49 |
source = fileTree("src").apply {
|
|
50 |
include("**/*.kt")
|
|
51 |
} |
|
52 |
} |
|
53 |
||
54 |
val formatKotlinFilesLicenseTask = register("formatKotlinFilesLicense", LicenseFormat::class.java) {
|
|
55 |
source = fileTree("src").apply {
|
|
56 |
include("**/*.kt")
|
|
57 |
} |
|
58 |
} |
|
59 |
||
60 |
named<Task>(LicenseBasePlugin.getLICENSE_TASK_BASE_NAME()) {
|
|
61 |
dependsOn(checkKotlinFilesLicenseTask) |
|
62 |
} |
|
63 |
||
64 |
named<Task>(LicenseBasePlugin.getFORMAT_TASK_BASE_NAME()) {
|
|
65 |
dependsOn(formatKotlinFilesLicenseTask) |
|
66 |
} |
|
67 |
||
68 |
} |
|
|
1416
1346d5bbc585
build: fix SourceLicenseChecker not compatible with gradle configuration cache
Da Risk <da_risk@geekorum.com>
parents:
1370
diff
changeset
|
69 |
|
|
1346d5bbc585
build: fix SourceLicenseChecker not compatible with gradle configuration cache
Da Risk <da_risk@geekorum.com>
parents:
1370
diff
changeset
|
70 |
tasks.withType<License>().configureEach {
|
|
1346d5bbc585
build: fix SourceLicenseChecker not compatible with gradle configuration cache
Da Risk <da_risk@geekorum.com>
parents:
1370
diff
changeset
|
71 |
notCompatibleWithConfigurationCache("License tasks calls getProject() at execution time")
|
|
1346d5bbc585
build: fix SourceLicenseChecker not compatible with gradle configuration cache
Da Risk <da_risk@geekorum.com>
parents:
1370
diff
changeset
|
72 |
} |
|
1346d5bbc585
build: fix SourceLicenseChecker not compatible with gradle configuration cache
Da Risk <da_risk@geekorum.com>
parents:
1370
diff
changeset
|
73 |
|
| 0 | 74 |
} |