Skip to content

Commit 485c7e1

Browse files
committed
Adjusted emulator matrix.
1 parent 5c7cf41 commit 485c7e1

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

convention-plugin-test-option/src/main/kotlin/EmulatorJobsMatrix.kt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import com.google.gson.GsonBuilder
22
import org.gradle.api.Project
3-
import utils.TargetPlatform
4-
import utils.toTargetPlatforms
53
import java.io.File
64
import java.util.Properties
75

@@ -127,3 +125,20 @@ fun getSdkmanagerFile(rootDir: File): File? =
127125
println("sdkmanagerFile: $sdkmanagerFile")
128126
sdkmanagerFile
129127
}
128+
129+
enum class TargetPlatform {
130+
Android, Ios, Macos, Tvos, Jvm, Js
131+
}
132+
133+
fun String.toTargetPlatforms(): List<TargetPlatform> =
134+
split(",").map {
135+
when (it.lowercase().trim()) {
136+
"android" -> TargetPlatform.Android
137+
"ios" -> TargetPlatform.Ios
138+
"macos" -> TargetPlatform.Macos
139+
"tvos" -> TargetPlatform.Tvos
140+
"jvm" -> TargetPlatform.Jvm
141+
"js" -> TargetPlatform.Js
142+
else -> throw IllegalArgumentException("Unknown target platform: $it")
143+
}
144+
}

0 commit comments

Comments
 (0)