Kevin S
03/16/2023, 4:59 PMval commonMain by getting
, but in a compose template they’ve used named("commonMain")
. Is one method preferred over the other? I notice that with the first approach, there is an UNUSED_VARIABLE
warning, is that a reason to not use by getting?Adam S
03/16/2023, 5:10 PMkotlin {
sourceSets {
commonMain { // generated DSL accessor
}
}
}
It can be convenient to use the delegated property when you want to re-use the variable, for example, creating a hierarchy
sourceSets {
val commonMain by getting {}
val commonTest by getting {}
val nativeMain by creating { dependsOn(commonMain) }
val nativeTest by creating { dependsOn(commonTest) }
But yes, the ‘unused variable’ warning is annoyingKevin S
03/16/2023, 5:16 PMby getting
the recommended approach for multiplatform sourcesets?Adam S
03/16/2023, 5:17 PMby getting
is recommended per se, but it’s certainly more common in the documentationjw
03/16/2023, 5:17 PM