Skip to content

Commit

Permalink
Update to Kotlin 1.4 create IR and non IR builds (#69)
Browse files Browse the repository at this point in the history
Add a workaround for publishing to bintray with gradle metadata
see bintray/gradle-bintray-plugin#229
  • Loading branch information
fkrauthan committed Oct 16, 2020
1 parent 7dfd421 commit 3f33911
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
30 changes: 22 additions & 8 deletions build.gradle.kts
@@ -1,44 +1,58 @@
import com.jfrog.bintray.gradle.BintrayExtension
import com.jfrog.bintray.gradle.tasks.BintrayUploadTask
import org.gradle.api.publish.maven.internal.artifact.FileBasedMavenArtifact

plugins {
kotlin("js") version "1.3.71"
kotlin("js") version "1.4.10"
`maven-publish`
id("com.jfrog.bintray") version "1.8.1"
id("com.jfrog.bintray") version "1.8.5"
}

repositories {
jcenter()
}

dependencies {
implementation(kotlin("stdlib-js"))
testImplementation(kotlin("test-js"))
}

group = "ch.delconte.screeps-kotlin"

kotlin {
target {
js(BOTH) {
useCommonJs()
nodejs()
}
}


val kotlinSourcesJar by tasks

publishing {
publications {
register("kotlin", MavenPublication::class) {
register<MavenPublication>("kotlin") {
from(components["kotlin"])
artifact(kotlinSourcesJar)
artifact(tasks.getByName<Zip>("jsLegacySourcesJar"))
}
}
}

val bintrayUser: String? by project
val bintrayApiKey: String? by project

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 = bintrayUser ?: ""
key = bintrayApiKey ?: ""
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 3f33911

Please sign in to comment.