However you can use the new variant API to customi...
# android
x
However you can use the new variant API to customize some of the flags:
Copy code
androidComponents {
  beforeVariant(selector().withBuildType("dev")) { variant ->
    variant.minSdk = 21
  }
}
See https://developer.android.com/reference/tools/gradle-api/7.2/com/android/build/api/variant/AndroidComponentsExtension#beforeVariant[…]lin.Function1) for more info
j
Hey @Xavier Ducrohet I am thinking about why
minSdk
is not a
Property<Int>
, is there any reason? I though that with the refactor it would become
Property<Int>
but I was surprised when it was still
Int
x
minSdk
values can impact the task graph and therefore must be read at configuration time. Because of this it cannot be dynamic using
Property
. This is also why it's read/write in
beforeVariant
and read-only in
onVariant
(because once you get to
onVariant
we need the task graph to be finalized)
👍 1