buildSrc/src/main/kotlin/MavenPublish.kt
changeset 68 f6133d9381b2
child 69 6cbc53dffd7a
equal deleted inserted replaced
67:581f0b7dc09d 68:f6133d9381b2
       
     1 /*
       
     2  * AboutOss is a utility library to retrieve and display
       
     3  * opensource licenses in Android applications.
       
     4  *
       
     5  * Copyright (C) 2023-2025 by Frederic-Charles Barthelery.
       
     6  *
       
     7  * This file is part of AboutOss.
       
     8  *
       
     9  * AboutOss is free software: you can redistribute it and/or modify
       
    10  * it under the terms of the GNU General Public License as published by
       
    11  * the Free Software Foundation, either version 3 of the License, or
       
    12  * (at your option) any later version.
       
    13  *
       
    14  * AboutOss is distributed in the hope that it will be useful,
       
    15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    17  * GNU General Public License for more details.
       
    18  *
       
    19  * You should have received a copy of the GNU General Public License
       
    20  * along with AboutOss.  If not, see <http://www.gnu.org/licenses/>.
       
    21  */
       
    22 package com.geekorum.build
       
    23 
       
    24 import com.vanniktech.maven.publish.MavenPublishBaseExtension
       
    25 import com.vanniktech.maven.publish.MavenPublishPlugin
       
    26 import org.gradle.api.Project
       
    27 import org.gradle.kotlin.dsl.apply
       
    28 import org.gradle.kotlin.dsl.configure
       
    29 
       
    30 internal fun Project.configureMavenPublish() {
       
    31     apply<MavenPublishPlugin>()
       
    32 
       
    33     configure<MavenPublishBaseExtension>() {
       
    34 //        TODO
       
    35 //        publishToMavenCentral(SonatypeHost.DEFAULT)
       
    36 //        signAllPublications()
       
    37 
       
    38         // default pom info. each field can be overridden in specific project
       
    39         pom {
       
    40             name.set(project.name)
       
    41             description.set("A library to retrieve and display opensource licenses in applications")
       
    42             inceptionYear.set("2023")
       
    43             val githubUrl = "https://github.com/fbarthelery/AboutOss/"
       
    44             url.set(githubUrl)
       
    45             scm {
       
    46                 url.set(githubUrl)
       
    47                 connection.set("scm:git:$githubUrl.git")
       
    48             }
       
    49 
       
    50             licenses {
       
    51                 license {
       
    52                     name.set("GPL-3.0-or-later")
       
    53                     url.set("https://www.gnu.org/licenses/gpl-3.0.html")
       
    54                     distribution.set("repo")
       
    55                 }
       
    56             }
       
    57 
       
    58             developers {
       
    59                 developer {
       
    60                     id.set("da_risk")
       
    61                     name.set("Frédéric Barthéléry")
       
    62                     email.set("da_risk@geekorum.com")
       
    63                 }
       
    64             }
       
    65         }
       
    66     }
       
    67 
       
    68 }