Build fix for deploy

This commit is contained in:
Alexander Nozik 2019-06-26 19:16:22 +03:00
parent 11bbdce94b
commit d4cd4fd426
2 changed files with 21 additions and 16 deletions

View File

@ -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 { plugins {
kotlin("multiplatform") kotlin("multiplatform")
`maven-publish` `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<PublishingExtension> {
publications.filterIsInstance<MavenPublication>()
.forEach { publication ->
val moduleFile = project.buildDir.resolve("publications/${publication.name}/module.json")
if (moduleFile.exists()) {
publication.artifact(object : FileBasedMavenArtifact(moduleFile) {
override fun getDefaultExtension() = "module"
})
}
}
}
}
}

View File

@ -93,22 +93,6 @@ bintray {
} }
} }
//workaround for bintray
tasks.withType<BintrayUploadTask> {
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"
})
}
}
}
}
artifactory { artifactory {
val artifactoryUser: String? by project val artifactoryUser: String? by project
val artifactoryPassword: String? by project val artifactoryPassword: String? by project