@@ -7,11 +7,10 @@ import aws.sdk.kotlin.gradle.crt.cmakeInstallDir
77import  aws.sdk.kotlin.gradle.crt.configureCrtCMakeBuild 
88import  aws.sdk.kotlin.gradle.crt.disableCrossCompileTargets 
99import  aws.sdk.kotlin.gradle.dsl.configurePublishing 
10+ import  aws.sdk.kotlin.gradle.kmp.configureIosSimulatorTasks 
1011import  aws.sdk.kotlin.gradle.kmp.configureKmpTargets 
1112import  aws.sdk.kotlin.gradle.util.typedProp 
1213import  org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget 
13- import  org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeSimulatorTest 
14- import  org.jetbrains.kotlin.konan.target.HostManager 
1514
1615plugins {
1716    alias(libs.plugins.kotlin.multiplatform)
@@ -97,47 +96,7 @@ kotlin {
9796    }
9897}
9998
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" 
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" 
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- }
99+ configureIosSimulatorTasks()
141100
142101//  Publishing
143102configurePublishing(" aws-crt-kotlin" 
0 commit comments