plugins {
    id 'java'
    id "me.champeau.jmh" version "0.6.6"
}

java {
    toolchain {
        languageVersion.set(JavaLanguageVersion.of(rootProject.ext.jvmVersion))
    }
}

apply from: "$rootProject.projectDir/srcsets.gradle"

dependencies {
    implementation libs.bundles.slf4j

    implementation libs.slop
    implementation libs.fastutil

    testImplementation libs.bundles.slf4j.test
    testImplementation libs.bundles.junit
    testImplementation libs.mockito
}

test {
    useJUnitPlatform()
}

jmh {
    jvmArgs = [ "--enable-preview" ]
}
tasks.withType(me.champeau.jmh.WithJavaToolchain).configureEach {
    javaLauncher.set(javaToolchains.launcherFor {
        languageVersion.set(JavaLanguageVersion.of(rootProject.ext.jvmVersion))
    })
}
tasks.withType(me.champeau.jmh.JmhBytecodeGeneratorTask).configureEach {
    jvmArgs = ["--enable-preview"]
}