plugins { java } java { toolchain { languageVersion.set(JavaLanguageVersion.of(21)) } } repositories { mavenLocal() mavenCentral() } val libs = versionCatalogs.named("libs") dependencies { compileOnly(libs.findLibrary("lombok").get()) annotationProcessor(libs.findLibrary("lombok").get()) testImplementation(platform(libs.findLibrary("junit-bom").get())) testImplementation(libs.findLibrary("junit-jupiter").get()) testCompileOnly(libs.findLibrary("lombok").get()) testAnnotationProcessor(libs.findLibrary("lombok").get()) } tasks.withType { options.compilerArgs.add("--enable-preview") } tasks.withType { useJUnitPlatform() jvmArgs("--enable-preview") } tasks.register("deps") { group = "build" description = "resolves all resolvable configurations" doLast { configurations.filter { it.isCanBeResolved }.forEach { it.resolve() } } } val application = extensions.findByType() application?.apply { applicationDefaultJvmArgs = listOf("--enable-preview") }