Created
November 8, 2021 16:26
-
-
Save ConorGarry/00f93a80dac701f757b7c4a07a96e4af to your computer and use it in GitHub Desktop.
MVP Dependencies. The Fundamental dependencies for Android, Kotlin, and testing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| plugins { | |
| id 'com.android.application' | |
| id 'kotlin-android' | |
| id 'kotlin-kapt' | |
| } | |
| android { | |
| compileSdk 31 | |
| defaultConfig { | |
| applicationId "ie.conorgarry.mvpdependencies" | |
| minSdk 21 | |
| targetSdk 30 // Targeting 31 currently not working with test Fragment. | |
| versionCode 1 | |
| versionName "1.0" | |
| testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | |
| } | |
| buildFeatures { | |
| viewBinding true | |
| } | |
| buildTypes { | |
| release { | |
| minifyEnabled false | |
| proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | |
| } | |
| } | |
| compileOptions { | |
| sourceCompatibility JavaVersion.VERSION_1_8 | |
| targetCompatibility JavaVersion.VERSION_1_8 | |
| } | |
| kotlinOptions { | |
| jvmTarget = '1.8' | |
| } | |
| } | |
| dependencies { | |
| //region MVP Dependencies | |
| // Core Android | |
| implementation 'androidx.core:core-ktx:1.7.0' | |
| implementation 'androidx.appcompat:appcompat:1.3.1' | |
| implementation 'com.google.android.material:material:1.4.0' | |
| implementation 'androidx.constraintlayout:constraintlayout:2.1.1' | |
| implementation 'androidx.legacy:legacy-support-v4:1.0.0' | |
| def fragment_version = "1.3.6" | |
| implementation "androidx.fragment:fragment-ktx:$fragment_version" | |
| debugImplementation "androidx.fragment:fragment-testing:$fragment_version" | |
| // Core Testing | |
| testImplementation 'junit:junit:' | |
| testImplementation "androidx.arch.core:core-testing:2.1.0" | |
| androidTestImplementation 'androidx.test.ext:junit:1.1.3' | |
| //noinspection GradleDependency // 3.4.0 causes: java.lang.NoSuchMethodError: No static method `loadSingleServiceOrNull`. | |
| androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' | |
| androidTestImplementation "androidx.test.uiautomator:uiautomator:2.2.0" | |
| def mockk_version = "1.12.0" | |
| //testImplementation "io.mockk:mockk:$mockk_version" | |
| // Unit | |
| testImplementation "io.mockk:mockk:$mockk_version" | |
| testImplementation "io.mockk:mockk-agent-jvm:$mockk_version" | |
| // Instrumented | |
| androidTestImplementation "io.mockk:mockk-android:$mockk_version" | |
| //androidTestImplementation "io.mockk:mockk-agent-jvm:$mockk_version" | |
| // AAC | |
| def lifecycle_version = "2.4.0" | |
| def arch_version = "2.1.0" | |
| implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" | |
| implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version" | |
| // Test helpers for LiveData | |
| testImplementation "androidx.arch.core:core-testing:$arch_version" | |
| // Coroutines | |
| def coroutines_version = "1.5.1" | |
| api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" | |
| api "org.jetbrains.kotlinx:kotlinx-coroutines-rx2:$coroutines_version" | |
| testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version") | |
| // Serialisation | |
| def moshi_version = "1.12.0" | |
| implementation("com.squareup.moshi:moshi:$moshi_version") | |
| api "com.squareup.moshi:moshi-kotlin:$moshi_version" | |
| // Retrofit | |
| def retrofit_version = "2.9.0" | |
| implementation("com.squareup.retrofit2:retrofit:$retrofit_version") | |
| implementation("com.squareup.retrofit2:converter-moshi:$retrofit_version") | |
| def okhttp_version = "4.9.1" | |
| implementation("com.squareup.okhttp3:logging-interceptor:$okhttp_version") | |
| // Or just OkHttp if Retrofit isn't necessary. | |
| //implementation("com.squareup.okhttp3:okhttp:$okhttp_version") | |
| // Image Loading | |
| def coil_version = "1.4.0" | |
| implementation "io.coil-kt:coil:$coil_version" | |
| // Navigation | |
| def nav_version = "2.3.5" | |
| implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" | |
| implementation "androidx.navigation:navigation-ui-ktx:$nav_version" | |
| // Dependency Injection | |
| def dagger_version = "2.40" | |
| implementation "com.google.dagger:dagger:$dagger_version" | |
| kapt "com.google.dagger:dagger-compiler:$dagger_version" | |
| // Logging | |
| def timber_version = "5.0.1" | |
| implementation "com.jakewharton.timber:timber:$timber_version" | |
| //endregion | |
| // Stripe Payments | |
| implementation 'com.stripe:stripe-android:18.2.0' | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment