-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathbuild.gradle.kts
217 lines (185 loc) · 6.26 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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
import java.util.Properties
import java.io.FileInputStream
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.dagger.hilt)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.jetbrains.serialization)
alias(libs.plugins.kotlinter)
alias(libs.plugins.ksp)
}
val keystorePropertiesFile = rootProject.file("app/keystores/keystore.properties")
val keystoreProperties: Properties? = if (keystorePropertiesFile.exists()) {
Properties().apply {
load(FileInputStream(keystorePropertiesFile))
}
} else null
android {
namespace = "com.OxGames.Pluvia"
compileSdk = 35
// https://developer.android.com/ndk/downloads
ndkVersion = "22.1.7171670"
signingConfigs {
create("pluvia") {
if (keystoreProperties != null) {
storeFile = file(keystoreProperties["storeFile"].toString())
storePassword = keystoreProperties["storePassword"].toString()
keyAlias = keystoreProperties["keyAlias"].toString()
keyPassword = keystoreProperties["keyPassword"].toString()
}
}
}
defaultConfig {
applicationId = "com.OxGames.Pluvia"
minSdk = 29
targetSdk = 34
versionCode = 6
versionName = "1.3.2"
buildConfigField("boolean", "GOLD", "false")
val iconValue = "@mipmap/ic_launcher"
val iconRoundValue = "@mipmap/ic_launcher_round"
manifestPlaceholders.putAll(
mapOf(
"icon" to iconValue,
"roundIcon" to iconRoundValue,
),
)
ndk {
abiFilters.addAll(listOf("arm64-v8a", "armeabi-v7a"))
}
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
proguardFiles(
// getDefaultProguardFile("proguard-android-optimize.txt"),
getDefaultProguardFile("proguard-android.txt"),
"proguard-rules.pro",
)
}
buildTypes {
debug {
isMinifyEnabled = false
}
release {
isMinifyEnabled = true
isShrinkResources = true
signingConfig = signingConfigs.getByName("debug")
}
create("release-signed") {
isMinifyEnabled = true
isShrinkResources = true
signingConfig = signingConfigs.getByName("pluvia")
}
create("release-gold") {
isMinifyEnabled = true
isShrinkResources = true
signingConfig = signingConfigs.getByName("pluvia")
applicationIdSuffix = ".gold"
buildConfigField("boolean", "GOLD", "true")
val iconValue = "@mipmap/ic_launcher_gold"
val iconRoundValue = "@mipmap/ic_launcher_gold_round"
manifestPlaceholders.putAll(
mapOf(
"icon" to iconValue,
"roundIcon" to iconRoundValue,
),
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "11"
}
buildFeatures {
compose = true
buildConfig = true
}
ksp {
arg("room.schemaLocation", "$projectDir/schemas")
arg("room.incremental", "true")
}
packaging {
resources {
excludes += "/DebugProbesKt.bin"
excludes += "/junit/runner/smalllogo.gif"
excludes += "/junit/runner/logo.gif"
}
jniLibs {
// 'extractNativeLibs' was not enough to keep the jniLibs and
// the libs went missing after adding on-demand feature delivery
useLegacyPackaging = true
}
}
dynamicFeatures += setOf(":ubuntufs")
kotlinter {
ignoreFormatFailures = false
}
// cmake on release builds a proot that fails to process ld-2.31.so
// externalNativeBuild {
// cmake {
// path = file("src/main/cpp/CMakeLists.txt")
// version = "3.22.1"
// }
// }
// (For now) Uncomment for LeakCanary to work.
// configurations {
// debugImplementation {
// exclude(group = "junit", module = "junit")
// }
// }
}
dependencies {
// JavaSteam
val localBuild = false // Change to 'true' needed when building JavaSteam manually
if (localBuild) {
implementation(files("../../../IntelliJ/JavaSteam/build/libs/javasteam-1.6.0-SNAPSHOT.jar"))
implementation(libs.bundles.steamkit.dev)
} else {
implementation(libs.steamkit) {
isChanging = version?.contains("SNAPSHOT") ?: false
}
}
implementation(libs.spongycastle)
// Split Modules
implementation(libs.bundles.google)
// Winlator
implementation(libs.bundles.winlator)
implementation(libs.zstd.jni) { artifact { type = "aar" } }
// Jetpack Compose
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.compose)
implementation(libs.landscapist.coil)
debugImplementation(libs.androidx.ui.tooling)
// Support
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.apng)
implementation(libs.datastore.preferences)
implementation(libs.jetbrains.kotlinx.json)
implementation(libs.kotlin.coroutines)
implementation(libs.timber)
implementation(libs.zxing)
// Google Protobufs
implementation(libs.protobuf.java)
// Hilt
implementation(libs.bundles.hilt)
// KSP (Hilt, Room)
ksp(libs.bundles.ksp)
// Room Database
implementation(libs.bundles.room)
// Memory Leak Detection
// debugImplementation("com.squareup.leakcanary:leakcanary-android:3.0-alpha-8")
// Testing
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.runner)
androidTestImplementation(libs.androidx.ui.test.junit4)
debugImplementation(libs.androidx.ui.test.manifest)
testImplementation(libs.junit)
}