From 535e877eb0c1fecc8541610668ff98cac888de9e Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Thu, 13 Jun 2019 09:52:24 +0300 Subject: [PATCH] Fixed mpp deploy to artifactory --- buildSrc/src/main/kotlin/npm-publish.gradle.kts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/buildSrc/src/main/kotlin/npm-publish.gradle.kts b/buildSrc/src/main/kotlin/npm-publish.gradle.kts index 851348ba..054bf034 100644 --- a/buildSrc/src/main/kotlin/npm-publish.gradle.kts +++ b/buildSrc/src/main/kotlin/npm-publish.gradle.kts @@ -5,6 +5,7 @@ import groovy.lang.GroovyObject import org.gradle.api.publish.maven.internal.artifact.FileBasedMavenArtifact import org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig import org.jfrog.gradle.plugin.artifactory.dsl.ResolverConfig +import org.jfrog.gradle.plugin.artifactory.task.ArtifactoryTask // Old bintray.gradle script converted to real Gradle plugin (precompiled script plugin) // It now has own dependencies and support type safe accessors @@ -134,3 +135,19 @@ artifactory { }) }) } + +// Fixed module artifact uploading to artifactory +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" + }) + } + } + } +}