Skip to content

Commit

Permalink
Introduce workaround for publishing artifact to bintray while preserv…
Browse files Browse the repository at this point in the history
  • Loading branch information
Schahen committed Aug 7, 2020
1 parent 8551200 commit 2691521
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions kotlinx-nodejs/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import com.jfrog.bintray.gradle.BintrayExtension
import com.jfrog.bintray.gradle.tasks.BintrayUploadTask
import org.gradle.api.publish.maven.internal.artifact.FileBasedMavenArtifact

plugins {
id("org.jetbrains.kotlin.js")
Expand Down Expand Up @@ -45,6 +47,21 @@ publishing {
}
}

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"
})
}
}
}
}

bintray {
user = System.getenv("BINTRAY_USER")
key = System.getenv("BINTRAY_API_KEY")
Expand Down

0 comments on commit 2691521

Please sign in to comment.