| author | Da Risk <da_risk@geekorum.com> |
| Thu, 03 Oct 2019 13:07:28 -0700 | |
| changeset 506 | 78d98b656c2f |
| parent 137 | 5464f07a306c |
| child 611 | 91b8d76c03cd |
| 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 |
* |
|
|
137
5464f07a306c
Update copyright headers for 2019
Da Risk <da_risk@geekorum.com>
parents:
0
diff
changeset
|
4 |
* Copyright (C) 2017-2019 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 |
|
26 |
import nl.javadude.gradle.plugins.license.LicenseExtension |
|
27 |
import nl.javadude.gradle.plugins.license.LicensePlugin |
|
28 |
import org.gradle.api.Project |
|
29 |
import org.gradle.api.Task |
|
30 |
import org.gradle.kotlin.dsl.apply |
|
31 |
import org.gradle.kotlin.dsl.configure |
|
32 |
import org.gradle.kotlin.dsl.invoke |
|
33 |
import org.gradle.kotlin.dsl.named |
|
34 |
||
35 |
internal fun Project.configureSourceLicenseChecker(): Unit {
|
|
36 |
apply<LicensePlugin>() |
|
37 |
||
38 |
configure<LicenseExtension> {
|
|
39 |
header = file("$rootDir/config/license/header.txt")
|
|
40 |
||
41 |
excludes(listOf("**/*.webp", "**/*.png"))
|
|
42 |
} |
|
43 |
||
44 |
tasks {
|
|
45 |
val checkKotlinFilesLicenseTask = register("checkKotlinFilesLicense", LicenseCheck::class.java) {
|
|
46 |
source = fileTree("src").apply {
|
|
47 |
include("**/*.kt")
|
|
48 |
} |
|
49 |
} |
|
50 |
||
51 |
val formatKotlinFilesLicenseTask = register("formatKotlinFilesLicense", LicenseFormat::class.java) {
|
|
52 |
source = fileTree("src").apply {
|
|
53 |
include("**/*.kt")
|
|
54 |
} |
|
55 |
} |
|
56 |
||
57 |
named<Task>(LicenseBasePlugin.getLICENSE_TASK_BASE_NAME()) {
|
|
58 |
dependsOn(checkKotlinFilesLicenseTask) |
|
59 |
} |
|
60 |
||
61 |
named<Task>(LicenseBasePlugin.getFORMAT_TASK_BASE_NAME()) {
|
|
62 |
dependsOn(formatKotlinFilesLicenseTask) |
|
63 |
} |
|
64 |
||
65 |
} |
|
66 |
} |