config/android-maven-publication.gradle
author fbarthelery <da_risk@geekorum.com>
Sat, 11 Dec 2021 00:24:26 -0400
changeset 29 d9ad9e5c05fd
parent 6 99ad8c14fec2
child 20 5d8a0555733d
permissions -rw-r--r--
Create jitpack.yml

/*
 * Geekdroid is a utility library for development on the Android
 * Platform.
 *
 * Copyright (C) 2017-2020 by Frederic-Charles Barthelery.
 *
 * This file is part of Geekdroid.
 *
 * Geekdroid is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Geekdroid is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Geekdroid.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * This configuration allows to publish android libraries into a maven repository.
 * You need to define in your build.gradle the following variables :
 * version = "1.0"                // the version of your projects
 * ext.artifactId="geny-widgets"  // the maven artifact id
 * Use ./gradlew tasks to see the name of the publishing tasks.
 */
if (plugins.hasPlugin("com.android.library")) {

    apply plugin: 'maven-publish'

    if (!project.ext.properties.containsKey("artifactId")) {
        ext.artifactId = project.name
    }

    publishing {
        publications {
            projectRelease(MavenPublication) {
                artifactId project.artifactId
                artifact "build/outputs/aar/${project.archivesBaseName}-release.aar"
            }

            projectSnapshot(MavenPublication) {
                artifactId project.artifactId
                artifact "build/outputs/aar/${project.archivesBaseName}-debug.aar"
                version getVersion() + "-SNAPSHOT"
            }
        }
    }
}