Skip to content

Commit bc7467c

Browse files
committed
Read Gradle project/build dirs in config cache compatible way
1 parent b11d438 commit bc7467c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

kt/plugins/godot-gradle-plugin/src/main/kotlin/godot/gradle/tasks/generateGdIgnoreFilesTask.kt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,15 @@ fun Project.generateGdIgnoreFilesTask(): TaskProvider<Task> {
1010
group = "godot-kotlin-jvm"
1111
description = "Generates .gdignore files to hide gradle files, kotlin build files and jre files from the godot editor."
1212

13-
doFirst {
13+
// safety check: make sure that the target project has our plugin
14+
val hasPlugin = provider { pluginManager.hasPlugin("com.utopia-rise.godot-kotlin-jvm") }
15+
onlyIf { hasPlugin.get() }
1416

15-
// safety check: make sure that the target project has our plugin
16-
if (!this.project.pluginManager.hasPlugin("com.utopia-rise.godot-kotlin-jvm")) {
17-
// the target project doesn't seem to have our plugin; skip.
18-
return@doFirst
19-
}
17+
val projectDir = layout.projectDirectory.asFile
18+
val buildDirProvider = layout.buildDirectory.asFile
19+
doFirst {
2020

21-
val projectDir = this.project.projectDir
22-
val buildDir = this.project.layout.buildDirectory.asFile.get()
21+
val buildDir = buildDirProvider.get()
2322

2423
val targetDirSequence = sequenceOf(
2524
buildDir,

0 commit comments

Comments
 (0)