Skip to content

Commit 22e8b93

Browse files
committed
[configuration-cache] read buildDirectory path during configuration phase
1 parent 87b28e3 commit 22e8b93

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

plugin/src/main/kotlin/io/github/ttypic/swiftklib/gradle/SwiftKlibPlugin.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ class SwiftKlibPlugin : Plugin<Project> {
2828
getTaskName(name, it)
2929
}
3030

31+
val buildDir = project.layout.buildDirectory.asFile.get().absolutePath
3132
targetToTaskName.entries.forEach { (target, taskName) ->
3233
tasks.register(
3334
taskName,
3435
CompileSwiftTask::class.java,
3536
name,
3637
target,
38+
buildDir,
3739
entry.pathProperty,
3840
entry.packageNameProperty,
3941
entry.minIosProperty,

plugin/src/main/kotlin/io/github/ttypic/swiftklib/gradle/task/CompileSwiftTask.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import javax.inject.Inject
2222
open class CompileSwiftTask @Inject constructor(
2323
@Input val cinteropName: String,
2424
@Input val compileTarget: CompileTarget,
25+
@Input val buildDirectory: String,
2526
@InputDirectory val pathProperty: Property<File>,
2627
@Input val packageNameProperty: Property<String>,
2728
@Optional @Input val minIosProperty: Property<Int>,
@@ -33,7 +34,7 @@ open class CompileSwiftTask @Inject constructor(
3334
@get:Internal
3435
internal val targetDir: File
3536
get() {
36-
return project.layout.buildDirectory.file("${EXTENSION_NAME}/$cinteropName/$compileTarget").get().asFile
37+
return File(buildDirectory, "${EXTENSION_NAME}/$cinteropName/$compileTarget")
3738
}
3839

3940
@get:OutputDirectory

0 commit comments

Comments
 (0)