/* * Copyright (C) 2014 Andrew Comminos * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ buildscript { repositories { mavenCentral() google() } dependencies { classpath 'com.android.tools.build:gradle:7.0.4' } } apply plugin: 'com.android.application' repositories { mavenCentral() google() } def gitDescribe = { -> def stdout = new ByteArrayOutputStream() exec { commandLine "git", "describe", "--tags", "--always" standardOutput = stdout } return stdout.toString().trim() } def signingFile = file 'signing.gradle' if (signingFile.exists()) apply from: signingFile def signingBetaFile = file 'signing-beta.gradle' if (signingBetaFile.exists()) apply from: signingBetaFile allprojects { tasks.withType(JavaCompile) { // TODO include deprecations at some point, but currently they are *many* options.compilerArgs << "-Xlint:all" << "-Xlint:-deprecation" << "-Xlint:-dep-ann" } } android { compileSdkVersion 31 defaultConfig { minSdkVersion 14 targetSdkVersion 31 multiDexEnabled true applicationId "se.lublin.mumla" versionCode 98 versionName gitDescribe() setProperty("archivesBaseName", "mumla") buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L" testInstrumentationRunner "android.test.InstrumentationTestRunner" } flavorDimensions "release" productFlavors { official { dimension "release" applicationId "se.lublin.mumla" } donation { dimension "release" applicationId "se.lublin.mumla.donation" } beta { dimension "release" applicationId "se.lublin.mumla.beta" } } buildTypes { // signingConfig beta will override release { if (android.hasProperty("signingConfigs")) { if (signingConfigs.hasProperty("release")) { signingConfig signingConfigs.release } if (signingConfigs.hasProperty("beta")) { signingConfig signingConfigs.beta } } } debug { versionNameSuffix "-debug" if (android.hasProperty("signingConfigs")) { if (signingConfigs.hasProperty("beta")) { signingConfig signingConfigs.beta } } } } // betas may be released every minute // TODO? dynamic stuff, have to rebuild a lot applicationVariants.all { variant -> if (variant.flavorName == "beta") { variant.outputs.each { output -> output.versionCodeOverride = System.currentTimeSeconds() / 60 } } } lintOptions { quiet false // spongycastle-related disable "InvalidPackage" disable "MissingTranslation" ignoreWarnings false abortOnError true explainIssues true } } dependencies { implementation 'androidx.multidex:multidex:2.0.1' implementation project(":libraries:humla") implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.documentfile:documentfile:1.0.1' implementation 'androidx.fragment:fragment:1.4.1' implementation 'androidx.recyclerview:recyclerview:1.2.1' implementation 'androidx.exifinterface:exifinterface:1.3.3' implementation 'org.jsoup:jsoup:1.13.1' implementation 'info.guardianproject.netcipher:netcipher:2.1.0' }