Skip to content

Update versions (kotlin 1.6.0, ktor 1.6.7, gradle 7.3.1) #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from Dec 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/gradle-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ macos-latest ]
target: [ macosX64, iosX64, tvosX64, watchosX86 ]
os: [ macos-11 ]
target: [ macosX64, iosX64, tvosX64, watchosX64 ]
jvm: [ 11 ]
include:
- os: windows-latest
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
build:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
os: [ macos-11, ubuntu-latest, windows-latest ]
fail-fast: false
runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
os: [ ubuntu-latest, macos-11, windows-latest ]
fail-fast: false

steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gradle-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ macos-latest ]
target: [ macosX64, iosX64, tvosX64, watchosX86 ]
os: [ macos-11 ]
target: [ macosX64, iosX64, tvosX64, watchosX64 ]
jvm: [ 11 ]
include:
- os: windows-latest
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
build:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
os: [ macos-11, ubuntu-latest, windows-latest ]
fail-fast: false
runs-on: ${{ matrix.os }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gradle-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
os: [ macos-11, ubuntu-latest, windows-latest ]
fail-fast: false
runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
os: [ ubuntu-latest, macos-11, windows-latest ]
fail-fast: false

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
os: [ ubuntu-latest, macos-11, windows-latest ]
fail-fast: false

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ macos-latest ]
target: [ macosX64, iosX64, tvosX64, watchosX86 ]
os: [ macos-11 ]
target: [ macosX64, iosX64, tvosX64, watchosX64 ]
jvm: [ 11 ]
include:
- os: windows-latest
Expand Down
6 changes: 6 additions & 0 deletions benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

import kotlinx.benchmark.gradle.*
import org.gradle.kotlin.dsl.benchmark
import org.jetbrains.kotlin.gradle.plugin.mpp.*

plugins {
Expand All @@ -26,6 +28,8 @@ val rsocketJavaVersion: String by rootProject
val kotlinxCoroutinesVersion: String by rootProject
val kotlinxBenchmarkVersion: String by rootProject

val jmhVersionOverride: String by rootProject

kotlin {
val jvm = jvm() //common jvm source set
val kotlinJvm = jvm("kotlin") //kotlin benchmark
Expand Down Expand Up @@ -70,6 +74,8 @@ benchmark {
register("kotlin")
register("java")
}

targets.withType<JvmBenchmarkTarget> { jmhVersion = jmhVersionOverride }
}

tasks.register<JavaExec>("jmhProfilers") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

@file:OptIn(DelicateCoroutinesApi::class)

package io.rsocket.kotlin.benchmarks

import kotlinx.coroutines.*
Expand Down
22 changes: 13 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ val Project.publicationNames: Array<String>
subprojects {
tasks.whenTaskAdded {
if (name.endsWith("test", ignoreCase = true)) onlyIf { !rootProject.hasProperty("skipTests") }
if (name.startsWith("link", ignoreCase = true)) onlyIf { !rootProject.hasProperty("skipLink") }
}

plugins.withId("org.jetbrains.kotlin.multiplatform") {
Expand All @@ -67,7 +68,9 @@ subprojects {
project.name == "rsocket-transport-ktor-server" || //server is jvm only
project.name == "rsocket-test-server"
//windows target isn't supported by ktor-network
val supportMingw = project.name != "rsocket-transport-ktor" && project.name != "rsocket-transport-ktor-client"
val supportMingw =
project.name != "rsocket-transport-ktor" &&
project.name != "rsocket-transport-ktor-client"


if (!isAutoConfigurable) return@configure
Expand Down Expand Up @@ -105,12 +108,15 @@ subprojects {
}

//native targets configuration
val hostTargets = listOfNotNull(linuxX64(), macosX64(), if (supportMingw) mingwX64() else null)

val iosTargets = listOf(iosArm32(), iosArm64(), iosX64())
val tvosTargets = listOf(tvosArm64(), tvosX64())
val watchosTargets = listOf(watchosArm32(), watchosArm64(), watchosX86())
val nativeTargets = hostTargets + iosTargets + tvosTargets + watchosTargets
val linuxTargets = listOf(linuxX64())
val mingwTargets = if (supportMingw) listOf(mingwX64()) else emptyList()
val macosTargets = listOf(macosX64(), macosArm64())
val iosTargets = listOf(iosArm32(), iosArm64(), iosX64(), iosSimulatorArm64())
val tvosTargets = listOf(tvosArm64(), tvosX64(), tvosSimulatorArm64())
val watchosTargets =
listOf(watchosArm32(), watchosArm64(), watchosX86(), watchosX64(), watchosSimulatorArm64())
val darwinTargets = macosTargets + iosTargets + tvosTargets + watchosTargets
val nativeTargets = darwinTargets + linuxTargets + mingwTargets

val nativeMain by sourceSets.creating {
dependsOn(sourceSets["commonMain"])
Expand Down Expand Up @@ -149,8 +155,6 @@ subprojects {
sourceSets.all {
languageSettings.apply {
progressiveMode = true
languageVersion = "1.5"
apiVersion = "1.5"

optIn("kotlin.RequiresOptIn")

Expand Down
33 changes: 9 additions & 24 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,29 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

#Project
group=io.rsocket.kotlin
version=0.14.0

#Versions
kotlinVersion=1.5.31
ktorVersion=1.6.4
kotlinVersion=1.6.0
ktorVersion=1.6.7
kotlinxCoroutinesVersion=1.5.2-native-mt
kotlinxAtomicfuVersion=0.16.3
kotlinxSerializationVersion=1.3.0
kotlinxBenchmarkVersion=0.3.1
kotlinxAtomicfuVersion=0.17.0
kotlinxSerializationVersion=1.3.1
kotlinxBenchmarkVersion=0.4.0
kotlinxNodejsVersion=0.0.7
rsocketJavaVersion=1.1.1
turbineVersion=0.6.1
artifactoryVersion=4.24.20
turbineVersion=0.7.0
artifactoryVersion=4.25.1
versionUpdatesVersion=0.39.0
gradleEnterpriseVersion=3.4.1

jmhVersionOverride=1.33
#Kotlin
#kotlin.code.style=official
kotlin.caching.enabled=true
kotlin.incremental=true
kotlin.incremental.multiplatform=true
kotlin.js.compiler=both
kotlin.mpp.stability.nowarn=true

#HMPP support
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.mpp.enableCompatibilityMetadataVariant=true

#JS and Native flags
kotlin.js.compiler=both
kotlin.native.enableDependencyPropagation=false
kotlin.native.ignoreIncorrectDependencies=true
kotlin.native.ignoreDisabledTargets=true
kotlin.native.distribution.type=prebuilt


#Gradle
org.gradle.parallel=true
org.gradle.caching=true
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ package io.rsocket.kotlin.keepalive

import kotlin.native.concurrent.*
import kotlin.time.*
import kotlin.time.Duration.Companion.seconds

@ExperimentalTime
public fun KeepAlive(
interval: Duration = Duration.seconds(20),
maxLifetime: Duration = Duration.seconds(90)
interval: Duration = 20.seconds,
maxLifetime: Duration = 90.seconds
): KeepAlive = KeepAlive(
intervalMillis = interval.toInt(DurationUnit.MILLISECONDS),
maxLifetimeMillis = maxLifetime.toInt(DurationUnit.MILLISECONDS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import kotlinx.coroutines.*
import kotlinx.coroutines.channels.*
import kotlinx.coroutines.flow.*
import kotlin.test.*
import kotlin.time.*
import kotlin.time.Duration.Companion.seconds

class RSocketTest : SuspendTest, TestWithLeakCheck {

Expand Down Expand Up @@ -63,7 +63,7 @@ class RSocketTest : SuspendTest, TestWithLeakCheck {
return RSocketConnector {
loggerFactory = LoggerFactory { PrintLogger.withLevel(LoggingLevel.DEBUG).logger("CLIENT |$it") }
connectionConfig {
keepAlive = KeepAlive(Duration.seconds(1000), Duration.seconds(1000))
keepAlive = KeepAlive(1000.seconds, 1000.seconds)
}
}.connect(localServer)
}
Expand Down Expand Up @@ -144,7 +144,7 @@ class RSocketTest : SuspendTest, TestWithLeakCheck {
requester.requestStream(payload("HELLO"))
.flowOn(PrefetchStrategy(10, 0))
.withIndex()
.onEach { if (it.index == 23) throw error("oops") }
.onEach { if (it.index == 23) error("oops") }
.map { it.value }
.test {
repeat(23) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import io.rsocket.kotlin.keepalive.*
import io.rsocket.kotlin.payload.*
import io.rsocket.kotlin.test.*
import kotlin.test.*
import kotlin.time.*
import kotlin.time.Duration.Companion.seconds

class SetupFrameTest : TestWithLeakCheck {

private val version = Version.Current
private val keepAlive = KeepAlive(Duration.seconds(10), Duration.seconds(500))
private val keepAlive = KeepAlive(10.seconds, 500.seconds)
private val payloadMimeType = PayloadMimeType(WellKnownMimeType.ApplicationOctetStream, CustomMimeType("mime"))

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import kotlinx.coroutines.*
import kotlinx.coroutines.channels.*
import kotlinx.coroutines.flow.*
import kotlin.test.*
import kotlin.time.*
import kotlin.time.Duration.Companion.seconds

class RSocketRequesterTest : TestWithConnection(), TestWithLeakCheck {
private lateinit var requester: RSocket
Expand All @@ -40,7 +40,7 @@ class RSocketRequesterTest : TestWithConnection(), TestWithLeakCheck {
maxFragmentSize = 0,
interceptors = InterceptorsBuilder().build(),
connectionConfig = ConnectionConfig(
keepAlive = KeepAlive(Duration.seconds(1000), Duration.seconds(1000)),
keepAlive = KeepAlive(1000.seconds, 1000.seconds),
payloadMimeType = DefaultPayloadMimeType,
setupPayload = Payload.Empty
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ import io.rsocket.kotlin.payload.*
import io.rsocket.kotlin.test.*
import kotlinx.coroutines.*
import kotlin.test.*
import kotlin.time.*
import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.Duration.Companion.seconds

class KeepAliveTest : TestWithConnection(), TestWithLeakCheck {

private suspend fun requester(
keepAlive: KeepAlive = KeepAlive(Duration.milliseconds(100), Duration.seconds(1))
keepAlive: KeepAlive = KeepAlive(100.milliseconds, 1.seconds)
): RSocket = connect(
connection = connection,
isServer = false,
Expand All @@ -54,14 +55,14 @@ class KeepAliveTest : TestWithConnection(), TestWithLeakCheck {

@Test
fun rSocketNotCanceledOnPresentKeepAliveTicks() = test {
val rSocket = requester(KeepAlive(Duration.seconds(100), Duration.seconds(100)))
val rSocket = requester(KeepAlive(100.seconds, 100.seconds))
connection.launch {
repeat(50) {
delay(Duration.milliseconds(100))
delay(100.milliseconds)
connection.sendToReceiver(KeepAliveFrame(true, 0, ByteReadPacket.Empty))
}
}
delay(Duration.seconds(1.5))
delay(1.5.seconds)
assertTrue(rSocket.isActive)
connection.test {
repeat(50) {
Expand All @@ -72,10 +73,10 @@ class KeepAliveTest : TestWithConnection(), TestWithLeakCheck {

@Test
fun requesterRespondsToKeepAlive() = test {
requester(KeepAlive(Duration.seconds(100), Duration.seconds(100)))
requester(KeepAlive(100.seconds, 100.seconds))
connection.launch {
while (isActive) {
delay(Duration.milliseconds(100))
delay(100.milliseconds)
connection.sendToReceiver(KeepAliveFrame(true, 0, ByteReadPacket.Empty))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class CompositeMetadataTest : TestWithLeakCheck {
assertFails {
buildCompositeMetadata {
add(WellKnownMimeType.ApplicationAvro, packet)
throw error("")
error("")
}
}
assertTrue(packet.isEmpty)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ package io.rsocket.kotlin.test
import kotlinx.coroutines.*
import kotlin.coroutines.*
import kotlin.time.*
import kotlin.time.Duration.Companion.minutes
import kotlin.time.Duration.Companion.seconds

interface SuspendTest {
val testTimeout: Duration get() = Duration.minutes(1)
val testTimeout: Duration get() = 1.minutes

val beforeTimeout: Duration get() = Duration.seconds(10)
val afterTimeout: Duration get() = Duration.seconds(10)
val beforeTimeout: Duration get() = 10.seconds
val afterTimeout: Duration get() = 10.seconds

val debug: Boolean get() = true //change to turn off debug logs locally (useful for CI)

Expand Down
Loading