Merge pull request #64 from kirmanak/kotlin-migration
Migrate to Kotlin DSL
This commit is contained in:
210
app/build.gradle
210
app/build.gradle
@@ -1,210 +0,0 @@
|
||||
plugins {
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.android.application'
|
||||
id 'androidx.navigation.safeargs.kotlin'
|
||||
id 'dagger.hilt.android.plugin'
|
||||
id 'org.jetbrains.kotlin.plugin.serialization'
|
||||
id 'com.google.gms.google-services'
|
||||
id 'com.google.firebase.crashlytics'
|
||||
id "com.guardsquare.appsweep" version "$appsweep_version"
|
||||
id "com.google.protobuf" version "$protobuf_plugin_version"
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk compile_sdk_version
|
||||
|
||||
defaultConfig {
|
||||
applicationId "gq.kirmanak.mealient"
|
||||
minSdk min_sdk_version
|
||||
targetSdk target_sdk_version
|
||||
versionCode 13
|
||||
versionName "0.2.4"
|
||||
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
|
||||
}
|
||||
}
|
||||
|
||||
buildConfigField "Boolean", "LOG_NETWORK", "false"
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
rootProject.file("keystore.properties").with { keystorePropertiesFile ->
|
||||
if (keystorePropertiesFile.canRead()) {
|
||||
def keystoreProperties = new Properties()
|
||||
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||
|
||||
keyAlias keystoreProperties['keyAlias']
|
||||
keyPassword keystoreProperties['keyPassword']
|
||||
storeFile file(keystoreProperties['storeFile'])
|
||||
storePassword keystoreProperties['storePassword']
|
||||
} else {
|
||||
println 'Unable to read keystore.properties'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
ext.enableCrashlytics = false
|
||||
testCoverageEnabled true
|
||||
}
|
||||
release {
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
}
|
||||
|
||||
testOptions {
|
||||
unitTests {
|
||||
includeAndroidResources = true
|
||||
all {
|
||||
jacoco {
|
||||
includeNoLocationClasses = true
|
||||
excludes = ['jdk.internal.*']
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lint {
|
||||
disable 'ObsoleteLintCustomCheck', 'IconMissingDensityFolder'
|
||||
enable 'ConvertToWebp', 'DuplicateStrings', 'EasterEgg', 'ExpensiveAssertion', 'IconExpectedSize', 'ImplicitSamInstance', 'InvalidPackage', 'KotlinPropertyAccess', 'LambdaLast', 'MinSdkTooLow', 'NegativeMargin', 'NoHardKeywords', 'Registered', 'RequiredSize', 'UnknownNullness', 'WrongThreadInterprocedural'
|
||||
}
|
||||
|
||||
namespace 'gq.kirmanak.mealient'
|
||||
|
||||
packagingOptions {
|
||||
resources.excludes += "DebugProbesKt.bin"
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
coreLibraryDesugaringEnabled true
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:$desugar_version"
|
||||
|
||||
implementation "com.google.android.material:material:$material_version"
|
||||
|
||||
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
|
||||
implementation "androidx.navigation:navigation-runtime-ktx:$nav_version"
|
||||
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
|
||||
|
||||
implementation "androidx.core:core-ktx:$core_ktx_version"
|
||||
|
||||
implementation "androidx.appcompat:appcompat:$appcompat_version"
|
||||
|
||||
implementation "androidx.constraintlayout:constraintlayout:$contraint_layout_version"
|
||||
|
||||
implementation "androidx.swiperefreshlayout:swiperefreshlayout:$swipe_refresh_layout_version"
|
||||
|
||||
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
|
||||
|
||||
implementation "com.google.dagger:hilt-android:$hilt_version"
|
||||
kapt "com.google.dagger:hilt-compiler:$hilt_version"
|
||||
kaptTest "com.google.dagger:hilt-android-compiler:$hilt_version"
|
||||
testImplementation "com.google.dagger:hilt-android-testing:$hilt_version"
|
||||
|
||||
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
|
||||
|
||||
implementation "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:$retrofit_kotlinx_serialization_version"
|
||||
|
||||
implementation platform("com.squareup.okhttp3:okhttp-bom:$okhttp_version")
|
||||
implementation "com.squareup.okhttp3:okhttp"
|
||||
debugImplementation "com.squareup.okhttp3:logging-interceptor"
|
||||
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinx_serialization_version"
|
||||
|
||||
implementation "com.jakewharton.timber:timber:$timber_version"
|
||||
|
||||
implementation "androidx.paging:paging-runtime-ktx:$paging_version"
|
||||
testImplementation "androidx.paging:paging-common-ktx:$paging_version"
|
||||
|
||||
implementation "androidx.room:room-runtime:$room_version"
|
||||
implementation "androidx.room:room-ktx:$room_version"
|
||||
implementation "androidx.room:room-paging:$room_version"
|
||||
kapt "androidx.room:room-compiler:$room_version"
|
||||
testImplementation "androidx.room:room-testing:$room_version"
|
||||
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-datetime:$kotlinx_datetime_version"
|
||||
|
||||
implementation "com.github.bumptech.glide:glide:$glide_version"
|
||||
implementation "com.github.bumptech.glide:okhttp3-integration:$glide_version"
|
||||
implementation("com.github.bumptech.glide:recyclerview-integration:$glide_version") {
|
||||
// Excludes the support library because it's already included by Glide.
|
||||
transitive = false
|
||||
}
|
||||
kapt "com.github.bumptech.glide:compiler:$glide_version"
|
||||
|
||||
implementation "com.github.kirich1409:viewbindingpropertydelegate-noreflection:$view_binding_delegate_version"
|
||||
|
||||
implementation "androidx.datastore:datastore-preferences:$datastore_version"
|
||||
implementation "androidx.datastore:datastore:$datastore_version"
|
||||
|
||||
implementation "com.google.protobuf:protobuf-javalite:$protobuf_version"
|
||||
|
||||
implementation "androidx.security:security-crypto:$security_version"
|
||||
|
||||
implementation platform("com.google.firebase:firebase-bom:$firebase_version")
|
||||
implementation "com.google.firebase:firebase-analytics-ktx"
|
||||
implementation "com.google.firebase:firebase-crashlytics-ktx"
|
||||
|
||||
testImplementation "junit:junit:$junit_version"
|
||||
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
|
||||
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"
|
||||
|
||||
testImplementation "org.robolectric:robolectric:$robolectric_version"
|
||||
|
||||
testImplementation "androidx.test.ext:junit-ktx:$junit_ktx_version"
|
||||
|
||||
testImplementation "com.google.truth:truth:$truth_version"
|
||||
|
||||
testImplementation "io.mockk:mockk:$mockk_version"
|
||||
|
||||
debugImplementation "com.facebook.flipper:flipper:$flipper_version"
|
||||
debugImplementation "com.facebook.flipper:flipper-leakcanary2-plugin:$flipper_version"
|
||||
debugImplementation "com.facebook.flipper:flipper-network-plugin:$flipper_version"
|
||||
|
||||
debugImplementation "com.facebook.soloader:soloader:$soloader_version"
|
||||
|
||||
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakcanary_version"
|
||||
|
||||
// https://github.com/ChuckerTeam/chucker/releases
|
||||
debugImplementation "com.github.chuckerteam.chucker:library:$chucker_version"
|
||||
}
|
||||
|
||||
protobuf {
|
||||
protoc {
|
||||
artifact = "com.google.protobuf:protoc:$protobuf_version"
|
||||
}
|
||||
|
||||
generateProtoTasks {
|
||||
all().each { task ->
|
||||
task.builtins {
|
||||
java {
|
||||
option 'lite'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
238
app/build.gradle.kts
Normal file
238
app/build.gradle.kts
Normal file
@@ -0,0 +1,238 @@
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
|
||||
import com.google.protobuf.gradle.builtins
|
||||
import com.google.protobuf.gradle.generateProtoTasks
|
||||
import com.google.protobuf.gradle.protobuf
|
||||
import com.google.protobuf.gradle.protoc
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import java.io.FileInputStream
|
||||
import java.util.*
|
||||
|
||||
plugins {
|
||||
id("kotlin-android")
|
||||
id("kotlin-kapt")
|
||||
id("com.android.application")
|
||||
id("androidx.navigation.safeargs.kotlin")
|
||||
id("dagger.hilt.android.plugin")
|
||||
id("org.jetbrains.kotlin.plugin.serialization")
|
||||
id("com.google.gms.google-services")
|
||||
id("com.google.firebase.crashlytics")
|
||||
id("com.guardsquare.appsweep") version Dependencies.appsweepVersion
|
||||
id("com.google.protobuf") version Dependencies.protobufPluginVersion
|
||||
id("com.google.devtools.ksp") version Dependencies.kspPluginVersion
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = Dependencies.compileSdkVersion
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "gq.kirmanak.mealient"
|
||||
minSdk = Dependencies.minSdkVersion
|
||||
targetSdk = Dependencies.targetSdkVersion
|
||||
versionCode = 13
|
||||
versionName = "0.2.4"
|
||||
|
||||
ksp {
|
||||
arg("room.schemaLocation", "$projectDir/schemas")
|
||||
}
|
||||
|
||||
buildConfigField("Boolean", "LOG_NETWORK", "false")
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
rootProject.file("keystore.properties").also { keystorePropertiesFile ->
|
||||
if (keystorePropertiesFile.canRead()) {
|
||||
val keystoreProperties = Properties()
|
||||
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
||||
|
||||
keyAlias = keystoreProperties.getProperty("keyAlias")
|
||||
keyPassword = keystoreProperties.getProperty("keyPassword")
|
||||
storeFile = file(keystoreProperties.getProperty("storeFile"))
|
||||
storePassword = keystoreProperties.getProperty("storePassword")
|
||||
} else {
|
||||
println("Unable to read keystore.properties")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
getByName("debug") {
|
||||
ext["enableCrashlytics"] = false
|
||||
isTestCoverageEnabled = true
|
||||
}
|
||||
getByName("release") {
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
viewBinding = true
|
||||
}
|
||||
|
||||
testOptions {
|
||||
unitTests {
|
||||
isIncludeAndroidResources = true
|
||||
}
|
||||
}
|
||||
|
||||
lint {
|
||||
disable += listOf("ObsoleteLintCustomCheck", "IconMissingDensityFolder")
|
||||
enable += listOf(
|
||||
"ConvertToWebp",
|
||||
"DuplicateStrings",
|
||||
"EasterEgg",
|
||||
"ExpensiveAssertion",
|
||||
"IconExpectedSize",
|
||||
"ImplicitSamInstance",
|
||||
"InvalidPackage",
|
||||
"KotlinPropertyAccess",
|
||||
"LambdaLast",
|
||||
"MinSdkTooLow",
|
||||
"NegativeMargin",
|
||||
"NoHardKeywords",
|
||||
"Registered",
|
||||
"RequiredSize",
|
||||
"UnknownNullness",
|
||||
"WrongThreadInterprocedural"
|
||||
)
|
||||
}
|
||||
|
||||
namespace = "gq.kirmanak.mealient"
|
||||
|
||||
packagingOptions {
|
||||
resources.excludes += "DebugProbesKt.bin"
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
isCoreLibraryDesugaringEnabled = true
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<Test>().configureEach {
|
||||
configure<JacocoTaskExtension> {
|
||||
isIncludeNoLocationClasses = true
|
||||
excludes = listOf("jdk.internal.*")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:${Dependencies.desugarVersion}")
|
||||
|
||||
implementation("com.google.android.material:material:${Dependencies.materialVersion}")
|
||||
|
||||
implementation("androidx.navigation:navigation-fragment-ktx:${Dependencies.navVersion}")
|
||||
implementation("androidx.navigation:navigation-runtime-ktx:${Dependencies.navVersion}")
|
||||
implementation("androidx.navigation:navigation-ui-ktx:${Dependencies.navVersion}")
|
||||
|
||||
implementation("androidx.core:core-ktx:${Dependencies.coreKtxVersion}")
|
||||
|
||||
implementation("androidx.appcompat:appcompat:${Dependencies.appcompatVersion}")
|
||||
|
||||
implementation("androidx.constraintlayout:constraintlayout:${Dependencies.contraintLayoutVersion}")
|
||||
|
||||
implementation("androidx.swiperefreshlayout:swiperefreshlayout:${Dependencies.swipeRefreshLayoutVersion}")
|
||||
|
||||
implementation("androidx.lifecycle:lifecycle-livedata-ktx:${Dependencies.lifecycleVersion}")
|
||||
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:${Dependencies.lifecycleVersion}")
|
||||
|
||||
implementation("com.google.dagger:hilt-android:${Dependencies.hiltVersion}")
|
||||
kapt("com.google.dagger:hilt-compiler:${Dependencies.hiltVersion}")
|
||||
kaptTest("com.google.dagger:hilt-android-compiler:${Dependencies.hiltVersion}")
|
||||
testImplementation("com.google.dagger:hilt-android-testing:${Dependencies.hiltVersion}")
|
||||
|
||||
implementation("com.squareup.retrofit2:retrofit:${Dependencies.retrofitVersion}")
|
||||
|
||||
implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:${Dependencies.retrofitKotlinxSerializationVersion}")
|
||||
|
||||
implementation(platform("com.squareup.okhttp3:okhttp-bom:${Dependencies.okhttpVersion}"))
|
||||
implementation("com.squareup.okhttp3:okhttp")
|
||||
debugImplementation("com.squareup.okhttp3:logging-interceptor")
|
||||
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:${Dependencies.kotlinxSerializationVersion}")
|
||||
|
||||
implementation("com.jakewharton.timber:timber:${Dependencies.timberVersion}")
|
||||
|
||||
implementation("androidx.paging:paging-runtime-ktx:${Dependencies.pagingVersion}")
|
||||
testImplementation("androidx.paging:paging-common-ktx:${Dependencies.pagingVersion}")
|
||||
|
||||
implementation("androidx.room:room-runtime:${Dependencies.roomVersion}")
|
||||
implementation("androidx.room:room-ktx:${Dependencies.roomVersion}")
|
||||
implementation("androidx.room:room-paging:${Dependencies.roomVersion}")
|
||||
ksp("androidx.room:room-compiler:${Dependencies.roomVersion}")
|
||||
testImplementation("androidx.room:room-testing:${Dependencies.roomVersion}")
|
||||
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-datetime:${Dependencies.kotlinxDatetimeVersion}")
|
||||
|
||||
implementation("com.github.bumptech.glide:glide:${Dependencies.glideVersion}")
|
||||
implementation("com.github.bumptech.glide:okhttp3-integration:${Dependencies.glideVersion}")
|
||||
implementation("com.github.bumptech.glide:recyclerview-integration:${Dependencies.glideVersion}") {
|
||||
// Excludes the support library because it's already included by Glide.
|
||||
isTransitive = false
|
||||
}
|
||||
kapt("com.github.bumptech.glide:compiler:${Dependencies.glideVersion}")
|
||||
|
||||
implementation("com.github.kirich1409:viewbindingpropertydelegate-noreflection:${Dependencies.viewBindingDelegateVersion}")
|
||||
|
||||
implementation("androidx.datastore:datastore-preferences:${Dependencies.datastoreVersion}")
|
||||
implementation("androidx.datastore:datastore:${Dependencies.datastoreVersion}")
|
||||
|
||||
implementation("com.google.protobuf:protobuf-javalite:${Dependencies.protobufVersion}")
|
||||
|
||||
implementation("androidx.security:security-crypto:${Dependencies.securityVersion}")
|
||||
|
||||
implementation(platform("com.google.firebase:firebase-bom:${Dependencies.firebaseVersion}"))
|
||||
implementation("com.google.firebase:firebase-analytics-ktx")
|
||||
implementation("com.google.firebase:firebase-crashlytics-ktx")
|
||||
|
||||
testImplementation("junit:junit:${Dependencies.junitVersion}")
|
||||
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:${Dependencies.coroutinesVersion}")
|
||||
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:${Dependencies.coroutinesVersion}")
|
||||
|
||||
testImplementation("org.robolectric:robolectric:${Dependencies.robolectricVersion}")
|
||||
|
||||
testImplementation("androidx.test.ext:junit-ktx:${Dependencies.junitKtxVersion}")
|
||||
|
||||
testImplementation("com.google.truth:truth:${Dependencies.truthVersion}")
|
||||
|
||||
testImplementation("io.mockk:mockk:${Dependencies.mockkVersion}")
|
||||
|
||||
debugImplementation("com.squareup.leakcanary:leakcanary-android:${Dependencies.leakcanaryVersion}")
|
||||
|
||||
// https://github.com/ChuckerTeam/chucker/releases
|
||||
debugImplementation("com.github.chuckerteam.chucker:library:${Dependencies.chuckerVersion}")
|
||||
}
|
||||
|
||||
protobuf {
|
||||
protoc {
|
||||
artifact = "com.google.protobuf:protoc:${Dependencies.protobufVersion}"
|
||||
}
|
||||
|
||||
generateProtoTasks {
|
||||
all().forEach { task ->
|
||||
task.builtins {
|
||||
val java by registering {
|
||||
option("lite")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
kapt {
|
||||
correctErrorTypes = true
|
||||
}
|
||||
@@ -1,33 +1,15 @@
|
||||
package gq.kirmanak.mealient
|
||||
|
||||
import android.app.Application
|
||||
import com.facebook.flipper.android.AndroidFlipperClient
|
||||
import com.facebook.flipper.android.utils.FlipperUtils
|
||||
import com.facebook.flipper.core.FlipperPlugin
|
||||
import com.facebook.soloader.SoLoader
|
||||
import dagger.hilt.android.HiltAndroidApp
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
||||
@HiltAndroidApp
|
||||
class App : Application() {
|
||||
// Use @JvmSuppressWildcards because otherwise dagger can't inject it (https://stackoverflow.com/a/43149382)
|
||||
@Inject
|
||||
lateinit var flipperPlugins: Set<@JvmSuppressWildcards FlipperPlugin>
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
Timber.plant(Timber.DebugTree())
|
||||
Timber.v("onCreate() called")
|
||||
setupFlipper()
|
||||
}
|
||||
|
||||
private fun setupFlipper() {
|
||||
if (FlipperUtils.shouldEnableFlipper(this)) {
|
||||
SoLoader.init(this, false)
|
||||
val flipperClient = AndroidFlipperClient.getInstance(this)
|
||||
for (flipperPlugin in flipperPlugins) flipperClient.addPlugin(flipperPlugin)
|
||||
flipperClient.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,15 +4,6 @@ import android.content.Context
|
||||
import com.chuckerteam.chucker.api.ChuckerCollector
|
||||
import com.chuckerteam.chucker.api.ChuckerInterceptor
|
||||
import com.chuckerteam.chucker.api.RetentionManager
|
||||
import com.facebook.flipper.core.FlipperPlugin
|
||||
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin
|
||||
import com.facebook.flipper.plugins.inspector.DescriptorMapping
|
||||
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin
|
||||
import com.facebook.flipper.plugins.leakcanary2.FlipperLeakListener
|
||||
import com.facebook.flipper.plugins.leakcanary2.LeakCanary2FlipperPlugin
|
||||
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor
|
||||
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin
|
||||
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
@@ -20,7 +11,6 @@ import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import dagger.multibindings.IntoSet
|
||||
import gq.kirmanak.mealient.BuildConfig
|
||||
import leakcanary.LeakCanary
|
||||
import okhttp3.Interceptor
|
||||
import okhttp3.logging.HttpLoggingInterceptor
|
||||
import timber.log.Timber
|
||||
@@ -55,46 +45,4 @@ object DebugModule {
|
||||
.alwaysReadResponseBody(true)
|
||||
.build()
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
@IntoSet
|
||||
fun provideFlipperInterceptor(networkFlipperPlugin: NetworkFlipperPlugin): Interceptor {
|
||||
return FlipperOkhttpInterceptor(networkFlipperPlugin)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun networkFlipperPlugin() = NetworkFlipperPlugin()
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
@IntoSet
|
||||
fun bindNetworkFlipperPlugin(plugin: NetworkFlipperPlugin): FlipperPlugin = plugin
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
@IntoSet
|
||||
fun sharedPreferencesPlugin(@ApplicationContext context: Context): FlipperPlugin =
|
||||
SharedPreferencesFlipperPlugin(context)
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
@IntoSet
|
||||
fun leakCanaryPlugin(): FlipperPlugin {
|
||||
LeakCanary.config = LeakCanary.config.copy(onHeapAnalyzedListener = FlipperLeakListener())
|
||||
return LeakCanary2FlipperPlugin()
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
@IntoSet
|
||||
fun databasesPlugin(@ApplicationContext context: Context): FlipperPlugin =
|
||||
DatabasesFlipperPlugin(context)
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
@IntoSet
|
||||
fun inspectorPlugin(@ApplicationContext context: Context): FlipperPlugin =
|
||||
InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())
|
||||
}
|
||||
|
||||
42
build.gradle
42
build.gradle
@@ -1,42 +0,0 @@
|
||||
buildscript {
|
||||
|
||||
apply from: "./gradle/versions.gradle"
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "com.android.tools.build:gradle:$android_plugin_version"
|
||||
classpath "com.google.gms:google-services:$google_services_version"
|
||||
classpath "com.google.firebase:firebase-crashlytics-gradle:$crashlytics_version"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
||||
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
|
||||
classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "org.sonarqube" version "$sonarqube_version"
|
||||
id "nl.neotech.plugin.rootcoverage" version "$root_coverage_version"
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
||||
sonarqube {
|
||||
properties {
|
||||
property "sonar.projectKey", "kirmanak_Mealient"
|
||||
property "sonar.organization", "kirmanak"
|
||||
property "sonar.host.url", "https://sonarcloud.io"
|
||||
property "sonar.androidLint.reportPaths", "build/reports/lint-results-debug.xml"
|
||||
property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco.xml"
|
||||
}
|
||||
}
|
||||
|
||||
rootCoverage {
|
||||
generateXml true
|
||||
}
|
||||
36
build.gradle.kts
Normal file
36
build.gradle.kts
Normal file
@@ -0,0 +1,36 @@
|
||||
buildscript {
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath("com.android.tools.build:gradle:${Dependencies.androidPluginVersion}")
|
||||
classpath("com.google.gms:google-services:${Dependencies.googleServicesVersion}")
|
||||
classpath("com.google.firebase:firebase-crashlytics-gradle:${Dependencies.crashlyticsVersion}")
|
||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Dependencies.kotlinVersion}")
|
||||
classpath("org.jetbrains.kotlin:kotlin-serialization:${Dependencies.kotlinVersion}")
|
||||
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:${Dependencies.navVersion}")
|
||||
classpath("com.google.dagger:hilt-android-gradle-plugin:${Dependencies.hiltVersion}")
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("org.sonarqube") version Dependencies.sonarqubeVersion
|
||||
id("nl.neotech.plugin.rootcoverage") version Dependencies.rootCoverageVersion
|
||||
}
|
||||
|
||||
sonarqube {
|
||||
properties {
|
||||
property("sonar.projectKey", "kirmanak_Mealient")
|
||||
property("sonar.organization", "kirmanak")
|
||||
property("sonar.host.url", "https://sonarcloud.io")
|
||||
property("sonar.androidLint.reportPaths", "build/reports/lint-results-debug.xml")
|
||||
property("sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco.xml")
|
||||
}
|
||||
}
|
||||
|
||||
rootCoverage {
|
||||
generateXml = true
|
||||
}
|
||||
1
buildSrc/.gitignore
vendored
Normal file
1
buildSrc/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
7
buildSrc/build.gradle.kts
Normal file
7
buildSrc/build.gradle.kts
Normal file
@@ -0,0 +1,7 @@
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
@@ -1,123 +1,125 @@
|
||||
ext {
|
||||
object Dependencies {
|
||||
const val compileSdkVersion = 32
|
||||
const val minSdkVersion = 23
|
||||
const val targetSdkVersion = 32
|
||||
|
||||
// https://github.com/protocolbuffers/protobuf/releases
|
||||
protobuf_version = "3.21.1"
|
||||
const val protobufVersion = "3.21.4"
|
||||
|
||||
// https://github.com/google/protobuf-gradle-plugin/releases
|
||||
protobuf_plugin_version = "0.8.18"
|
||||
const val protobufPluginVersion = "0.8.19"
|
||||
|
||||
// https://developer.android.com/jetpack/androidx/releases/navigation
|
||||
nav_version = "2.4.2"
|
||||
const val navVersion = "2.5.1"
|
||||
|
||||
// https://dagger.dev/hilt/gradle-setup
|
||||
hilt_version = "2.42"
|
||||
const val hiltVersion = "2.43.1"
|
||||
|
||||
// https://kotlinlang.org/docs/gradle.html
|
||||
kotlin_version = "1.6.21"
|
||||
const val kotlinVersion = "1.7.10"
|
||||
|
||||
// https://maven.google.com/web/index.html?q=com.android.tools.build#com.android.tools.build:gradle
|
||||
android_plugin_version = "7.2.1"
|
||||
const val androidPluginVersion = "7.2.1"
|
||||
|
||||
// https://developers.google.com/android/guides/google-services-plugin
|
||||
google_services_version = "4.3.10"
|
||||
const val googleServicesVersion = "4.3.13"
|
||||
|
||||
// https://mvnrepository.com/artifact/com.google.firebase/firebase-crashlytics-gradle
|
||||
crashlytics_version = "2.9.0"
|
||||
const val crashlyticsVersion = "2.9.1"
|
||||
|
||||
// https://plugins.gradle.org/plugin/org.sonarqube
|
||||
sonarqube_version = "3.4.0.2513"
|
||||
const val sonarqubeVersion = "3.4.0.2513"
|
||||
|
||||
// https://plugins.gradle.org/plugin/nl.neotech.plugin.rootcoverage
|
||||
root_coverage_version = "1.5.2"
|
||||
const val rootCoverageVersion = "1.5.3"
|
||||
|
||||
// https://plugins.gradle.org/plugin/com.guardsquare.appsweep
|
||||
appsweep_version = "1.0.0"
|
||||
|
||||
compile_sdk_version = 32
|
||||
min_sdk_version = 23
|
||||
target_sdk_version = 32
|
||||
const val appsweepVersion = "1.1.0"
|
||||
|
||||
// https://github.com/material-components/material-components-android/releases
|
||||
material_version = "1.6.1"
|
||||
const val materialVersion = "1.6.1"
|
||||
|
||||
// https://developer.android.com/kotlin/ktx#core
|
||||
core_ktx_version = "1.8.0"
|
||||
const val coreKtxVersion = "1.8.0"
|
||||
|
||||
// https://developer.android.com/jetpack/androidx/releases/appcompat
|
||||
appcompat_version = "1.4.2"
|
||||
const val appcompatVersion = "1.4.2"
|
||||
|
||||
// https://developer.android.com/jetpack/androidx/releases/constraintlayout
|
||||
contraint_layout_version = "2.1.4"
|
||||
const val contraintLayoutVersion = "2.1.4"
|
||||
|
||||
// https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout
|
||||
swipe_refresh_layout_version = "1.1.0"
|
||||
const val swipeRefreshLayoutVersion = "1.1.0"
|
||||
|
||||
// https://developer.android.com/jetpack/androidx/releases/lifecycle
|
||||
lifecycle_version = "2.4.1"
|
||||
const val lifecycleVersion = "2.5.1"
|
||||
|
||||
// https://github.com/square/retrofit/tags
|
||||
retrofit_version = "2.9.0"
|
||||
const val retrofitVersion = "2.9.0"
|
||||
|
||||
// https://github.com/JakeWharton/retrofit2-kotlinx-serialization-converter/tags
|
||||
retrofit_kotlinx_serialization_version = "0.8.0"
|
||||
const val retrofitKotlinxSerializationVersion = "0.8.0"
|
||||
|
||||
// https://github.com/Kotlin/kotlinx.serialization/releases
|
||||
kotlinx_serialization_version = "1.3.3"
|
||||
const val kotlinxSerializationVersion = "1.3.3"
|
||||
|
||||
// https://github.com/square/okhttp/tags
|
||||
okhttp_version = "4.10.0"
|
||||
const val okhttpVersion = "4.10.0"
|
||||
|
||||
// https://github.com/JakeWharton/timber/releases
|
||||
timber_version = "5.0.1"
|
||||
const val timberVersion = "5.0.1"
|
||||
|
||||
// https://developer.android.com/jetpack/androidx/releases/paging
|
||||
paging_version = "3.1.1"
|
||||
const val pagingVersion = "3.1.1"
|
||||
|
||||
// https://developer.android.com/jetpack/androidx/releases/room
|
||||
room_version = "2.4.2"
|
||||
const val roomVersion = "2.4.3"
|
||||
|
||||
// https://github.com/Kotlin/kotlinx-datetime/releases
|
||||
kotlinx_datetime_version = "0.3.3"
|
||||
const val kotlinxDatetimeVersion = "0.4.0"
|
||||
|
||||
// https://github.com/bumptech/glide/releases
|
||||
glide_version = "4.13.2"
|
||||
const val glideVersion = "4.13.2"
|
||||
|
||||
// https://github.com/androidbroadcast/ViewBindingPropertyDelegate/releases
|
||||
view_binding_delegate_version = "1.5.6"
|
||||
const val viewBindingDelegateVersion = "1.5.6"
|
||||
|
||||
// https://developer.android.com/jetpack/androidx/releases/datastore
|
||||
datastore_version = "1.0.0"
|
||||
const val datastoreVersion = "1.0.0"
|
||||
|
||||
// https://developer.android.com/jetpack/androidx/releases/security
|
||||
security_version = "1.0.0"
|
||||
const val securityVersion = "1.0.0"
|
||||
|
||||
// https://mvnrepository.com/artifact/com.google.firebase/firebase-bom?repo=google
|
||||
firebase_version = "30.1.0"
|
||||
const val firebaseVersion = "30.3.1"
|
||||
|
||||
// https://github.com/junit-team/junit4/releases
|
||||
junit_version = "4.13.2"
|
||||
const val junitVersion = "4.13.2"
|
||||
|
||||
// https://developer.android.com/jetpack/androidx/releases/test
|
||||
junit_ktx_version = "1.1.3"
|
||||
const val junitKtxVersion = "1.1.3"
|
||||
|
||||
// https://github.com/Kotlin/kotlinx.coroutines/releases
|
||||
coroutines_version = "1.6.2"
|
||||
const val coroutinesVersion = "1.6.4"
|
||||
|
||||
// https://github.com/robolectric/robolectric/releases
|
||||
robolectric_version = "4.8.1"
|
||||
const val robolectricVersion = "4.8.1"
|
||||
|
||||
// https://mvnrepository.com/artifact/com.google.truth/truth
|
||||
truth_version = "1.1.3"
|
||||
const val truthVersion = "1.1.3"
|
||||
|
||||
// https://mockk.io/
|
||||
mockk_version = "1.12.4"
|
||||
|
||||
// https://github.com/facebook/flipper/releases
|
||||
flipper_version = "0.149.0"
|
||||
// https://github.com/facebook/SoLoader/releases
|
||||
soloader_version = "0.10.3"
|
||||
const val mockkVersion = "1.12.5"
|
||||
|
||||
// https://github.com/square/leakcanary/releases
|
||||
leakcanary_version = "2.9.1"
|
||||
const val leakcanaryVersion = "2.9.1"
|
||||
|
||||
// https://github.com/ChuckerTeam/chucker/releases
|
||||
chucker_version = "3.5.2"
|
||||
const val chuckerVersion = "3.5.2"
|
||||
|
||||
// https://developer.android.com/studio/write/java8-support#library-desugaring
|
||||
desugar_version = "1.1.5"
|
||||
}
|
||||
const val desugarVersion = "1.1.5"
|
||||
|
||||
// https://github.com/google/ksp/releases
|
||||
const val kspPluginVersion = "1.7.10-1.0.6"
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
@@ -6,4 +8,4 @@ dependencyResolutionManagement {
|
||||
}
|
||||
}
|
||||
rootProject.name = "Mealient"
|
||||
include ':app'
|
||||
include(":app")
|
||||
Reference in New Issue
Block a user