apply plugin: 'maven-publish'
apply plugin: 'signing'

group = PUBLISH_GROUP_ID
version = PUBLISH_VERSION

afterEvaluate {
    publishing {
        publications {
            release(MavenPublication) {
                from components.release

                groupId PUBLISH_GROUP_ID
                artifactId PUBLISH_ARTIFACT_ID
                version PUBLISH_VERSION

                pom {
                    name = PUBLISH_ARTIFACT_ID
                    description = 'Kotlin Android library that extends RecyclerView to support gestures like drag, drop and swipe, among others. It works with vertical, horizontal and grid lists.'
                    url = 'https://github.com/ernestoyaquello/DragDropSwipeRecyclerview'
                    licenses {
                        license {
                            name = 'The Apache License, Version 2.0'
                            url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                        }
                    }
                    developers {
                        developer {
                            id = 'ernestoyaquello'
                            name = 'Julio Ernesto Rodríguez Cabañas'
                            email = 'julioernesto90@gmail.com'
                        }
                    }
                    scm {
                        connection = 'scm:git:github.com/ernestoyaquello/DragDropSwipeRecyclerview.git'
                        developerConnection = 'scm:git:ssh://github.com/ernestoyaquello/DragDropSwipeRecyclerview.git'
                        url = 'https://github.com/ernestoyaquello/DragDropSwipeRecyclerview'
                    }
                }
            }
        }
    }
}

ext["signing.keyId"] = rootProject.ext["signing.keyId"]
ext["signing.password"] = rootProject.ext["signing.password"]
ext["signing.secretKeyRingFile"] = rootProject.ext["signing.secretKeyRingFile"]

signing {
    sign publishing.publications
}
