From c395478222b29ae3e4ff97f97cd480b6032b8c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20B=C3=A4lz?= Date: Fri, 21 Sep 2018 20:28:41 +0200 Subject: [PATCH] Improve publish and upload --- build.gradle | 4 +++- native/build.gradle | 2 ++ publish.gradle | 18 +++++++++--------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 7a378a7..6ed1e20 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,7 @@ buildscript { // Global configuration for all Konclik library submodules def libs = ['native', 'jvm'] -configure(subprojects.findAll { libs.contains(it.name) }) { +configure(allprojects.findAll { libs.contains(it.name) }) { group 'de.dbaelz.konclik' version '0.5.0' @@ -44,6 +44,8 @@ configure(subprojects.findAll { libs.contains(it.name) }) { groupId project.group artifactId project.name version project.version + + generatePom(pom) } } } diff --git a/native/build.gradle b/native/build.gradle index 12d8504..79b3e43 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -5,3 +5,5 @@ components.main { outputKinds = [KLIBRARY] } + +bintrayUpload.dependsOn publishToMavenLocal diff --git a/publish.gradle b/publish.gradle index a00c16a..dc0fabe 100644 --- a/publish.gradle +++ b/publish.gradle @@ -10,18 +10,18 @@ def pomBaseData = { } } -afterEvaluate { - project.publishing.publications.forEach { publication -> - publication.pom.withXml { - def root = it.asNode() - root.appendNode('name', project.name) - root.appendNode('description', 'Kotlin/Native Command Line Interface Kit') - root.appendNode('url', 'https://github.com/dbaelz/Konclik') - root.children().last() + pomBaseData - } +def generatePom = { pom -> + pom.withXml { + def root = it.asNode() + root.appendNode('name', project.name) + root.appendNode('description', 'Kotlin/Native Command Line Interface Kit') + root.appendNode('url', 'https://github.com/dbaelz/Konclik') + root.children().last() + pomBaseData } } +ext.generatePom = generatePom + bintray { user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')