/* * Copyright (c) 2025 Vitor Pamplona * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the * Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { alias(libs.plugins.kotlinMultiplatform) alias(libs.plugins.androidKotlinMultiplatformLibrary) } kotlin { compilerOptions { freeCompilerArgs.add("-Xexpect-actual-classes") } jvm { compilerOptions { jvmTarget.set(JvmTarget.JVM_21) } } android { namespace = "com.vitorpamplona.quic" compileSdk = libs.versions.android.compileSdk .get() .toInt() minSdk = libs.versions.android.minSdk .get() .toInt() compilerOptions { jvmTarget.set(JvmTarget.JVM_21) } withHostTest {} } sourceSets { commonMain { dependencies { implementation(libs.kotlin.stdlib) implementation(libs.kotlinx.coroutines.core) api(project(":quartz")) } } commonTest { dependencies { implementation(libs.kotlin.test) implementation(libs.kotlinx.coroutines.test) } } val jvmAndroid = create("jvmAndroid") { dependsOn(commonMain.get()) } jvmMain { dependsOn(jvmAndroid) } androidMain { dependsOn(jvmAndroid) } jvmTest { dependencies { implementation(libs.kotlin.test) implementation(libs.kotlinx.coroutines.test) implementation(libs.secp256k1.kmp.jni.jvm) } } getByName("androidHostTest") { dependencies { implementation(libs.kotlin.test) implementation(libs.kotlinx.coroutines.test) implementation(libs.secp256k1.kmp.jni.jvm) } } } } /** * Run the live-interop runner against a real QUIC server. Configure target * via -PinteropHost=… -PinteropPort=… -PinteropTimeoutSec=… * * Usage: * ./gradlew :quic:interop -PinteropHost=127.0.0.1 -PinteropPort=4433 */ tasks.register("interop") { group = "verification" description = "Drive QuicConnection against a real QUIC server (default 127.0.0.1:4433)." dependsOn("jvmTestClasses", "jvmJar") classpath = files( tasks.named("jvmJar"), configurations.named("jvmTestRuntimeClasspath"), layout.buildDirectory.dir("classes/kotlin/jvm/test"), ) mainClass.set("com.vitorpamplona.quic.interop.InteropRunnerKt") val host = (project.findProperty("interopHost") as? String) ?: "127.0.0.1" val port = (project.findProperty("interopPort") as? String) ?: "4433" val timeoutSec = (project.findProperty("interopTimeoutSec") as? String) ?: "10" args(host, port) systemProperty("interopTimeoutSec", timeoutSec) }