build.gradle (4521B)
1 import groovy.json.JsonOutput 2 3 plugins { 4 id 'com.android.application' 5 id 'kotlin-android' 6 id 'kotlinx-serialization' 7 id 'org.jlleitschuh.gradle.ktlint' version '14.2.0' 8 id "org.jetbrains.kotlin.plugin.compose" version "$kotlin_version" 9 } 10 11 ktlint { 12 version = '1.8.0' 13 filter { 14 exclude '**/build/**' 15 } 16 } 17 18 apply from: 'formatting.gradle' 19 20 tasks.withType(org.jlleitschuh.gradle.ktlint.tasks.KtLintFormatTask).configureEach { 21 dependsOn 'formatKotlinLayout' 22 } 23 24 repositories { 25 maven { 26 url 'https://maven.sumup.com/releases' 27 content { 28 includeGroupByRegex 'com\\.sumup(\\..*)?' 29 includeGroup 'net.sf.smc' 30 } 31 } 32 } 33 34 def localAffiliateKey = providers.fileContents(rootProject.layout.projectDirectory.file('.env')) 35 .asText.orElse('').map { content -> 36 def entry = content.readLines().find { it ==~ /\s*(?:export\s+)?SUMUP_AFFILIATE_KEY\s*=.*/ } 37 if (entry == null) return '' 38 def match = entry =~ /\s*(?:export\s+)?SUMUP_AFFILIATE_KEY\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s#]*))\s*(?:#.*)?/ 39 if (!match.matches()) throw new GradleException('Invalid SUMUP_AFFILIATE_KEY entry in .env') 40 return match[0][1] ?: match[0][2] ?: match[0][3] ?: '' 41 } 42 def sumupAffiliateKey = providers.environmentVariable('SUMUP_AFFILIATE_KEY') 43 .orElse(localAffiliateKey).get() 44 45 android { 46 namespace 'net.taler.merchantpos' 47 compileSdkVersion 37 48 49 defaultConfig { 50 applicationId "net.taler.merchantpos" 51 minSdkVersion 26 52 targetSdkVersion 37 53 versionCode 30 54 versionName "1.7.0" 55 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 56 57 buildConfigField("String", "BACKEND_API_VERSION", "\"20:0:8\"") 58 buildConfigField('String', 'SUMUP_AFFILIATE_KEY', JsonOutput.toJson(sumupAffiliateKey)) 59 } 60 61 buildTypes { 62 release { 63 minifyEnabled true 64 proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 65 } 66 debug { 67 minifyEnabled minify_debug 68 proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 69 } 70 } 71 72 compileOptions { 73 coreLibraryDesugaringEnabled true 74 sourceCompatibility = JavaVersion.VERSION_17 75 targetCompatibility = JavaVersion.VERSION_17 76 } 77 78 kotlinOptions { 79 jvmTarget = "17" 80 } 81 82 buildFeatures { 83 buildConfig = true 84 compose = true 85 } 86 87 testOptions { 88 unitTests { 89 includeAndroidResources = true 90 } 91 } 92 packagingOptions { 93 resources { 94 excludes += ['META-INF/common.kotlin_module', 'META-INF/*.kotlin_module'] 95 } 96 } 97 98 lint { 99 abortOnError true 100 disable 'WrongConstant' 101 ignoreWarnings false 102 } 103 } 104 105 dependencies { 106 coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5' 107 implementation 'com.sumup:merchant-sdk:7.1.0' 108 implementation project(":merchant-lib") 109 implementation project(":taler-kotlin-android") 110 111 implementation "com.google.android.material:material:$material_version" 112 implementation "androidx.constraintlayout:constraintlayout:$constraintlayout_version" 113 implementation platform('androidx.compose:compose-bom:2026.06.01') 114 implementation 'androidx.compose.material3:material3' 115 implementation 'androidx.compose.material:material-icons-extended' 116 implementation 'androidx.compose.ui:ui' 117 implementation 'androidx.compose.ui:ui-tooling-preview' 118 implementation "androidx.compose.runtime:runtime-livedata" 119 implementation 'androidx.activity:activity-compose:1.13.0' 120 implementation "androidx.navigation:navigation-compose:$nav_version" 121 implementation "androidx.fragment:fragment-ktx:1.9.0" 122 implementation "androidx.recyclerview:recyclerview:1.4.0" 123 implementation "androidx.recyclerview:recyclerview-selection:1.2.0" 124 125 // CameraX 126 implementation "androidx.camera:camera-camera2:1.6.2" 127 implementation "androidx.camera:camera-lifecycle:1.6.2" 128 implementation "androidx.camera:camera-view:1.6.2" 129 130 // ZXING core – on-device barcode/QR detector 131 implementation "com.google.zxing:core:3.5.4" 132 133 implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.2.0" 134 135 testImplementation 'androidx.test.ext:junit:1.3.0' 136 testImplementation 'org.robolectric:robolectric:4.16.1' 137 138 debugImplementation 'androidx.compose.ui:ui-tooling' 139 }