From 291c2110635d2c17a78d4397fca3d541a326ba5b Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 13 Jan 2020 22:00:58 +0600 Subject: [PATCH] update publish script --- publish.gradle | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/publish.gradle b/publish.gradle index 477fed9..23bd45f 100644 --- a/publish.gradle +++ b/publish.gradle @@ -10,10 +10,21 @@ bintray { user = project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER') key = project.hasProperty('BINTRAY_KEY') ? project.property('BINTRAY_KEY') : System.getenv('BINTRAY_KEY') filesSpec { - from "${buildDir}/publications/kotlinMultiplatform/" - include "module.json" - rename "module\\.json", "${project.name}-${project.version}.module" - into "${projectBintrayDir}" + from "${buildDir}/publications/" + eachFile { + if (it.getName() == "module.json") { + File file = it.getFile() + String directorySubname = file.parentFile.name + if (directorySubname == "kotlinMultiplatform") { + it.setPath("${project.name}/${project.version}/${project.name}-${project.version}.module") + } else { + it.setPath("${project.name}-${directorySubname}/${project.version}/${project.name}-${directorySubname}-${project.version}.module") + } + } else { + it.exclude() + } + } + into "${project.group}".replace(".", "/") } pkg { repo = "InsanusMokrassar"