@@ -116,54 +116,6 @@ subprojects {
116116 }
117117 }
118118 }
119-
120- smithyConfigureIosSimulatorTasks()
121119}
122120
123- /* *
124- * Disables standalone mode in simulator tests since it causes issues with TLS.
125- * This means we need to manage the simulator state ourselves (booting, shutting down).
126- * https://youtrack.jetbrains.com/issue/KT-38317
127- */
128- public fun Project.smithyConfigureIosSimulatorTasks () {
129- if (! HostManager .hostIsMac) return
130-
131- val simulatorDeviceName = project.findProperty(" iosSimulatorDevice" ) as ? String ? : " iPhone 15"
132- val xcrun = " /usr/bin/xcrun"
133-
134- val bootTask = rootProject.tasks.maybeCreate(" bootIosSimulatorDevice" , Exec ::class .java).apply {
135- isIgnoreExitValue = true
136- commandLine(xcrun, " simctl" , " boot" , simulatorDeviceName)
137-
138- doLast {
139- val result = executionResult.get()
140- val code = result.exitValue
141- if (code != 148 && code != 149 ) { // ignore "simulator already running" errors
142- result.assertNormalExitValue()
143- }
144- }
145- }
146-
147- val shutdownTask = rootProject.tasks.maybeCreate(" shutdownIosSimulatorDevice" , Exec ::class .java).apply {
148- isIgnoreExitValue = true
149- commandLine(xcrun, " simctl" , " shutdown" , simulatorDeviceName)
150-
151- doLast {
152- val result = executionResult.get()
153- val code = result.exitValue
154- if (code != 148 && code != 149 ) { // ignore "simulator already shutdown" errors
155- result.assertNormalExitValue()
156- }
157- }
158- }
159-
160- allprojects {
161- val simulatorTasks = tasks.withType<KotlinNativeSimulatorTest >()
162- simulatorTasks.configureEach {
163- dependsOn(bootTask)
164- standalone.set(false )
165- device.set(simulatorDeviceName)
166- }
167- shutdownTask.mustRunAfter(simulatorTasks)
168- }
169- }
121+ configureIosSimulatorTasks()
0 commit comments