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

afterEvaluate {
    publishing {
        publications {
            release(MavenPublication) {
                from components.release
                groupId "com.bio-matic"
                artifactId PUBLISH_ARTIFACT_ID
                version sdkVersion

                pom {
                    name = PUBLISH_ARTIFACT_ID
                    description = "SegmentedArcView"
                    url = "https://github.com/edgar-zigis/SegmentedArcView"
                    licenses {
                        license {
                            name = "MIT License"
                            url = "http://www.opensource.org/licenses/mit-license.php"
                        }
                    }
                    developers {
                        developer {
                            id = "biomatic"
                            name = "Edgar Žigis"
                            email = "admin@bio-matic.com"
                        }
                    }
                    scm {
                        connection = "scm:git:github.com/edgar-zigis/SegmentedArcView.git"
                        developerConnection = "scm:git:ssh://github.com/edgar-zigis/SegmentedArcView.git"
                        url = "https://github.com/edgar-zigis/SegmentedArcView/tree/master"
                    }
                }
            }
        }
    }
}

signing {
    useInMemoryPgpKeys(
            rootProject.ext["mavenSigningKeyId"],
            rootProject.ext["mavenSigningKey"],
            rootProject.ext["mavenSigningKeyPassword"],
    )
    sign publishing.publications
}