Skip to content

Commit 5c505ba

Browse files
committed
Refactor build script
1 parent 1176e27 commit 5c505ba

1 file changed

Lines changed: 19 additions & 25 deletions

File tree

app/build.gradle.kts

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,6 @@ android {
2121
versionName = "0.9.2"
2222
}
2323

24-
packaging {
25-
resources {
26-
excludes += "/META-INF/{AL2.0,LGPL2.1}"
27-
excludes += "DebugProbesKt.bin"
28-
}
29-
}
30-
31-
splits {
32-
abi {
33-
isEnable = true
34-
reset()
35-
include("arm64-v8a", "x86_64")
36-
isUniversalApk = true
37-
}
38-
}
39-
4024
buildTypes {
4125
debug {
4226
applicationIdSuffix = ".debug"
@@ -46,14 +30,17 @@ android {
4630
release {
4731
manifestPlaceholders["appIcon"] = "@drawable/launcher"
4832

49-
// Enables code shrinking, obfuscation, and optimization
33+
// https://developer.android.com/topic/performance/app-optimization/enable-app-optimization
34+
35+
// Enables code-related app optimization.
5036
isMinifyEnabled = true
5137

52-
// Enables resource shrinking
38+
// Enables resource shrinking.
5339
isShrinkResources = true
5440

5541
// Includes the default ProGuard rules file
5642
proguardFiles(
43+
// Default file with automatically generated optimization rules.
5744
getDefaultProguardFile("proguard-android-optimize.txt"),
5845
)
5946

@@ -65,8 +52,13 @@ android {
6552
viewBinding = true
6653
}
6754

68-
dependenciesInfo {
69-
includeInApk = false
55+
splits {
56+
abi {
57+
isEnable = true
58+
reset()
59+
include("arm64-v8a", "x86_64")
60+
isUniversalApk = true
61+
}
7062
}
7163

7264
dependencies {
@@ -92,10 +84,12 @@ android {
9284

9385
tasks.register("bundleData") {
9486
doLast {
95-
val destDir = File(projectDir, "src/main/assets")
96-
destDir.mkdirs()
97-
val placesSrc =
98-
URI("https://api.btcmap.org/v4/places?fields=id,lat,lon,icon,name,comments,boosted_until")
99-
File(destDir, "bundled-places.json").writeText(placesSrc.toURL().readText())
87+
File(
88+
File(projectDir, "src/main/assets"),
89+
"bundled-places.json"
90+
).writeText(
91+
URI("https://api.btcmap.org/v4/places?fields=id,lat,lon,icon,name,comments,boosted_until").toURL()
92+
.readText()
93+
)
10094
}
10195
}

0 commit comments

Comments
 (0)