buildSrc/src/main/kotlin/source-license-checker.gradle.kts
author Da Risk <da_risk@geekorum.com>
Wed, 03 Jan 2024 15:26:40 -0400
changeset 1174 731f6ee517b6
parent 943 298742859784
child 1370 13e39ef920a8
permissions -rw-r--r--
update license headers
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
137
5464f07a306c Update copyright headers for 2019
Da Risk <da_risk@geekorum.com>
parents: 0
diff changeset
     1
/*
0
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     2
 * Geekttrss is a RSS feed reader application on the Android Platform.
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     3
 *
1174
731f6ee517b6 update license headers
Da Risk <da_risk@geekorum.com>
parents: 943
diff changeset
     4
 * Copyright (C) 2017-2024 by Frederic-Charles Barthelery.
0
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     5
 *
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     6
 * This file is part of Geekttrss.
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     7
 *
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     8
 * Geekttrss is free software: you can redistribute it and/or modify
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     9
 * it under the terms of the GNU General Public License as published by
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    10
 * the Free Software Foundation, either version 3 of the License, or
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    11
 * (at your option) any later version.
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    12
 *
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    13
 * Geekttrss is distributed in the hope that it will be useful,
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    16
 * GNU General Public License for more details.
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    17
 *
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    18
 * You should have received a copy of the GNU General Public License
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    19
 * along with Geekttrss.  If not, see <http://www.gnu.org/licenses/>.
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    20
 */
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    21
package com.geekorum.build
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    22
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    23
/**
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    24
 * You need to define a License header file in "$rootDir/config/license/header.txt"
525
e884f73f9eef build: update source-licence-checker and enable it with a flag on ci build only
Da Risk <da_risk@geekorum.com>
parents: 137
diff changeset
    25
 * Define the following property to enable check of license headers
e884f73f9eef build: update source-licence-checker and enable it with a flag on ci build only
Da Risk <da_risk@geekorum.com>
parents: 137
diff changeset
    26
 *    - CHECK_LICENSE_HEADERS : true or false. default is false
0
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    27
 */
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    28
525
e884f73f9eef build: update source-licence-checker and enable it with a flag on ci build only
Da Risk <da_risk@geekorum.com>
parents: 137
diff changeset
    29
val checkLicenseHeadersString = findProperty("CHECK_LICENSE_HEADERS") as String?
e884f73f9eef build: update source-licence-checker and enable it with a flag on ci build only
Da Risk <da_risk@geekorum.com>
parents: 137
diff changeset
    30
val checkLicenseHeader =  checkLicenseHeadersString?.toBoolean() ?: false
e884f73f9eef build: update source-licence-checker and enable it with a flag on ci build only
Da Risk <da_risk@geekorum.com>
parents: 137
diff changeset
    31
e884f73f9eef build: update source-licence-checker and enable it with a flag on ci build only
Da Risk <da_risk@geekorum.com>
parents: 137
diff changeset
    32
if (checkLicenseHeader) {
e884f73f9eef build: update source-licence-checker and enable it with a flag on ci build only
Da Risk <da_risk@geekorum.com>
parents: 137
diff changeset
    33
    configureSourceLicenseChecker()
e884f73f9eef build: update source-licence-checker and enable it with a flag on ci build only
Da Risk <da_risk@geekorum.com>
parents: 137
diff changeset
    34
}