Build.gradle.kts

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

Raw Paste

Forks 1
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.