Fixed mpp deploy to artifactory

This commit is contained in:
Alexander Nozik 2019-06-13 09:52:24 +03:00
parent 4ae1f71a05
commit 535e877eb0

View File

@ -5,6 +5,7 @@ import groovy.lang.GroovyObject
import org.gradle.api.publish.maven.internal.artifact.FileBasedMavenArtifact import org.gradle.api.publish.maven.internal.artifact.FileBasedMavenArtifact
import org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig import org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig
import org.jfrog.gradle.plugin.artifactory.dsl.ResolverConfig 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) // Old bintray.gradle script converted to real Gradle plugin (precompiled script plugin)
// It now has own dependencies and support type safe accessors // It now has own dependencies and support type safe accessors
@ -134,3 +135,19 @@ artifactory {
}) })
}) })
} }
// Fixed module artifact uploading to artifactory
tasks.withType<ArtifactoryTask> {
doFirst {
publishing.publications
.filterIsInstance<MavenPublication>()
.forEach { publication ->
val moduleFile = buildDir.resolve("publications/${publication.name}/module.json")
if (moduleFile.exists()) {
publication.artifact(object : FileBasedMavenArtifact(moduleFile) {
override fun getDefaultExtension() = "module"
})
}
}
}
}