https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
s

saket

04/18/2020, 10:55 PM
I’m essentially trying to add the macOS equivalent for my iOS tests command:
Copy code
task checkiOS {
  def device = project.findProperty("iosDevice")?.toString() ?: "iPhone 8"
  dependsOn 'linkDebugTestIos'
  group = JavaBasePlugin.VERIFICATION_GROUP
  description = "Runs tests for target 'ios' on an iOS simulator"

  doLast {
    def binary = kotlin.targets.ios.binaries.getTest('DEBUG').outputFile
    exec {
      commandLine 'xcrun', 'simctl', 'spawn',  '--standalone', device, binary.absolutePath
    }
  }
}
tasks.check.dependsOn checkiOS
d

Dominaezzz

04/18/2020, 11:02 PM
It should be
./gradlew macosX64Test
by default. Might be different if you've renamed your target.
s

saket

04/18/2020, 11:04 PM
Ohhh riight. macOS apps do not need a separate simulator so
macosX64Test
is enough. I was overthinking this. Thanks @Dominaezzz!
d

Dominaezzz

04/18/2020, 11:06 PM
Glad I could help. You've notified a random dominic btw 😅.
s

saket

04/18/2020, 11:07 PM
whoops thankfully they’re not in this channel
r

russhwolf

04/18/2020, 11:56 PM
nb the ios simulator test task is also included by default as of 1.3.70 so you don’t need to add it yourself anymore. Will be titled
iosTest
for a simulator target named “ios”.
s

saket

04/19/2020, 12:00 AM
Noice! That explains why I was seeing a name clash error. Renamed my
iosTest
task to something else without giving any thought.
2 Views