-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathbuild.gradle.kts
136 lines (112 loc) · 4.03 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
plugins {
id("com.android.application")
id("kotlin-android")
id("kotlin-kapt")
id("kotlinx-serialization")
id("dagger.hilt.android.plugin")
}
repositories {
google()
mavenCentral()
}
android {
compileSdkVersion(29)
defaultConfig {
applicationId = "moxy.sample"
minSdkVersion(23)
targetSdkVersion(29)
versionCode = 1
versionName = "1.0"
javaCompileOptions {
annotationProcessorOptions {
arguments.putAll(mapOf(
"disableEmptyStrategyCheck" to "false",
"enableEmptyStrategyHelper" to "true",
"defaultMoxyStrategy" to "moxy.viewstate.strategy.AddToEndSingleStrategy",
"moxyEnableIsolatingProcessing" to "true"
))
}
}
}
signingConfigs {
create("release") {
keyAlias = "Moxy"
keyPassword = "MoxyRelease"
storePassword = "MoxyRelease"
storeFile = file("DemoReleaseKeystore")
}
}
buildTypes {
getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
signingConfig = signingConfigs.getByName("release")
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.txt")
}
}
buildFeatures {
viewBinding = true
}
// we've placed source code in "kotlin folder" but you don't have to do that.
sourceSets {
getByName("main") {
java.setSrcDirs(java.srcDirs + file("src/main/kotlin"))
}
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
packagingOptions {
exclude("META-INF/*.kotlin_module")
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs = listOf("-Xjvm-default=all")
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
kapt {
correctErrorTypes = true
}
dependencies {
// Kotlin
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.0.0-RC")
// AndroidX
implementation("androidx.appcompat:appcompat:1.2.0")
// AndroidX KTX
implementation("androidx.core:core-ktx:1.3.1")
implementation("androidx.fragment:fragment-ktx:1.2.5")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.2.0")
implementation("androidx.lifecycle:lifecycle-common-java8:2.2.0")
implementation("androidx.constraintlayout:constraintlayout:2.0.1")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
// Material Design
implementation("com.google.android.material:material:1.2.1")
// HTTP client
implementation("io.ktor:ktor-client-android:1.4.0")
implementation("io.ktor:ktor-client-json-jvm:1.4.0")
implementation("io.ktor:ktor-client-serialization-jvm:1.4.0")
// Image loader
implementation("io.coil-kt:coil:1.0.0-rc2")
implementation("com.google.dagger:hilt-android:2.35.1")
kapt("com.google.dagger:hilt-android-compiler:2.35.1")
// java.time and other stuff without third-party libraries
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")
// Moxy
// uncomment to test library from local sources
implementation(project(":moxy-androidx"))
implementation(project(":moxy-ktx"))
kapt(project(":moxy-compiler"))
// uncomment to test library from maven
// val moxyVersion = "2.2.3"
// implementation("com.github.moxy-community:moxy-androidx:$moxyVersion")
// implementation("com.github.moxy-community:moxy-ktx:$moxyVersion")
// kapt("com.github.moxy-community:moxy-compiler:$moxyVersion")
testImplementation("junit:junit:4.13")
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.3.9")
}