1
0
mirror of https://github.com/AllanWang/Frost-for-Facebook.git synced 2024-09-20 07:31:40 +02:00
Frost-for-Facebook/app/build.gradle

288 lines
9.8 KiB
Groovy

apply plugin: 'com.android.application'
apply plugin: 'com.bugsnag.android.gradle'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.getkeepsafe.dexcount'
apply plugin: 'com.gladed.androidgitversion'
apply from: '../spotless.gradle'
android {
compileSdkVersion kau.targetSdk
buildToolsVersion kau.buildTools
androidGitVersion {
codeFormat = 'MMNNPPXX'
format = '%tag%%-count%%-commit%'
prefix 'v'
}
defaultConfig {
applicationId "${project.APP_GROUP}." + project.APP_ID.toLowerCase(Locale.CANADA)
minSdkVersion kau.minSdk
targetSdkVersion kau.targetSdk
versionCode androidGitVersion.code()
versionName androidGitVersion.name()
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "${project.APP_ID}-${variant.buildType.name}.apk"
}
}
lintOptions {
warningsAsErrors true
disable 'TrustAllX509TrustManager',
'UnusedResources',
'ContentDescription',
'RtlSymmetry',
'MissingTranslation'
xmlReport false
textReport true
textOutput 'stdout'
}
def testKeystoreFile = file('../files/test.keystore')
def testPropFile = file('../files/test.properties')
def withTestSigning = testKeystoreFile.exists() && testPropFile.exists()
def releaseKeystoreFile = file('../files/release.keystore')
def releasePropFile = file('../files/release.properties')
def withReleaseSigning = releaseKeystoreFile.exists() && releasePropFile.exists()
signingConfigs {
debug {
storeFile file("../files/debug.keystore")
storePassword "debugKey"
keyAlias "debugKey"
keyPassword "debugKey"
}
if (withTestSigning) {
def testProps = new Properties()
testPropFile.withInputStream { testProps.load(it) }
test {
storeFile testKeystoreFile
storePassword testProps.getProperty('storePassword')
keyAlias testProps.getProperty('keyAlias')
keyPassword testProps.getProperty('keyPassword')
}
}
if (withReleaseSigning) {
def releaseProps = new Properties()
releasePropFile.withInputStream { releaseProps.load(it) }
release {
storeFile releaseKeystoreFile
storePassword releaseProps.getProperty('storePassword')
keyAlias releaseProps.getProperty('keyAlias')
keyPassword releaseProps.getProperty('keyPassword')
}
}
}
def compilerArgs = ["-Xuse-experimental=kotlin.Experimental" /*, "-XXLanguage:+InlineClasses"*/]
buildTypes {
debug {
minifyEnabled false
shrinkResources false
applicationIdSuffix ".debug"
versionNameSuffix "-debug"
signingConfig signingConfigs.debug
resValue "string", "frost_name", "Frost Debug"
resValue "string", "frost_web", "Frost Web Debug"
ext.enableBugsnag = false
kotlinOptions.freeCompilerArgs += compilerArgs
}
releaseTest {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
applicationIdSuffix ".test"
versionNameSuffix "-test"
if (withTestSigning) signingConfig signingConfigs.test
resValue "string", "frost_name", "Frost Test"
resValue "string", "frost_web", "Frost Web Test"
}
release {
minifyEnabled true
shrinkResources true
if (withReleaseSigning) signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
resValue "string", "frost_name", "Frost"
resValue "string", "frost_web", "Frost Web"
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
test.java.srcDirs += 'src/test/kotlin'
androidTest.java.srcDirs += 'src/androidTest/kotlin'
}
packagingOptions {
pickFirst 'META-INF/library_release.kotlin_module'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
testOptions.unitTests {
includeAndroidResources = true
// Don't throw runtime exceptions for android calls that are not mocked
returnDefaultValues = true
// Always show the result of every unit test, even if it passes.
all {
testLogging {
events 'passed', 'skipped', 'failed', 'standardError'
}
}
}
androidExtensions {
experimental = true
}
}
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
implementation 'androidx.exifinterface:exifinterface:1.0.0'
androidTestImplementation kauDependency.kotlinTest
androidTestImplementation kauDependency.espresso
androidTestImplementation kauDependency.testRules
androidTestImplementation kauDependency.testRunner
testImplementation kauDependency.kotlinTest
testImplementation "org.jetbrains.kotlin:kotlin-reflect:${KOTLIN}"
testImplementation kauDependency.junit
implementation "org.jetbrains.kotlin:kotlin-stdlib:${KOTLIN}"
//noinspection GradleDependency
implementation "ca.allanwang.kau:adapter:$KAU"
//noinspection GradleDependency
implementation "ca.allanwang.kau:about:$KAU"
//noinspection GradleDependency
implementation "ca.allanwang.kau:colorpicker:$KAU"
//noinspection GradleDependency
implementation "ca.allanwang.kau:mediapicker:$KAU"
//noinspection GradleDependency
implementation "ca.allanwang.kau:kpref-activity:$KAU"
//noinspection GradleDependency
implementation "ca.allanwang.kau:searchview:$KAU"
//noinspection GradleDependency
implementation "ca.allanwang.kau:core:$KAU"
//noinspection GradleDependency
implementation "ca.allanwang.kau:core-ui:$KAU"
implementation "androidx.core:core-ktx:${KTX}"
// implementation "org.koin:koin-android:${KOIN}"
// testImplementation "org.koin:koin-test:${KOIN}"
// androidTestImplementation "org.koin:koin-test:${KOIN}"
// androidTestImplementation "io.mockk:mockk:${MOCKK}"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${COROUTINES}"
implementation "org.apache.commons:commons-text:${COMMONS_TEXT}"
implementation "com.devbrackets.android:exomedia:${EXOMEDIA}"
implementation "com.mikepenz:fastadapter-extensions:${kau.fastAdapter}@aar"
//noinspection GradleDependency
implementation "com.github.bumptech.glide:okhttp3-integration:${kau.glide}"
//noinspection GradleDependency
kapt "com.github.bumptech.glide:compiler:${kau.glide}"
implementation "com.fasterxml.jackson.core:jackson-databind:${JACKSON}"
//noinspection GradleDependency
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:${LEAK_CANARY}"
//noinspection GradleDependency
releaseTestImplementation "com.squareup.leakcanary:leakcanary-android-no-op:${LEAK_CANARY}"
//noinspection GradleDependency
debugImplementation "com.squareup.leakcanary:leakcanary-android:${LEAK_CANARY}"
// testImplementation "com.squareup.leakcanary:leakcanary-android-no-op:${LEAK_CANARY}"
implementation "com.github.Raizlabs.DBFlow:dbflow:${DBFLOW}"
implementation "com.github.Raizlabs.DBFlow:dbflow-core:${DBFLOW}"
kapt "com.github.Raizlabs.DBFlow:dbflow-processor:${DBFLOW}"
implementation "com.github.Raizlabs.DBFlow:dbflow-kotlinextensions:${DBFLOW}"
//Icons
implementation "com.mikepenz:material-design-iconic-typeface:${kau.iconicsMaterial}@aar"
implementation "com.mikepenz:community-material-typeface:${kau.iconicsCommunity}@aar"
implementation "org.jsoup:jsoup:${JSOUP}"
implementation "com.squareup.okhttp3:okhttp:${OKHTTP}"
implementation "com.squareup.okhttp3:logging-interceptor:${OKHTTP}"
testImplementation "com.squareup.okhttp3:mockwebserver:${OKHTTP}"
androidTestImplementation "com.squareup.okhttp3:mockwebserver:${OKHTTP}"
implementation "co.zsmb:materialdrawer-kt:${MATERIAL_DRAWER_KT}"
implementation "com.bugsnag:bugsnag-android:${BUGSNAG}"
implementation "com.davemorrissey.labs:subsampling-scale-image-view:${SCALE_IMAGE_VIEW}"
implementation "com.sothree.slidinguppanel:library:${SLIDING_PANEL}"
//Reactive Libs
implementation "io.reactivex.rxjava2:rxjava:${RX_JAVA}"
implementation "io.reactivex.rxjava2:rxkotlin:${RX_KOTLIN}"
implementation "io.reactivex.rxjava2:rxandroid:${RX_ANDROID}"
implementation "com.github.pwittchen:reactivenetwork-rx2:${RX_NETWORK}"
}
// Validates code and generates apk
task createGithubReleaseApk(type: GradleBuild) {
tasks = ['spotlessCheck',
'lintRelease',
'testReleaseUnitTest',
'connectedAndroidTest',
'assembleRelease']
}
def kotlinResolutions = ['kotlin-reflect',
'kotlin-stdlib',
'kotlin-stdlib-jdk7',
'kotlin-stdlib-jdk8',
'kotlin-test',
'kotlin-test-junit4',
'kotlin-test-junit5']
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'org.jetbrains.kotlin' && requested.name in kotlinResolutions) {
details.useVersion KOTLIN
}
}
}
apply plugin: 'com.bugsnag.android.gradle'