-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle.kts
174 lines (151 loc) · 4.59 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.kotlin.ksp)
alias(libs.plugins.emerge)
alias(libs.plugins.sentry)
alias(libs.plugins.roborazzi)
}
val runningEnv: String? = System.getenv("RUNNING_ENV")
android {
namespace = "com.emergetools.hackernews"
compileSdk = 34
defaultConfig {
applicationId = "com.emergetools.hackernews"
minSdk = 30
targetSdk = 34
versionCode = 13
versionName = "1.0.2"
manifestPlaceholders["emerge.distribution.apiKey"] = ""
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}
signingConfigs {
if (runningEnv == "release_workflow") {
create("release") {
storeFile = file(System.getenv("DECODED_KEYSTORE_PATH"))
keyAlias = System.getenv("RELEASE_KEY_ALIAS")
keyPassword = System.getenv("RELEASE_KEY_PASSWORD")
storePassword = System.getenv("RELEASE_STORE_PASSWORD")
}
}
}
buildTypes {
debug {
isDebuggable = true
applicationIdSuffix = ".debug"
}
create("fast") {
isDebuggable = false
applicationIdSuffix = ".fast"
signingConfig = signingConfigs.getByName("debug")
}
release {
isDebuggable = false
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
if (runningEnv == "release_workflow") {
manifestPlaceholders["emerge.distribution.apiKey"] = ""
signingConfig = signingConfigs.getByName("release")
} else {
manifestPlaceholders["emerge.distribution.apiKey"] = System.getenv("ANDROID_DISTRIBUTION_API_KEY") ?: ""
signingConfig = signingConfigs.getByName("debug")
}
}
}
buildFeatures {
compose = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
testOptions {
unitTests {
isIncludeAndroidResources = true
}
}
}
composeCompiler {
enableStrongSkippingMode = true
}
emerge {
snapshots {
tag.set("snapshot")
}
reaper {
// Only enable reaper on release workflow
if (runningEnv == "release_workflow") {
enabledVariants.set(listOf("release"))
}
publishableApiKey.set(System.getenv("REAPER_API_KEY"))
}
vcs {
gitHub {
repoName.set("hackernews")
repoOwner.set("EmergeTools")
}
}
}
sentry {
org.set("emerge-tools")
projectName.set("hackernews-android")
ignoredVariants.set(listOf("debug", "fast"))
// Don't upload source code to Sentry
includeSourceContext.set(false)
}
dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.viewmodel)
implementation(libs.androidx.navigation)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.ui)
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.material3)
implementation(libs.androidx.shapes)
implementation(libs.androidx.browser)
implementation(libs.androidx.datastore)
implementation(libs.extendedspans)
implementation(libs.emerge.snapshots.annotations)
implementation(libs.okhttp)
implementation(libs.retrofit)
implementation(libs.retrofit.kotlinx.serialization)
implementation(libs.kotlinx.serialization.json)
implementation(libs.jsoup)
implementation(libs.androidx.room)
implementation(libs.androidx.room.ktx)
implementation(libs.androidx.ui.test.junit4.android)
ksp(libs.androidx.room.compiler)
testImplementation(libs.junit)
testImplementation(libs.robolectric)
testImplementation(libs.roborazzi)
testImplementation(libs.roborazzi.compose)
testImplementation(libs.roborazzi.rule)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.ui.test.junit4)
androidTestImplementation(libs.emerge.snapshots)
debugImplementation(libs.androidx.ui.tooling)
debugImplementation(libs.androidx.ui.test.manifest)
implementation(libs.emerge.reaper)
implementation(libs.emerge.distribution)
}