Use kotlin 1.4.32, set version to 0.5.2-SNAPSHOT, remove bintray settings. (#18)

This commit is contained in:
Fabrice Drouin 2021-04-08 10:12:36 +02:00 committed by GitHub
parent 0751d7c103
commit b23733d5d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,8 +9,8 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.dokka.Platform
plugins {
kotlin("multiplatform") version "1.4.31"
id("org.jetbrains.dokka") version "1.4.20"
kotlin("multiplatform") version "1.4.32"
id("org.jetbrains.dokka") version "1.4.30"
`maven-publish`
}
@ -23,13 +23,13 @@ buildscript {
dependencies {
classpath("com.android.tools.build:gradle:4.0.2")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.4.20")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.4.30")
}
}
allprojects {
group = "fr.acinq.secp256k1"
version = "0.5.1"
version = "0.5.2-SNAPSHOT"
repositories {
jcenter()
@ -112,19 +112,6 @@ allprojects {
}
}
// Publication
val bintrayRepo = if (project.version.toString().contains("SNAPSHOT")) "snapshots" else "libs"
val bintrayUsername: String? = (properties["bintrayUsername"] as String?) ?: System.getenv("BINTRAY_USER")
val bintrayApiKey: String? = (properties["bintrayApiKey"] as String?) ?: System.getenv("BINTRAY_APIKEY")
val hasBintray = bintrayUsername != null && bintrayApiKey != null
if (!hasBintray) logger.warn("Skipping bintray configuration as bintrayUsername or bintrayApiKey is not defined")
val sonatypeUsername: String? = (properties["sonatypeUsername"] as String?) ?: System.getenv("SONATYPE_USERNAME")
val sonatypePassword: String? = (properties["sonatypePassword"] as String?) ?: System.getenv("SONATYPE_PASSWORD")
val hasSonatype = sonatypeUsername != null && sonatypePassword != null
if (!hasSonatype) logger.warn("Skipping sonatype snapshot configuration as sonatypeUsername or sonatypePassword is not defined")
allprojects {
val javadocJar = tasks.create<Jar>("javadocJar") {
archiveClassifier.set("javadoc")
@ -134,30 +121,6 @@ allprojects {
// Publication
plugins.withId("maven-publish") {
publishing {
repositories {
if (hasBintray) {
maven {
name = "bintray"
setUrl("https://api.bintray.com/maven/acinq/$bintrayRepo/${rootProject.name}/;publish=0")
credentials {
username = bintrayUsername
password = bintrayApiKey
}
}
}
if (hasSonatype) {
maven {
name = "snapshot"
setUrl("https://oss.sonatype.org/content/repositories/snapshots")
credentials {
username = sonatypeUsername
password = sonatypePassword
}
}
}
}
publications.withType<MavenPublication>().configureEach {
version = project.version.toString()
artifact(javadocJar)
@ -224,32 +187,6 @@ allprojects {
}
}
if (hasBintray) {
val postBintrayPublish by tasks.creating {
doLast {
HttpClients.createDefault().use { client ->
val post = HttpPost("https://api.bintray.com/content/acinq/$bintrayRepo/${rootProject.name}/${project.version.toString()}/publish").apply {
entity = StringEntity("{}", ContentType.APPLICATION_JSON)
addHeader(BasicScheme().authenticate(UsernamePasswordCredentials(bintrayUsername, bintrayApiKey), this, null))
}
client.execute(post)
}
}
}
val postBintrayDiscard by tasks.creating {
doLast {
HttpClients.createDefault().use { client ->
val post = HttpPost("https://api.bintray.com/content/acinq/$bintrayRepo/${rootProject.name}/${project.version.toString()}/publish").apply {
entity = StringEntity("{ \"discard\": true }", ContentType.APPLICATION_JSON)
addHeader(BasicScheme().authenticate(UsernamePasswordCredentials(bintrayUsername, bintrayApiKey), this, null))
}
client.execute(post)
}
}
}
}
allprojects {
afterEvaluate {
tasks.withType<AbstractTestTask>() {