app/build.gradle.kts (2525 bytes)
1 plugins { 2 alias(libs.plugins.android.application) 3 } 4 5 // Release signing comes from the environment, so the key never lives in the repository. 6 val keystorePath = providers.environmentVariable("SUBREAD_KEYSTORE_FILE").orNull 7 val keystorePassword = providers.environmentVariable("SUBREAD_KEYSTORE_PASSWORD").orNull 8 val signingReady = !keystorePath.isNullOrBlank() && !keystorePassword.isNullOrBlank() && 9 file(keystorePath).isFile 10 11 android { 12 namespace = "space.subread.dictionary" 13 compileSdk = 36 14 15 // No list of dependencies, encrypted for Google alone, inside the app: F-Droid 16 // does not accept a part of the app that nobody else can read. 17 dependenciesInfo { 18 includeInApk = false 19 includeInBundle = false 20 } 21 22 defaultConfig { 23 applicationId = "space.subread.dictionary" 24 minSdk = 26 25 targetSdk = 36 26 // Plain numbers, in this file: F-Droid reads them from here to find a new release. 27 versionCode = 2 28 versionName = "0.2.0" 29 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 30 31 // A link to the Ko-fi page. Google Play is not given it (-PplayStore=true). 32 buildConfigField("boolean", "DONATE_LINK", (providers.gradleProperty("playStore").orNull != "true").toString()) 33 } 34 35 if (signingReady) { 36 signingConfigs { 37 create("release") { 38 storeFile = file(keystorePath!!) 39 storePassword = keystorePassword 40 keyAlias = "subread" 41 keyPassword = keystorePassword 42 } 43 } 44 } 45 46 buildTypes { 47 debug { applicationIdSuffix = ".debug" } 48 release { 49 // R8 removes unused code and resources. F-Droid asks for it. 50 isMinifyEnabled = true 51 isShrinkResources = true 52 proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt")) 53 if (signingReady) signingConfig = signingConfigs.getByName("release") 54 } 55 } 56 57 compileOptions { 58 sourceCompatibility = JavaVersion.VERSION_17 59 targetCompatibility = JavaVersion.VERSION_17 60 } 61 buildFeatures { buildConfig = true } 62 } 63 64 dependencies { 65 implementation(project(":core")) 66 implementation(libs.androidx.core.ktx) 67 implementation(libs.gson) 68 69 androidTestImplementation(libs.junit) 70 androidTestImplementation(libs.androidx.test.runner) 71 androidTestImplementation(libs.androidx.test.junit) 72 androidTestImplementation(libs.androidx.test.core) 73 }