build.gradle.kts (1479B)
1 import org.jetbrains.kotlin.gradle.tasks.KotlinCompile 2 3 plugins { 4 kotlin("jvm") version "2.4.10" 5 } 6 7 val externalRoot = file(providers.environmentVariable("TERA_KOTLIN_SMOKE_ROOT").get()) 8 val projectOutput = file(providers.environmentVariable("EXT_BUILD_PROJECT_DIR").get()) 9 require(!providers.environmentVariable("EXT_BUILD_RUN_ACTIVE").orNull.isNullOrBlank()) 10 require(externalRoot.isAbsolute && !externalRoot.toPath().startsWith(rootDir.toPath())) 11 require(externalRoot.toPath().startsWith(projectOutput.toPath())) 12 layout.buildDirectory.set(externalRoot.resolve("build")) 13 14 kotlin { 15 jvmToolchain(21) 16 sourceSets.main { kotlin.srcDir(externalRoot.resolve("generated")) } 17 } 18 19 dependencies { 20 implementation("net.java.dev.jna:jna:5.17.0") 21 implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0") 22 testImplementation(kotlin("test-junit")) 23 } 24 25 dependencyLocking { 26 lockAllConfigurations() 27 lockMode.set(LockMode.STRICT) 28 } 29 30 tasks.named<KotlinCompile>("compileTestKotlin") { 31 compilerOptions.allWarningsAsErrors.set(true) 32 } 33 34 tasks.test { 35 useJUnit() 36 maxParallelForks = 1 37 systemProperty("jna.library.path", providers.environmentVariable("TERA_KOTLIN_NATIVE_DIR").get()) 38 systemProperty("tera.smoke.data", externalRoot.resolve("test_data").absolutePath) 39 testLogging { events("passed", "failed", "skipped") } 40 // A smoke run must execute the native boundary even when compilation is cached. 41 outputs.upToDateWhen { false } 42 }