godot.gradle.tasks.setupBuildTask.kt Maven / Gradle / Ivy
package godot.gradle.tasks
import godot.gradle.projectExt.godotJvmExtension
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.TaskProvider
fun Project.setupBuildTask(
packageBootstrapJarTask: TaskProvider,
packageMainJarTask: TaskProvider,
generateEntryServiceFileTask: TaskProvider,
deleteBuildLockTask: TaskProvider,
packageBootstrapDexJarTask: TaskProvider,
packageMainDexJarTask: TaskProvider,
createGraalNativeImageTask: TaskProvider,
createBuildLockTask: TaskProvider,
generateGdIgnoreFilesTask: TaskProvider,
) {
tasks.named("build") {
with(it) {
dependsOn(
createBuildLockTask,
packageBootstrapJarTask,
packageMainJarTask,
generateEntryServiceFileTask,
generateGdIgnoreFilesTask
)
finalizedBy(deleteBuildLockTask)
if (godotJvmExtension.isAndroidExportEnabled.get()) {
finalizedBy(packageBootstrapDexJarTask, packageMainDexJarTask)
}
if (godotJvmExtension.isGraalNativeImageExportEnabled.get()) {
finalizedBy(createGraalNativeImageTask)
}
}
}
}