ganjoorandroid/app/build.gradle.kts
anas 38996943b5 Release 0.4.1
One fix, reported from a Xiaomi on Android 16: the font weight control did
nothing. Both bundled faces carry a single variable axis, wght, and the app was
asking for two — a font with no italic axis may refuse the whole request rather
than the part it cannot honour, and on a platform that does, every weight drew
at Regular with no error to show for it. The same declaration had quietly broken
the heavier weights on Android 7.0 and 7.1 as well.

A patch release, not a minor one: nothing else changed.

README.md and releases/README.md were written by tools/update_release_docs.py
rather than by hand, which is what it is for — and ReleaseDocsTest now has
something real to check, since the version, the archived APK and the checksum
all moved together.

The 0.4.0 row also gets its real commit in place of HEAD.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-08 00:34:07 +02:00

110 lines
4.0 KiB
Plaintext

import org.gradle.api.tasks.PathSensitivity
import java.util.Properties
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.kotlin.serialization)
}
// Release signing is optional: F-Droid builds from source and signs with its own key, so the
// build has to succeed with no keystore present. Drop a keystore.properties next to settings.gradle
// (storeFile, storePassword, keyAlias, keyPassword) to sign locally; it is gitignored.
val keystoreProperties = Properties().apply {
val file = rootProject.file("keystore.properties")
if (file.exists()) file.inputStream().use { load(it) }
}
// A delivered file should say what it is without being opened.
base {
archivesName = "ganjoor-0.4.1"
}
android {
namespace = "com.ganjoor.android"
compileSdk {
version = release(37)
}
defaultConfig {
applicationId = "com.ganjoor.android"
minSdk = 24
targetSdk = 37
// Pre-1.0 while the app is still being shaped. versionCode only ever climbs: F-Droid
// refuses an update that does not, and one changelog file per code lives in
// fastlane/metadata/android/*/changelogs/.
versionCode = 7
versionName = "0.4.1"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
if (keystoreProperties.isNotEmpty()) {
create("release") {
storeFile = rootProject.file(keystoreProperties.getProperty("storeFile"))
storePassword = keystoreProperties.getProperty("storePassword")
keyAlias = keystoreProperties.getProperty("keyAlias")
keyPassword = keystoreProperties.getProperty("keyPassword")
}
}
}
buildTypes {
release {
signingConfig = signingConfigs.findByName("release")
optimization {
enable = true
packageScope = setOf("androidx.**", "kotlin.**", "kotlinx.**")
}
}
}
// The dependency metadata block is signed with a Google key and is not reproducible, so
// F-Droid rejects APKs that carry it.
dependenciesInfo {
includeInApk = false
includeInBundle = false
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
buildFeatures {
compose = true
}
}
// ReleaseDocsTest reads these, so a change to either has to re-run the tests. Without this
// Gradle sees only Kotlin sources, calls the task up to date, and a README that has fallen
// behind the build sails through green.
tasks.withType<Test>().configureEach {
inputs.file(rootProject.file("README.md")).withPathSensitivity(PathSensitivity.RELATIVE)
inputs.file(rootProject.file("releases/README.md")).withPathSensitivity(PathSensitivity.RELATIVE)
}
dependencies {
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material.icons.core)
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.navigation.compose)
implementation(libs.okhttp)
implementation(libs.kotlinx.serialization.json)
implementation(libs.coil.compose)
implementation(libs.coil.network.okhttp)
testImplementation(libs.junit)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.androidx.junit)
debugImplementation(libs.androidx.compose.ui.test.manifest)
debugImplementation(libs.androidx.compose.ui.tooling)
}