@@ -57,42 +57,29 @@ class SharedBuildPlugin : Plugin<Project> {
57
57
.targets
58
58
.withType<KotlinNativeTarget >()
59
59
.configureEach {
60
- if (konanTarget.family == Family .IOS &&
61
- konanTarget.name.contains(
62
- " simulator" ,
63
- )
64
- ) {
65
- binaries
66
- .withType< org.jetbrains.kotlin.gradle.plugin.mpp.TestExecutable > ()
67
- .configureEach {
68
- linkTaskProvider.configure { dependsOn(unzipPowersyncFramework) }
69
- linkerOpts(" -framework" , " powersync-sqlite-core" )
60
+ val abiName = when (konanTarget.family) {
61
+ Family .OSX -> " macos-arm64_x86_64"
62
+ // We're testing on simulators
63
+ Family .IOS -> " ios-arm64_x86_64-simulator"
64
+ Family .WATCHOS -> " watchos-arm64_x86_64-simulator"
65
+ else -> return @configureEach
66
+ }
70
67
71
- val frameworkRoot =
72
- binariesFolder
73
- .map { it.dir( " framework/extracted/powersync-sqlite-core.xcframework/ios-arm64_x86_64-simulator " ) }
74
- .get()
75
- .asFile.path
68
+ binaries
69
+ .withType < org.jetbrains.kotlin.gradle.plugin.mpp. TestExecutable > ()
70
+ .configureEach {
71
+ linkTaskProvider.configure { dependsOn(unzipPowersyncFramework) }
72
+ linkerOpts( " -framework " , " powersync-sqlite-core " )
76
73
77
- linkerOpts(" -F" , frameworkRoot)
78
- linkerOpts(" -rpath" , frameworkRoot)
79
- }
80
- } else if (konanTarget.family == Family .OSX ) {
81
- binaries
82
- .withType< org.jetbrains.kotlin.gradle.plugin.mpp.TestExecutable > ()
83
- .configureEach {
84
- linkTaskProvider.configure { dependsOn(" unzipPowersyncFramework" ) }
85
- linkerOpts(" -framework" , " powersync-sqlite-core" )
86
- var frameworkRoot =
87
- binariesFolder
88
- .map { it.dir(" framework/extracted/powersync-sqlite-core.xcframework/macos-arm64_x86_64" ) }
89
- .get()
90
- .asFile.path
74
+ val frameworkRoot =
75
+ binariesFolder
76
+ .map { it.dir(" framework/extracted/powersync-sqlite-core.xcframework/$abiName " ) }
77
+ .get()
78
+ .asFile.path
91
79
92
- linkerOpts(" -F" , frameworkRoot)
93
- linkerOpts(" -rpath" , frameworkRoot)
94
- }
95
- }
80
+ linkerOpts(" -F" , frameworkRoot)
81
+ linkerOpts(" -rpath" , frameworkRoot)
82
+ }
96
83
}
97
84
}
98
85
}
0 commit comments