Build.gradle.kts

Java boxlabs 2 Views Size: 3.24 KB Posted on: Mar 1, 26 @ 4:02 AM
  1. import org.jetbrains.kotlin.gradle.dsl.JvmTarget
  2.  
  3. plugins {
  4.     alias(libs.plugins.android.application)
  5. }
  6.  
  7. android {
  8.         dependenciesInfo {
  9.                 includeInApk = false
  10.                 includeInBundle = false
  11.         }
  12.  
  13.     namespace = "com.boxlabs.hexdroid"
  14.     compileSdk = 36
  15.  
  16.     defaultConfig {
  17.         applicationId = "com.boxlabs.hexdroid"
  18.         minSdk = 26
  19.         targetSdk = 36
  20.         versionCode = 10
  21.         versionName = "1.5.5"
  22.         testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
  23.     }
  24.  
  25.     signingConfigs {
  26.         create("release") {
  27.             val ksFile = System.getenv("KEYSTORE_FILE")
  28.             if (ksFile != null && file(ksFile).exists()) {
  29.                 storeFile = file(ksFile)
  30.                 storePassword = System.getenv("KEYSTORE_PASSWORD")
  31.                 keyAlias = System.getenv("KEY_ALIAS")
  32.                 keyPassword = System.getenv("KEY_PASSWORD")
  33.             }
  34.         }
  35.     }
  36.  
  37.         buildTypes {
  38.                 getByName("release") {
  39.                         isMinifyEnabled = true
  40.                         isShrinkResources = true
  41.                         proguardFiles(
  42.                                 getDefaultProguardFile("proguard-android-optimize.txt"),
  43.                                 "proguard-rules.pro"
  44.                         )
  45.             val ksFile = System.getenv("KEYSTORE_FILE")
  46.             signingConfig = if (ksFile != null && file(ksFile).exists()) {
  47.                 signingConfigs.getByName("release")
  48.             } else {
  49.                 signingConfigs.getByName("debug")
  50.             }
  51.         }
  52.     }
  53.  
  54.     compileOptions {
  55.         sourceCompatibility = JavaVersion.VERSION_11
  56.         targetCompatibility = JavaVersion.VERSION_11
  57.     }
  58.  
  59.     buildFeatures {
  60.                 buildConfig = true
  61.         compose = true
  62.     }
  63.  
  64.     // Reproducible builds: disable non-deterministic PNG crunching
  65.     androidResources {
  66.         noCompress += "png"
  67.     }
  68.  
  69.     packaging {
  70.         resources {
  71.             // Exclude non-deterministic VCS info (AGP 8.3+)
  72.             excludes += "META-INF/version-control-info.textproto"
  73.         }
  74.     }
  75.  
  76. }
  77.  
  78. // AGP 9.0+ built in kotlin conf
  79. kotlin {
  80.     compilerOptions {
  81.         jvmTarget.set(JvmTarget.JVM_11)
  82.     }
  83. }
  84.  
  85. dependencies {
  86.     implementation(libs.androidx.core.ktx)
  87.     implementation(libs.androidx.lifecycle.runtime.ktx)
  88.     implementation(libs.androidx.lifecycle.runtime.compose)
  89.     implementation(libs.androidx.lifecycle.viewmodel.compose)
  90.     implementation(libs.androidx.activity.compose)
  91.     implementation(platform(libs.androidx.compose.bom))
  92.     implementation(libs.androidx.compose.ui)
  93.     implementation(libs.androidx.compose.ui.graphics)
  94.     implementation(libs.androidx.compose.ui.tooling.preview)
  95.     implementation(libs.androidx.compose.material3)
  96.     implementation(libs.androidx.compose.foundation)
  97.     implementation(libs.androidx.compose.material.icons.extended)
  98.     implementation(libs.kotlinx.coroutines.android)
  99.     implementation(libs.androidx.datastore.preferences)
  100.     testImplementation(libs.junit)
  101.     androidTestImplementation(libs.androidx.junit)
  102.     androidTestImplementation(libs.androidx.espresso.core)
  103.     androidTestImplementation(platform(libs.androidx.compose.bom))
  104.     androidTestImplementation(libs.androidx.compose.ui.test.junit4)
  105.     debugImplementation(libs.androidx.compose.ui.tooling)
  106.     debugImplementation(libs.androidx.compose.ui.test.manifest)
  107. }

Raw Paste

Comments 0
Login to post a comment.
  • No comments yet. Be the first.
Login to post a comment. Login or Register
We use cookies. To comply with GDPR in the EU and the UK we have to show you these.

We use cookies and similar technologies to keep this website functional (including spam protection via Google reCAPTCHA or Cloudflare Turnstile), and — with your consent — to measure usage and show ads. See Privacy.