File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 2121 */
2222
2323import org.gradle.api.Project
24+ import java.io.File
25+ import java.util.*
2426
2527// can't use by lazy, we need Project.findProperty not accessible there
2628@Suppress(" ObjectPropertyName" )
2729private lateinit var _iosTargets : List <String >
2830
31+ private val localProperties = Properties ()
32+ private fun Project.getIosTargetedConfiguration (): String? {
33+ return findProperty(" ios.target" ) as ? String
34+ ? : run {
35+ if (localProperties.isEmpty) {
36+ val localPropertiesFile = File (" local.properties" )
37+ if (localPropertiesFile.isFile) {
38+ localPropertiesFile.inputStream().use { reader ->
39+ localProperties.load(reader)
40+ }
41+ }
42+ }
43+ localProperties.getProperty(" ios.target" )
44+ }
45+ }
46+
2947val Project .iosTargets: List <String >
3048 get() {
3149 if (! ::_iosTargets .isInitialized) {
32- _iosTargets = when (findProperty( " ios.target " ) as ? String ) {
50+ _iosTargets = when (getIosTargetedConfiguration() ) {
3351 // We ignore "iosX64", not considered as a use case
3452 " all" -> listOf (" iosArm64" , " iosSimulatorArm64" )
3553 " simulator" -> listOf (" iosSimulatorArm64" )
You can’t perform that action at this time.
0 commit comments