godot.gradle.projectExt.getBuildLockDir.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.projectExt
import org.gradle.api.Project
import java.io.File
fun Project.getBuildLockDir(): File {
val name = "${projectDir.name}_buildLockDir" //keep the same in the Bootstrap class!
val tmpDir = System.getProperty("java.io.tmpdir")
val lockDir = File(tmpDir, name)
return if (lockDir.exists() && lockDir.isDirectory) {
lockDir
} else {
lockDir.delete()
lockDir.mkdirs()
lockDir
}
}