godot.gradle.tasks.graal.checkPresenceOfDefaultGraalJniConfig.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of godot-gradle-plugin Show documentation
Show all versions of godot-gradle-plugin Show documentation
Godot gradle plugin for kotlin language support.
package godot.gradle.tasks.graal
import godot.gradle.GodotExtension
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.TaskProvider
import org.jetbrains.kotlin.gradle.internal.ensureParentDirsCreated
import java.io.InputStream
fun Project.checkPresenceOfDefaultGraalJniConfigTask(): TaskProvider {
return tasks.register("createDefaultGraalJniConfigIfNotPresent") {
with(it) {
group = "godot-kotlin-jvm"
description =
"Checks if the default jni config for graalVM native image is present and creates it if it's not"
doLast {
copyToGraalFromPluginResourceIfDoesNotExists(
projectDir
.resolve("graal")
.resolve("godot-kotlin-graal-jni-config.json"),
"godot-kotlin-graal-jni-config.json"
)
}
}
}
}