taler-android

Android apps for GNU Taler (wallet, PoS, cashier)
Log | Files | Refs | README | LICENSE

build.gradle (3885B)


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