-
Notifications
You must be signed in to change notification settings - Fork 287
/
Copy pathbuild.gradle.kts
147 lines (123 loc) · 4.48 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
137
138
139
140
141
142
143
144
145
146
147
import io.getstream.chat.android.Configuration
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.ksp)
alias(libs.plugins.android.junit5)
alias(libs.plugins.androidx.baseline.profile)
}
rootProject.extra.apply {
set("PUBLISH_GROUP_ID", Configuration.artifactGroup)
set("PUBLISH_ARTIFACT_ID", "stream-chat-android-offline")
set("PUBLISH_VERSION", rootProject.extra.get("rootVersionName"))
}
apply(from = "$rootDir/scripts/publish-module.gradle")
apply(from = "$rootDir/scripts/android.gradle")
android {
namespace = "io.getstream.chat.android.offline"
defaultConfig {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
testOptions {
unitTests {
isIncludeAndroidResources = true
unitTests.isReturnDefaultValues = true
all {
it.testLogging {
events = setOf(
TestLogEvent.FAILED,
TestLogEvent.STANDARD_OUT,
TestLogEvent.STANDARD_ERROR,
)
showExceptions = true
showCauses = true
showStackTraces = true
exceptionFormat = TestExceptionFormat.FULL
}
}
}
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
}
}
}
baselineProfile {
baselineProfileOutputDir = "."
filter {
include("io.getstream.chat.android.offline.**")
}
}
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
freeCompilerArgs.addAll(
listOf(
"-progressive",
"-Xexplicit-api=strict",
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=io.getstream.chat.android.core.internal.InternalStreamChatApi",
),
)
jvmTarget.set(JvmTarget.JVM_11)
}
}
dependencies {
api(project(":stream-chat-android-client"))
implementation(libs.stream.log)
// Kotlin
implementation(libs.kotlin.reflect)
implementation(libs.kotlinx.coroutines.core)
// Google libs
implementation(libs.androidx.appcompat)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.livedata.ktx)
implementation(libs.androidx.room.runtime)
implementation(libs.androidx.room.ktx)
ksp(libs.androidx.room.compiler)
implementation(libs.androidx.work)
// Serialization
implementation(libs.moshi)
implementation(libs.moshi.kotlin)
implementation(libs.moshi.adapters)
ksp(libs.moshi.codegen)
// Tests
testImplementation(project(":stream-chat-android-test"))
testImplementation(project(":stream-chat-android-client-test"))
testImplementation(testFixtures(project(":stream-chat-android-core")))
testImplementation(libs.stream.result)
testImplementation(libs.moshi.kotlin)
testImplementation(libs.junit.jupiter.api)
testImplementation(libs.junit.jupiter.params)
testRuntimeOnly(libs.junit.jupiter.engine)
testRuntimeOnly(libs.junit.vintage.engine)
testImplementation(libs.androidx.test.core)
testImplementation(libs.androidx.test.junit)
testImplementation(libs.androidx.core.testing)
testImplementation(libs.androidx.recyclerview) // for performance test
testImplementation(libs.androidx.room.testing)
testImplementation(libs.androidx.work.testing)
testImplementation(libs.kotlinx.coroutines.test)
testImplementation(libs.robolectric)
testImplementation(libs.kluent)
testImplementation(libs.mockito)
testImplementation(libs.mockito.kotlin)
testImplementation(libs.turbine)
// Instrumentation tests
androidTestImplementation(libs.androidx.test.junit)
androidTestImplementation(libs.androidx.test.espresso.core)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.kluent)
androidTestImplementation(libs.mockito)
androidTestImplementation(libs.mockito.kotlin)
detektPlugins(libs.detekt.formatting)
baselineProfile(project(":stream-chat-android-benchmark"))
}