taler-android

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

build.gradle (3841B)


      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         resources {
     77             // Merge specific files if needed
     78             merges += ['META-INF/LGPL2.1', 'META-INF/AL2.0']
     79             // Exclude specific files or directories that might cause conflicts
     80             excludes += ['META-INF/DEPENDENCIES', 'META-INF/LICENSE', 'META-INF/LICENSE.txt', 'META-INF/NOTICE', 'META-INF/NOTICE.txt', 'META-INF/ASL2.0', 'META-INF/*.kotlin_module']
     81         }
     82 
     83 
     84 
     85         // Exclude everything under META-INF to avoid conflicts
     86         resources.excludes.add("META-INF/**/*")
     87     }
     88 
     89     externalNativeBuild {
     90         cmake {
     91             path file('src/main/cpp/CMakeLists.txt')
     92             version '3.22.1'
     93         }
     94     }
     95 
     96     splits {
     97         abi {
     98             // can not be defined per flavor, so we use a property to turn this on for F-Droid
     99             enable project.hasProperty('splitApk')
    100             reset() // Resets the list of ABIs to remove all included by default
    101             include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
    102             universalApk false
    103         }
    104     }
    105 
    106     lint {
    107         abortOnError true
    108         ignoreWarnings false
    109     }
    110 }
    111 
    112 dependencies {
    113     // TODO: do not vendor pre-built libsodium
    114     implementation fileTree(dir: 'src/main/libs/', include: ['libsodium-1.0.19.0.aar'])
    115     implementation 'androidx.appcompat:appcompat:1.7.1'
    116     implementation 'com.google.android.material:material:1.13.0'
    117     implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
    118     implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.10.0'
    119     implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.10.0'
    120     implementation 'androidx.navigation:navigation-fragment:2.9.7'
    121     implementation 'androidx.navigation:navigation-ui:2.9.7'
    122     implementation 'com.github.yuriy-budiyev:code-scanner:2.3.2'
    123     // https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk18on
    124     implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.70'
    125     implementation 'androidx.preference:preference-ktx:1.2.1'
    126     implementation 'androidx.preference:preference:1.2.1'
    127 }