Skip to content

Commit

Permalink
Refactor cHeadersDirectory path usage in KlangPlugin
Browse files Browse the repository at this point in the history
Adjusted the usage of cHeadersDirectory in KlangPlugin's unpackCHeaderTask function by removing 'this' references. An 'mkdirs()' function call was added to ensure the directory exists before passing headers into it.
  • Loading branch information
ygdrasil-io committed Feb 14, 2024
1 parent f53bff6 commit 54a98df
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,10 @@ class KlangPlugin : Plugin<Project> {
}

private fun Project.unpackCHeaderTask(): Task = task("unpackCHeader") { task ->
task.onlyIf { this.cHeadersDirectory.doesNotExists() || this.cHeadersDirectory.isDirectoryEmpty() }
task.onlyIf { cHeadersDirectory.doesNotExists() || cHeadersDirectory.isDirectoryEmpty() }
task.doFirst {
this.cHeadersDirectory.deleteRecursively()
cHeadersDirectory.deleteRecursively()
cHeadersDirectory.mkdirs()
HeaderManager.putPlatformHeaderAt(cHeadersDirectory.toPath())
}
}
Expand Down

0 comments on commit 54a98df

Please sign in to comment.