@@ -55,12 +55,14 @@ abstract class CompileSwiftTask @Inject constructor(
55
55
56
56
prepareBuildDirectory()
57
57
createPackageSwift()
58
- val (libPath, headerPath) = buildSwift()
58
+ val xcodeMajorVersion = readXcodeMajorVersion()
59
+ val (libPath, headerPath) = buildSwift(xcodeMajorVersion)
59
60
60
61
createDefFile(
61
62
libPath = libPath,
62
63
headerPath = headerPath,
63
64
packageName = packageName,
65
+ xcodeVersion = xcodeMajorVersion,
64
66
)
65
67
}
66
68
@@ -69,10 +71,6 @@ abstract class CompileSwiftTask @Inject constructor(
69
71
private val minTvos get() = minTvosProperty.getOrElse(13 )
70
72
private val minWatchos get() = minWatchosProperty.getOrElse(8 )
71
73
72
- private val xcodeVersion: Int by lazy {
73
- readXcodeMajorVersion()
74
- }
75
-
76
74
/* *
77
75
* Creates build directory or cleans up if it already exists
78
76
* and copies Swift source files to it
@@ -97,7 +95,7 @@ abstract class CompileSwiftTask @Inject constructor(
97
95
.create(createPackageSwiftContents(cinteropName))
98
96
}
99
97
100
- private fun buildSwift (): SwiftBuildResult {
98
+ private fun buildSwift (xcodeVersion : Int ): SwiftBuildResult {
101
99
val sourceFilePathReplacements = mapOf (
102
100
buildDir().absolutePath to pathProperty.get().absolutePath
103
101
)
@@ -214,7 +212,7 @@ abstract class CompileSwiftTask @Inject constructor(
214
212
* Note: adds lib-file md5 hash to library in order to automatically
215
213
* invalidate connected cinterop task
216
214
*/
217
- private fun createDefFile (libPath : File , headerPath : File , packageName : String ) {
215
+ private fun createDefFile (libPath : File , headerPath : File , packageName : String , xcodeVersion : Int ) {
218
216
val xcodePath = readXcodePath()
219
217
220
218
val linkerPlatformVersion =
0 commit comments