Skip to content

Commit

Permalink
Add a hack to push module metadata to bintray
Browse files Browse the repository at this point in the history
  • Loading branch information
araqnid committed Mar 24, 2020
1 parent b08ca06 commit 97b1a00
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = "org.araqnid.kotlin.arg-parser"
version = "0.0.1"
version = "0.0.2"

repositories {
jcenter()
Expand Down Expand Up @@ -52,6 +52,21 @@ kotlin {
dependencies {
}

tasks.withType<com.jfrog.bintray.gradle.tasks.BintrayUploadTask> {
doFirst {
publishing.publications
.filterIsInstance<MavenPublication>()
.forEach { publication ->
val moduleFile = buildDir.resolve("publications/${publication.name}/module.json")
if (moduleFile.exists()) {
publication.artifact(object : org.gradle.api.publish.maven.internal.artifact.FileBasedMavenArtifact(moduleFile) {
override fun getDefaultExtension() = "module"
})
}
}
}
}

bintray {
user = (project.properties["bintray.user"] ?: "").toString()
key = (project.properties["bintray.apiKey"] ?: "").toString()
Expand Down

0 comments on commit 97b1a00

Please sign in to comment.