Replace BASE_URL on build
All checks were successful
Build / build (push) Successful in 8m14s

This commit is contained in:
Tim Kluge 2025-05-28 17:14:51 +02:00
parent 76def03651
commit da448b7407
2 changed files with 9 additions and 2 deletions

View File

@ -82,6 +82,12 @@ tasks.register("generateManifest") {
val gson = groovy.json.JsonBuilder(manifest).toPrettyString()
manifestFile.writeText(gson)
println("Generated manifest.json with version ${android.defaultConfig.versionName} (${android.defaultConfig.versionCode})")
val androidManifestFile = file("$projectDir/src/main/AndroidManifest.xml")
var androidManifestContent = androidManifestFile.readText()
androidManifestContent = androidManifestContent.replace("\$BASE_URL\$", baseUrl)
androidManifestFile.writeText(androidManifestContent)
println("Replaced \$BASE_URL$ in AndroidManifest.xml")
}
}
@ -104,4 +110,5 @@ dependencies {
implementation(libs.androidx.cardview)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.mapbox.sdk.turf)
}
}

View File

@ -42,7 +42,7 @@
<!-- Provide Karoo System with information about delivery of your app -->
<meta-data
android:name="io.hammerhead.karooext.MANIFEST_URL"
android:value="https://github.com/timklge/karoo-powerbar/releases/latest/download/manifest.json" />
android:value="$BASE_URL$/manifest.json" />
</application>