buildSrc/src/main/kotlin/Dokka.kt
author Da Risk <da_risk@geekorum.com>
Mon, 05 May 2025 03:37:00 -0400
changeset 80 2474591aa280
parent 73 1b1779baa28f
child 84 f1e51fe391c2
permissions -rw-r--r--
ui:common: add more kdocs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
73
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     1
/*
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     2
 * AboutOss is a utility library to retrieve and display
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     3
 * opensource licenses in Android applications.
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     4
 *
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     5
 * Copyright (C) 2023-2025 by Frederic-Charles Barthelery.
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     6
 *
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     7
 * This file is part of AboutOss.
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     8
 *
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     9
 * AboutOss is free software: you can redistribute it and/or modify
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    10
 * it under the terms of the GNU General Public License as published by
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    11
 * the Free Software Foundation, either version 3 of the License, or
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    12
 * (at your option) any later version.
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    13
 *
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    14
 * AboutOss is distributed in the hope that it will be useful,
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    17
 * GNU General Public License for more details.
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    18
 *
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    19
 * You should have received a copy of the GNU General Public License
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    20
 * along with AboutOss.  If not, see <http://www.gnu.org/licenses/>.
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    21
 */
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    22
package com.geekorum.build
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    23
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    24
import org.gradle.api.Project
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    25
import org.gradle.kotlin.dsl.apply
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    26
import org.gradle.kotlin.dsl.assign
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    27
import org.gradle.kotlin.dsl.configure
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    28
import org.jetbrains.dokka.gradle.DokkaExtension
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    29
import org.jetbrains.dokka.gradle.DokkaPlugin
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    30
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    31
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    32
internal fun Project.configureDokka() {
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    33
    apply<DokkaPlugin>()
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    34
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    35
    configure<DokkaExtension> {
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    36
        dokkaSourceSets.configureEach {
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    37
            reportUndocumented = true
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    38
            sourceLink {
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    39
                localDirectory = rootDir
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    40
                remoteUrl = uri("https://github.com/fbarthelery/AboutOss/tree/main/")
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    41
            }
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    42
        }
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    43
    }
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    44
1b1779baa28f build: configure dokka conventions
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    45
}