build.gradle (3983B)
1 plugins { 2 id 'com.android.application' 3 } 4 5 static def versionCodeEpoch() { 6 return (new Date().getTime() / 1000).toInteger() 7 } 8 9 def gitCommit = { -> 10 def stdout = new ByteArrayOutputStream() 11 exec { 12 commandLine 'git', 'rev-parse', '--short=7', 'HEAD' 13 standardOutput = stdout 14 } 15 return stdout.toString().trim() 16 } 17 18 android { 19 namespace 'net.taler.donauverificator' 20 compileSdkVersion 36 21 22 defaultConfig { 23 applicationId "net.taler.donauverificator" 24 minSdk 30 25 targetSdk 36 26 versionCode 2 27 versionName "1.1.0" 28 29 buildConfigField "boolean", "ENABLE_DEVELOPER_MODE", "true" 30 buildConfigField "boolean", "ALLOW_INSECURE_HTTP", "true" 31 manifestPlaceholders = [usesCleartextTraffic: "true"] 32 33 archivesBaseName = "donau-verificator" 34 externalNativeBuild { 35 cmake { 36 cppFlags '' 37 } 38 } 39 } 40 41 buildTypes { 42 release { 43 minifyEnabled false 44 proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 45 } 46 debug { 47 // inherit defaults; specific behavior controlled via product flavors 48 } 49 } 50 51 flavorDimensions = ["distributionChannel"] 52 productFlavors { 53 fdroid { 54 dimension "distributionChannel" 55 applicationIdSuffix ".fdroid" 56 } 57 58 nightly { 59 dimension "distributionChannel" 60 applicationIdSuffix ".nightly" 61 versionCode versionCodeEpoch() 62 versionNameSuffix " ($gitCommit)" 63 } 64 } 65 66 compileOptions { 67 sourceCompatibility JavaVersion.VERSION_17 68 targetCompatibility JavaVersion.VERSION_17 69 } 70 71 buildFeatures { 72 viewBinding true 73 prefab true 74 buildConfig true 75 } 76 77 packagingOptions { 78 // Exclude specific files or directories that might cause conflicts 79 exclude 'META-INF/DEPENDENCIES' 80 exclude 'META-INF/LICENSE' 81 exclude 'META-INF/LICENSE.txt' 82 exclude 'META-INF/NOTICE' 83 exclude 'META-INF/NOTICE.txt' 84 exclude 'META-INF/ASL2.0' 85 exclude 'META-INF/*.kotlin_module' 86 87 // Merge specific files if needed 88 merge 'META-INF/LGPL2.1' 89 merge 'META-INF/AL2.0' 90 91 // Exclude everything under META-INF to avoid conflicts 92 resources.excludes.add("META-INF/**/*") 93 } 94 95 externalNativeBuild { 96 cmake { 97 path file('src/main/cpp/CMakeLists.txt') 98 version '3.22.1' 99 } 100 } 101 102 splits { 103 abi { 104 // can not be defined per flavor, so we use a property to turn this on for F-Droid 105 enable project.hasProperty('splitApk') 106 reset() // Resets the list of ABIs to remove all included by default 107 include "armeabi-v7a", "arm64-v8a", "x86", "x86_64" 108 universalApk false 109 } 110 } 111 112 lint { 113 abortOnError true 114 ignoreWarnings false 115 } 116 } 117 118 dependencies { 119 // TODO: do not vendor pre-built libsodium 120 implementation fileTree(dir: 'src/main/libs/', include: ['libsodium-1.0.19.0.aar']) 121 implementation 'androidx.appcompat:appcompat:1.7.1' 122 implementation 'com.google.android.material:material:1.13.0' 123 implementation 'androidx.constraintlayout:constraintlayout:2.2.1' 124 implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.9.4' 125 implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.4' 126 implementation 'androidx.navigation:navigation-fragment:2.9.5' 127 implementation 'androidx.navigation:navigation-ui:2.9.5' 128 implementation 'com.github.yuriy-budiyev:code-scanner:2.3.2' 129 // https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk18on 130 implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.70' 131 implementation 'androidx.preference:preference-ktx:1.2.1' 132 implementation 'androidx.preference:preference:1.2.1' 133 }