Julian Raufelder 7704ab5b87
Update msgraph-sdk version to 5.12.0 (#405)
* Update API level level to 26
* Support multi OneDrive accounts
* Migrate to the new authentication library
2022-01-24 11:51:02 +01:00

275 lines
7.7 KiB
Groovy

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'de.mannodermaus.android-junit5'
apply from: 'prebuild.gradle'
android {
signingConfigs {
debug {
keyAlias 'androiddebugkey'
keyPassword 'android'
storeFile file('debug.keystore')
storePassword 'android'
}
}
def globalConfiguration = rootProject.extensions.getByName("ext")
compileSdkVersion globalConfiguration["androidCompileSdkVersion"]
buildToolsVersion globalConfiguration["androidBuildToolsVersion"]
defaultConfig {
minSdkVersion globalConfiguration["androidMinSdkVersion"]
targetSdkVersion globalConfiguration["androidTargetSdkVersion"]
applicationId globalConfiguration["androidApplicationId"]
versionCode globalConfiguration["androidVersionCode"]
versionName globalConfiguration["androidVersionName"]
multiDexEnabled true
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
coreLibraryDesugaringEnabled true
}
lintOptions {
quiet true
abortOnError false
ignoreWarnings true
}
buildTypes {
release {
crunchPngs false
minifyEnabled false
shrinkResources false
buildConfigField "String", "DROPBOX_API_KEY", "\"" + getApiKey('DROPBOX_API_KEY') + "\""
buildConfigField "String", "PCLOUD_CLIENT_ID", "\"" + getApiKey('PCLOUD_CLIENT_ID') + "\""
manifestPlaceholders = [DROPBOX_API_KEY: getApiKey('DROPBOX_API_KEY'), ONEDRIVE_API_KEY_DECODED: getOnedriveApiKey()]
resValue "string", "app_id", androidApplicationId
}
debug {
signingConfig signingConfigs.debug
crunchPngs false
minifyEnabled false
shrinkResources false
testCoverageEnabled false
buildConfigField "String", "DROPBOX_API_KEY", "\"" + getApiKey('DROPBOX_API_KEY_DEBUG') + "\""
buildConfigField "String", "PCLOUD_CLIENT_ID", "\"" + getApiKey('PCLOUD_CLIENT_ID_DEBUG') + "\""
manifestPlaceholders = [DROPBOX_API_KEY: getApiKey('DROPBOX_API_KEY_DEBUG'), ONEDRIVE_API_KEY_DECODED: getOnedriveApiKey()]
applicationIdSuffix ".debug"
versionNameSuffix '-DEBUG'
resValue "string", "app_id", androidApplicationId + applicationIdSuffix
}
}
flavorDimensions "version"
productFlavors {
playstore {
dimension "version"
}
apkstore {
dimension "version"
}
fdroid {
dimension "version"
}
}
sourceSets {
playstore {
java.srcDirs = ['src/main/java', 'src/main/java/', 'src/notFoss/java', 'src/notFoss/java/']
}
apkstore {
java.srcDirs = ['src/main/java', 'src/main/java/', 'src/notFoss/java', 'src/notFoss/java/']
}
fdroid {
java.srcDirs = ['src/main/java', 'src/main/java/', 'src/foss/java', 'src/foss/java/']
}
}
packagingOptions {
exclude 'META-INF/jersey-module-version'
exclude 'META-INF/NOTICE.md'
exclude 'META-INF/DEPENDENCIES'
}
}
dependencies {
def dependencies = rootProject.ext.dependencies
// custom code generators
kapt project(':generator')
implementation project(':generator-api')
implementation project(':util')
implementation project(':domain')
implementation project(':data')
coreLibraryDesugaring dependencies.coreDesugaring
// dagger
kapt dependencies.daggerCompiler
implementation dependencies.dagger
// ui
implementation dependencies.appcompat
implementation dependencies.recyclerView
implementation dependencies.design
implementation project(':subsampling-image-view')
implementation dependencies.recyclerViewFastScroll
// android x
implementation dependencies.androidxCore
implementation dependencies.androidxFragment
implementation dependencies.androidxViewpager
implementation dependencies.androidxSwiperefresh
implementation dependencies.androidxPreference
implementation dependencies.androidxBiometric
// cloud
implementation dependencies.dropbox
implementation dependencies.msgraph
implementation dependencies.msgraphAuth
playstoreImplementation(dependencies.googleApiServicesDrive) {
exclude module: 'guava-jdk5'
exclude module: 'httpclient'
exclude module: 'googlehttpclient'
exclude group: "com.google.http-client", module: "google-http-client"
}
apkstoreImplementation(dependencies.googleApiServicesDrive) {
exclude module: 'guava-jdk5'
exclude module: 'httpclient'
exclude group: "com.google.http-client", module: "google-http-client"
}
playstoreImplementation(dependencies.googleApiClientAndroid) {
exclude module: 'guava-jdk5'
exclude module: 'httpclient'
exclude module: "google-http-client"
exclude module: "jetified-google-http-client"
exclude group: "com.google.http-client", module: "google-http-client"
exclude group: "com.google.http-client", module: "jetified-google-http-client"
}
apkstoreImplementation(dependencies.googleApiClientAndroid) {
exclude module: 'guava-jdk5'
exclude module: 'httpclient'
exclude module: "google-http-client"
exclude module: "jetified-google-http-client"
exclude group: "com.google.http-client", module: "google-http-client"
exclude group: "com.google.http-client", module: "jetified-google-http-client"
}
playstoreImplementation dependencies.trackingFreeGoogleCLient
apkstoreImplementation dependencies.trackingFreeGoogleCLient
playstoreImplementation dependencies.trackingFreeGoogleAndroidCLient
apkstoreImplementation dependencies.trackingFreeGoogleAndroidCLient
// rest
implementation dependencies.rxJava
implementation dependencies.rxAndroid
compileOnly dependencies.javaxAnnotation
implementation dependencies.zxcvbn
implementation dependencies.rxBinding
// multidex
implementation dependencies.multidex
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
// test
androidTestImplementation dependencies.androidAnnotations
androidTestImplementation dependencies.design
androidTestImplementation(dependencies.espresso) {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.google.code.findbugs'
}
androidTestImplementation(dependencies.runner) {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation(dependencies.rules) {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation(dependencies.contribution) {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
exclude group: 'com.google.code.findbugs'
}
androidTestImplementation(dependencies.uiAutomator) {
exclude group: 'com.android.support'
}
androidTestImplementation dependencies.runner
androidTestImplementation dependencies.androidAnnotations
testImplementation dependencies.junit
testImplementation dependencies.junitApi
testRuntimeOnly dependencies.junitEngine
testImplementation dependencies.junitParams
testRuntimeOnly dependencies.junit4Engine
testImplementation dependencies.mockito
testImplementation dependencies.mockitoInline
testImplementation dependencies.hamcrest
}
configurations {
all*.exclude group: 'com.google.android', module: 'android'
all*.exclude group: 'com.google.guava', module: 'listenablefuture'
}
androidExtensions {
experimental = true
}
static def getApiKey(key) {
return System.getenv().getOrDefault(key, "")
}
static def getOnedriveApiKey() {
String onedrivePath = "" + getApiKey('ONEDRIVE_API_REDIRCT_URI')
String idStr = onedrivePath.substring(onedrivePath.lastIndexOf('/') + 1)
URI uri = new URI(idStr)
return uri.path
}
tasks.withType(Test) {
testLogging {
events "failed"
showExceptions true
exceptionFormat "full"
showCauses true
showStackTraces true
showStandardStreams = false
}
}