|
| 1 | +// Top-level build file where you can add configuration options common to all sub-projects/modules. |
| 2 | + |
| 3 | +buildscript { |
| 4 | + ext.kotlin_version = '1.3.50' |
| 5 | + |
| 6 | + ext { |
| 7 | + |
| 8 | + // global variables |
| 9 | + compile_sdk_version = 29 |
| 10 | + kotlin_version = '1.3.60' |
| 11 | + min_sdk_version = 21 |
| 12 | + |
| 13 | + // local variables (use def) |
| 14 | + def androidx_test_version = '1.2.0' |
| 15 | + def annotations_version = '1.1.0' |
| 16 | + def appcompat_version = '1.1.0' |
| 17 | + def constraint_layout_version = '1.1.3' |
| 18 | + def coroutines_android_version = '1.3.0' |
| 19 | + def expresso_version = '3.2.0' |
| 20 | + def glide_version = '4.10.0' |
| 21 | + def gson_version = '2.8.6' |
| 22 | + def junit_version = '4.12' |
| 23 | + def lifecycle_version = '2.1.0' |
| 24 | + def livedata_version = '2.2.0-rc02' |
| 25 | + def material_version = '1.1.0-alpha09' |
| 26 | + def retrofit_gson_version = '2.6.2' |
| 27 | + def retrofit_version = '2.6.2' |
| 28 | + def room_version = '2.2.1' |
| 29 | + def truth_version = '1.0' |
| 30 | + def work_version = '2.2.0' |
| 31 | + |
| 32 | + libraries = [ |
| 33 | + // Kotlin standard library |
| 34 | + "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version", |
| 35 | + |
| 36 | + // Coroutines |
| 37 | + "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_android_version", |
| 38 | + "org.jetbrains.kotlinx:kotlinx-coroutines-android:${coroutines_android_version}", |
| 39 | + |
| 40 | + // Android UI and appcompat |
| 41 | + "androidx.appcompat:appcompat:$appcompat_version", |
| 42 | + "com.google.android.material:material:$material_version", |
| 43 | + "androidx.constraintlayout:constraintlayout:$constraint_layout_version", |
| 44 | + "androidx.fragment:fragment-ktx:1.1.0", |
| 45 | + |
| 46 | + // Glide |
| 47 | + "com.github.bumptech.glide:glide:$glide_version", |
| 48 | + |
| 49 | + // ViewModel and LiveData |
| 50 | + "androidx.lifecycle:lifecycle-extensions:$lifecycle_version", |
| 51 | + "androidx.lifecycle:lifecycle-livedata-ktx:$livedata_version", |
| 52 | + "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version", |
| 53 | + |
| 54 | + // network & serialization |
| 55 | + "com.google.code.gson:gson:$gson_version", |
| 56 | + "com.squareup.retrofit2:converter-gson:$retrofit_gson_version", |
| 57 | + "com.squareup.retrofit2:retrofit:$retrofit_version", |
| 58 | + |
| 59 | + // threading |
| 60 | + "androidx.annotation:annotation:$annotations_version" |
| 61 | + ] |
| 62 | + |
| 63 | + arch_libraries = [ |
| 64 | + "androidx.work:work-runtime-ktx:$work_version", |
| 65 | + |
| 66 | + // Room for database |
| 67 | + "androidx.room:room-ktx:$room_version" |
| 68 | + ] |
| 69 | + |
| 70 | + librariesKapt = [ |
| 71 | + "androidx.room:room-compiler:$room_version", |
| 72 | + "com.github.bumptech.glide:compiler:$glide_version" |
| 73 | + ] |
| 74 | + |
| 75 | + librariesDebug = [ |
| 76 | + "com.google.truth:truth:$truth_version" |
| 77 | + ] |
| 78 | + |
| 79 | + testLibraries = [ |
| 80 | + "junit:junit:$junit_version", |
| 81 | + // Coroutines testing |
| 82 | + "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_android_version", |
| 83 | + |
| 84 | + // mocks |
| 85 | + "org.mockito:mockito-core:2.23.0", |
| 86 | + |
| 87 | + // Architecture Components testing libraries |
| 88 | + "androidx.arch.core:core-testing:$lifecycle_version" |
| 89 | + ] |
| 90 | + |
| 91 | + androidTestLibraries = [ |
| 92 | + "junit:junit:$junit_version", |
| 93 | + "androidx.test:runner:$androidx_test_version", |
| 94 | + "androidx.test:rules:$androidx_test_version", |
| 95 | + |
| 96 | + // Espresso |
| 97 | + "androidx.test.espresso:espresso-core:$expresso_version", |
| 98 | + "androidx.test.espresso:espresso-contrib:$expresso_version", |
| 99 | + "androidx.test.espresso:espresso-intents:$expresso_version", |
| 100 | + |
| 101 | + // Architecture Components testing libraries |
| 102 | + "androidx.arch.core:core-testing:$lifecycle_version", |
| 103 | + "androidx.work:work-testing:$work_version", |
| 104 | + |
| 105 | + ] |
| 106 | + } |
| 107 | + |
| 108 | + repositories { |
| 109 | + google() |
| 110 | + jcenter() |
| 111 | + } |
| 112 | + dependencies { |
| 113 | + classpath 'com.android.tools.build:gradle:3.5.2' |
| 114 | + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |
| 115 | + // NOTE: Do not place your application dependencies here; they belong |
| 116 | + // in the individual module build.gradle files |
| 117 | + } |
| 118 | +} |
| 119 | + |
| 120 | +allprojects { |
| 121 | + repositories { |
| 122 | + google() |
| 123 | + jcenter() |
| 124 | + } |
| 125 | +} |
| 126 | + |
| 127 | +task clean(type: Delete) { |
| 128 | + delete rootProject.buildDir |
| 129 | +} |
0 commit comments