I’m trying to create a function that configures an...
# gradle
s
I’m trying to create a function that configures an Android module using Kotlin-script-gradle. I previously did this with a groovy function inside the
build.gradle
, but now I’m trying to move this to
buildSrc
. I’m struggling to find the equivalent way to do this inside
buildSrc
, can anyone help me out?
Copy code
ext.installInternalProductionFlavors = { project ->
    project.android.flavorDimensions 'releaseType'

    project.android.productFlavors {
        internal {
            dimension 'releaseType'
            matchingFallbacks = ['debug']
        }

        production {
            dimension 'releaseType'
            matchingFallbacks = ['release']
        }
    }

    installInternalProductionVariantFilter(project)
}
m
I am not sure if it helps, I’ve done like smething similar here https://github.com/dukecon/dukecon_mobile/blob/develop/buildSrc/src/main/kotlin/AndroidLibraryExtention.kt then you can write this
android {    setDefaults()   }
like here https://github.com/dukecon/dukecon_mobile/blob/develop/common/data/build.gradle.kts
s
that looks helpful. I’ll give it a shot, thanks 🙂
s
That is useful!!!