From d4cd4fd426120dd532343db6d6117f4aaa6c6036 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Wed, 26 Jun 2019 19:16:22 +0300 Subject: [PATCH] Build fix for deploy --- .../main/kotlin/npm-multiplatform.gradle.kts | 21 +++++++++++++++++++ .../src/main/kotlin/npm-publish.gradle.kts | 16 -------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/buildSrc/src/main/kotlin/npm-multiplatform.gradle.kts b/buildSrc/src/main/kotlin/npm-multiplatform.gradle.kts index 20b096ab8..7cf92afaf 100644 --- a/buildSrc/src/main/kotlin/npm-multiplatform.gradle.kts +++ b/buildSrc/src/main/kotlin/npm-multiplatform.gradle.kts @@ -1,3 +1,7 @@ +import com.jfrog.bintray.gradle.tasks.BintrayUploadTask +import org.gradle.api.publish.maven.internal.artifact.FileBasedMavenArtifact +import org.jfrog.gradle.plugin.artifactory.task.ArtifactoryTask + plugins { kotlin("multiplatform") `maven-publish` @@ -80,3 +84,20 @@ kotlin { } } + +//workaround for bintray and artifactory +project.tasks.filter { it is ArtifactoryTask || it is BintrayUploadTask }.forEach { + it.doFirst { + project.configure { + publications.filterIsInstance() + .forEach { publication -> + val moduleFile = project.buildDir.resolve("publications/${publication.name}/module.json") + if (moduleFile.exists()) { + publication.artifact(object : FileBasedMavenArtifact(moduleFile) { + override fun getDefaultExtension() = "module" + }) + } + } + } + } +} diff --git a/buildSrc/src/main/kotlin/npm-publish.gradle.kts b/buildSrc/src/main/kotlin/npm-publish.gradle.kts index 175f15f0b..ee55b996f 100644 --- a/buildSrc/src/main/kotlin/npm-publish.gradle.kts +++ b/buildSrc/src/main/kotlin/npm-publish.gradle.kts @@ -93,22 +93,6 @@ bintray { } } -//workaround for bintray -tasks.withType { - doFirst { - publishing.publications - .filterIsInstance() - .forEach { publication -> - val moduleFile = buildDir.resolve("publications/${publication.name}/module.json") - if (moduleFile.exists()) { - publication.artifact(object : FileBasedMavenArtifact(moduleFile) { - override fun getDefaultExtension() = "module" - }) - } - } - } -} - artifactory { val artifactoryUser: String? by project val artifactoryPassword: String? by project