android-showcase icon indicating copy to clipboard operation
android-showcase copied to clipboard

Gradle: Duplicated configuration in `android` block

Open igorwojda opened this issue 5 years ago • 6 comments

Some elements within android block are duplicated in each module. Ideally this configuration should be applied only once (and work all the times, even for future modules).

android {
    compileSdkVersion(AndroidConfig.COMPILE_SDK_VERSION)

    defaultConfig {
        minSdkVersion(AndroidConfig.MIN_SDK_VERSION)
        targetSdkVersion(AndroidConfig.TARGET_SDK_VERSION)

        versionCode = AndroidConfig.VERSION_CODE
        versionName = AndroidConfig.VERSION_NAME
        testInstrumentationRunner = AndroidConfig.TEST_INSTRUMENTATION_RUNNER
    }
...

igorwojda avatar Apr 19 '20 18:04 igorwojda

I would like to do this. My approach would be to create a common gradle file with the android block and apply it in each module. As described in this post. If you prefer any other solution then please let me know.

ISatya avatar Jul 18 '20 17:07 ISatya

i'd like to work on this. related to #81

iam-alamgir avatar Jul 23 '20 22:07 iam-alamgir

Go ahead @Thanatos23

igorwojda avatar Jul 27 '20 12:07 igorwojda

Go ahead @Thanatos23

igorwojda avatar Jul 27 '20 12:07 igorwojda

Still want to work on that @iam-alamgir ?

igorwojda avatar Feb 14 '21 10:02 igorwojda

I already created a plugin that injects the dependencies into settings.gradle. Currently working on auto generation of related files in buildSrc. @igorwojda

iam-alamgir avatar Feb 16 '21 14:02 iam-alamgir

Implemented by using Gradle local plugins https://github.com/igorwojda/android-showcase/pull/330

igorwojda avatar Jul 21 '23 11:07 igorwojda