config/android-maven-publication.gradle
author Da Risk <da_risk@geekorum.com>
Tue, 29 Nov 2022 17:53:25 -0400
changeset 24 45a1084ed99c
parent 20 5d8a0555733d
child 31 0e233781410b
permissions -rw-r--r--
geekdroid: remove deprecated PreferenceSummaryBinder

/*
 * Geekdroid is a utility library for development on the Android
 * Platform.
 *
 * Copyright (C) 2017-2022 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"
            }
        }
    }
}