Skip to content

Commit

Permalink
Remove dev repositories and Bintray usages where applicable (Kotlin#2587
Browse files Browse the repository at this point in the history
)

* Remove dev repositories and Bintray usages where applicable
* Update our frontend example
* Update lincheck
* Temporary ignore MutexLincheckTest.modelCheckingTest
  • Loading branch information
qwwdfsad committed Apr 22, 2021
1 parent 44ebdef commit 347feed
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 56 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ suspend fun main() = coroutineScope {

## Using in your projects

The libraries are published to [kotlinx](https://bintray.com/kotlin/kotlinx/kotlinx.coroutines) bintray repository,
linked to [JCenter](https://bintray.com/bintray/jcenter?filterByPkgName=kotlinx.coroutines) and
pushed to [Maven Central](https://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.jetbrains.kotlinx%20a%3Akotlinx-coroutines*).

### Maven

Add dependencies (you can also add other modules that you need):
Expand Down
17 changes: 3 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,8 @@ buildscript {
}

repositories {
maven {url "https://kotlin.bintray.com/kotlinx"}
// Future replacement for kotlin-dev, with cache redirector
maven { url "https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
maven {
url "https://kotlin.bintray.com/kotlin-dev"
credentials {
username = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') ?: ""
password = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY') ?: ""
}
}
// Leftover until we migrated to Dokka 1.4.30
maven { url "https://kotlin.bintray.com/kotlin-dev" }
maven { url "https://jetbrains.bintray.com/kotlin-native-dependencies" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
Expand Down Expand Up @@ -151,9 +143,6 @@ allprojects {
*/
google()
mavenCentral()
// Future replacement for kotlin-dev, with cache redirector
maven { url "https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
maven { url "https://kotlin.bintray.com/kotlinx" }
}
}

Expand Down Expand Up @@ -244,7 +233,7 @@ configure(subprojects.findAll { !unpublished.contains(it.name) }) {
if (it.name != 'kotlinx-coroutines-bom') {
apply from: rootProject.file('gradle/dokka.gradle')
}
apply from: rootProject.file('gradle/publish-bintray.gradle')
apply from: rootProject.file('gradle/publish.gradle')
}

configure(subprojects.findAll { !unpublished.contains(it.name) }) {
Expand Down
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ repositories {
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev")
} else {
maven("https://plugins.gradle.org/m2")
// Leftover until we migrated to Dokka 1.4.30
maven("https://dl.bintray.com/kotlin/kotlin-dev")
}
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
Expand Down
14 changes: 0 additions & 14 deletions buildSrc/src/main/kotlin/Publishing.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,6 @@ fun configureMavenPublication(rh: RepositoryHandler, project: Project) {
}
}

fun configureBintrayPublication(rh: RepositoryHandler, project: Project) {
rh.maven {
val user = "kotlin"
val repo = "kotlinx"
val name = "kotlinx.coroutines"
url = URI("https://api.bintray.com/maven/$user/$repo/$name/;publish=0;override=0")

credentials {
username = project.findProperty("bintrayUser") as? String ?: System.getenv("BINTRAY_USER")
password = project.findProperty("bintrayApiKey") as? String ?: System.getenv("BINTRAY_API_KEY")
}
}
}

fun signPublicationIfKeyPresent(project: Project, publication: MavenPublication) {
val keyId = project.getSensitiveProperty("libs.sign.key.id")
val signingKey = project.getSensitiveProperty("libs.sign.key.private")
Expand Down
10 changes: 2 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ kotlin_version=1.5.0-RC
junit_version=4.12
atomicfu_version=0.15.2
knit_version=0.2.3
html_version=0.6.8
lincheck_version=2.10
html_version=0.7.2
lincheck_version=2.12
dokka_version=0.9.16-rdev-2-mpp-hacks
byte_buddy_version=1.10.9
reactor_version=3.4.1
Expand Down Expand Up @@ -54,10 +54,4 @@ jekyll_version=4.0
# TODO: Remove once KT-37187 is fixed
org.gradle.jvmargs=-Xmx2g

# Workaround for Bintray treating .sha512 files as artifacts
# https://github.com/gradle/gradle/issues/1.4.3
systemProp.org.gradle.internal.publish.checksums.insecure=true

# todo:KLUDGE: This is commented out, and the property is set conditionally in build.gradle, because IDEA doesn't work with it.
#kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.mpp.enableCompatibilityMetadataVariant=true
14 changes: 3 additions & 11 deletions gradle/publish-bintray.gradle → gradle/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import org.gradle.util.VersionNumber

// Configures publishing of Maven artifacts to Bintray
// Configures publishing of Maven artifacts to Maven Central

apply plugin: 'maven'
apply plugin: 'maven-publish'
Expand Down Expand Up @@ -37,12 +37,7 @@ if (!isMultiplatform && !isBom) {

publishing {
repositories {
def bintrayUpload = System.getenv("libs.bintray.upload") != null
if (bintrayUpload) {
PublishingKt.configureBintrayPublication(delegate, project)
} else {
PublishingKt.configureMavenPublication(delegate, project)
}
PublishingKt.configureMavenPublication(delegate, project)
}

if (!isMultiplatform && !isBom) {
Expand All @@ -61,10 +56,7 @@ publishing {

publications.all {
PublishingKt.configureMavenCentralMetadata(pom, project)
def bintrayUpload = System.getenv("libs.bintray.upload") != null
if (!bintrayUpload) {
PublishingKt.signPublicationIfKeyPresent(project, it)
}
PublishingKt.signPublicationIfKeyPresent(project, it)
// add empty javadocs
if (!isBom && it.name != "kotlinMultiplatform") {
it.artifact(javadocJar)
Expand Down
5 changes: 5 additions & 0 deletions js/example-frontend-js/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ kotlin {
}
}

// For kotlinx-html
repositories {
maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
}

dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-html-js:${version("html")}")
implementation(devNpm("html-webpack-plugin", "5.3.1"))
Expand Down
6 changes: 3 additions & 3 deletions kotlinx-coroutines-core/jvm/test/AbstractLincheckTest.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
package kotlinx.coroutines

Expand All @@ -15,7 +15,7 @@ abstract class AbstractLincheckTest : VerifierState() {
open fun StressOptions.customize(isStressTest: Boolean): StressOptions = this

@Test
fun modelCheckingTest() = ModelCheckingOptions()
open fun modelCheckingTest() = ModelCheckingOptions()
.iterations(if (isStressTest) 100 else 20)
.invocationsPerIteration(if (isStressTest) 10_000 else 1_000)
.commonConfiguration()
Expand All @@ -38,4 +38,4 @@ abstract class AbstractLincheckTest : VerifierState() {
.customize(isStressTest)

override fun extractState(): Any = error("Not implemented")
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
@file:Suppress("unused")
package kotlinx.coroutines.lincheck
Expand All @@ -9,10 +9,15 @@ import kotlinx.coroutines.sync.*
import org.jetbrains.kotlinx.lincheck.*
import org.jetbrains.kotlinx.lincheck.annotations.Operation
import org.jetbrains.kotlinx.lincheck.strategy.managed.modelchecking.*
import org.junit.*

class MutexLincheckTest : AbstractLincheckTest() {
private val mutex = Mutex()

override fun modelCheckingTest() {
// Ignored via empty body as the only way
}

@Operation
fun tryLock() = mutex.tryLock()

Expand All @@ -29,4 +34,4 @@ class MutexLincheckTest : AbstractLincheckTest() {
checkObstructionFreedom()

override fun extractState() = mutex.isLocked
}
}

0 comments on commit 347feed

Please sign in to comment.