@@ -8,6 +8,7 @@ import aws.sdk.kotlin.gradle.crt.configureCrtCMakeBuild
88import aws.sdk.kotlin.gradle.crt.disableCrossCompileTargets
99import aws.sdk.kotlin.gradle.dsl.configurePublishing
1010import aws.sdk.kotlin.gradle.kmp.configureKmpTargets
11+ import aws.sdk.kotlin.gradle.kmp.configureIosSimulatorTasks
1112import aws.sdk.kotlin.gradle.util.typedProp
1213import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
1314import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeSimulatorTest
@@ -97,47 +98,7 @@ kotlin {
9798 }
9899}
99100
100- // disable "standalone" mode in simulator tests since it causes TLS issues. this means we need to manage the simulator
101- // ourselves (booting / shutting down). FIXME: https://youtrack.jetbrains.com/issue/KT-38317
102- kotlin {
103- val simulatorDeviceName = project.findProperty(" iosSimulatorDevice" ) as ? String ? : " iPhone 15"
104-
105- val xcrun = " /usr/bin/xcrun"
106-
107- tasks.register<Exec >(" bootIosSimulatorDevice" ) {
108- isIgnoreExitValue = true
109- commandLine(xcrun, " simctl" , " boot" , simulatorDeviceName)
110-
111- doLast {
112- val result = executionResult.get()
113- val code = result.exitValue
114- if (code != 148 && code != 149 ) { // ignore "simulator already running" errors
115- result.assertNormalExitValue()
116- }
117- }
118- }
119-
120- tasks.register<Exec >(" shutdownIosSimulatorDevice" ) {
121- mustRunAfter(tasks.withType<KotlinNativeSimulatorTest >())
122- commandLine(xcrun, " simctl" , " shutdown" , simulatorDeviceName)
123-
124- doLast {
125- executionResult.get().assertNormalExitValue()
126- }
127- }
128-
129- tasks.withType<KotlinNativeSimulatorTest >().configureEach {
130- if (! HostManager .hostIsMac) {
131- return @configureEach
132- }
133-
134- dependsOn(" bootIosSimulatorDevice" )
135- finalizedBy(" shutdownIosSimulatorDevice" )
136-
137- standalone = false
138- device = simulatorDeviceName
139- }
140- }
101+ configureIosSimulatorTasks()
141102
142103// Publishing
143104configurePublishing(" aws-crt-kotlin" )
0 commit comments