|
| 1 | +import extension.addAppModuleDependencies |
| 2 | +import extension.addInstrumentationTestDependencies |
| 3 | +import extension.addUnitTestDependencies |
| 4 | + |
| 5 | +plugins { |
| 6 | + id(Plugins.ANDROID_APPLICATION_PLUGIN) |
| 7 | + id(Plugins.KOTLIN_ANDROID_PLUGIN) |
| 8 | + id(Plugins.KOTLIN_ANDROID_EXTENSIONS_PLUGIN) |
| 9 | + id(Plugins.KOTLIN_KAPT_PLUGIN) |
| 10 | + id(Plugins.DAGGER_HILT_PLUGIN) |
| 11 | +} |
| 12 | + |
| 13 | +android { |
| 14 | + |
| 15 | + compileSdkVersion(AndroidVersion.COMPILE_SDK_VERSION) |
| 16 | + |
| 17 | + defaultConfig { |
| 18 | + applicationId = AndroidVersion.APPLICATION_ID |
| 19 | + minSdkVersion(AndroidVersion.MIN_SDK_VERSION) |
| 20 | + targetSdkVersion(AndroidVersion.TARGET_SDK_VERSION) |
| 21 | + versionCode = AndroidVersion.VERSION_CODE |
| 22 | + versionName = AndroidVersion.VERSION_NAME |
| 23 | + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" |
| 24 | + |
| 25 | + // TODO Scheme is created in data module but with which one, find out |
| 26 | + javaCompileOptions { |
| 27 | + annotationProcessorOptions { |
| 28 | + arguments["room.schemaLocation"] = "$projectDir/schemas" |
| 29 | + } |
| 30 | + } |
| 31 | + kapt { |
| 32 | + arguments { |
| 33 | + arg("room.schemaLocation", "$projectDir/schemas") |
| 34 | + } |
| 35 | + } |
| 36 | + } |
| 37 | + |
| 38 | + buildTypes { |
| 39 | + getByName("release") { |
| 40 | + isMinifyEnabled = false |
| 41 | + proguardFiles( |
| 42 | + getDefaultProguardFile("proguard-android-optimize.txt"), |
| 43 | + "proguard-rules.pro" |
| 44 | + ) |
| 45 | + } |
| 46 | + } |
| 47 | + |
| 48 | + // signingConfigs { |
| 49 | +// create(BuildType.RELEASE) { |
| 50 | +// keyAlias = getLocalProperty("signing.key.alias") |
| 51 | +// keyPassword = getLocalProperty("signing.key.password") |
| 52 | +// storeFile = file(getLocalProperty("signing.store.file")) |
| 53 | +// storePassword = getLocalProperty("signing.store.password") |
| 54 | +// } |
| 55 | +// } |
| 56 | + |
| 57 | + // Specifies one flavor dimension. |
| 58 | +// flavorDimensions("reactive") |
| 59 | +// |
| 60 | +// productFlavors { |
| 61 | +// |
| 62 | +// create("rxjava") { |
| 63 | +// dimension = "reactive" |
| 64 | +// applicationIdSuffix = ".rxjava" |
| 65 | +// versionNameSuffix = "-rxjava" |
| 66 | +// } |
| 67 | +// create("coroutines") { |
| 68 | +// dimension = "reactive" |
| 69 | +// applicationIdSuffix =".coroutines" |
| 70 | +// versionNameSuffix = "-coroutines" |
| 71 | +// } |
| 72 | +// } |
| 73 | + |
| 74 | +// configurations.all { |
| 75 | +// resolutionStrategy { |
| 76 | +// exclude("org.jetbrains.kotlinx", "kotlinx-coroutines-debug") |
| 77 | +// } |
| 78 | +// } |
| 79 | + |
| 80 | + packagingOptions { |
| 81 | + exclude("**/attach_hotspot_windows.dll") |
| 82 | + exclude("META-INF/licenses/**") |
| 83 | + exclude("META-INF/AL2.0") |
| 84 | + exclude("META-INF/LGPL2.1") |
| 85 | + } |
| 86 | + |
| 87 | + android.buildFeatures.dataBinding = true |
| 88 | + |
| 89 | + compileOptions { |
| 90 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 91 | + targetCompatibility = JavaVersion.VERSION_1_8 |
| 92 | + } |
| 93 | + |
| 94 | + kotlinOptions { |
| 95 | + jvmTarget = "1.8" |
| 96 | + } |
| 97 | + |
| 98 | + dynamicFeatures = mutableSetOf( |
| 99 | + Modules.DynamicFeature.HOME, |
| 100 | + Modules.DynamicFeature.FAVORITES, |
| 101 | + Modules.DynamicFeature.NOTIFICATION, |
| 102 | + Modules.DynamicFeature.ACCOUNT |
| 103 | + ) |
| 104 | + |
| 105 | + testOptions { |
| 106 | + unitTests.isIncludeAndroidResources = true |
| 107 | + } |
| 108 | +} |
| 109 | + |
| 110 | +dependencies { |
| 111 | + |
| 112 | + implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) |
| 113 | + |
| 114 | + implementation(project(Modules.AndroidLibrary.DATA)) |
| 115 | + implementation(project(Modules.AndroidLibrary.DOMAIN)) |
| 116 | + implementation(project(Modules.AndroidLibrary.CORE)) |
| 117 | + |
| 118 | + addAppModuleDependencies() |
| 119 | + |
| 120 | + // Unit Tests |
| 121 | + addUnitTestDependencies() |
| 122 | + testImplementation(project(Modules.AndroidLibrary.TEST_UTILS)) |
| 123 | + |
| 124 | + // Instrumentation Tests |
| 125 | + addInstrumentationTestDependencies() |
| 126 | + androidTestImplementation(project(Modules.AndroidLibrary.TEST_UTILS)) |
| 127 | +} |
0 commit comments