kiwix-android/core/build.gradle
2019-10-02 14:20:54 +01:00

147 lines
3.7 KiB
Groovy

buildscript {
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath Libs.com_android_tools_build_gradle
classpath Libs.kotlin_gradle_plugin
classpath Libs.objectbox_gradle_plugin
classpath Libs.ktlint_gradle
classpath Libs.butterknife_gradle_plugin
}
}
plugins {
id("checkstyle")
id("com.github.triplet.play") version("2.4.1")
}
apply plugin: 'com.android.library'
apply plugin: KiwixConfigurationPlugin
apply plugin: 'io.objectbox'
apply plugin: 'com.jakewharton.butterknife'
android {
defaultConfig {
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
buildConfigField "boolean", "IS_CUSTOM_APP", "false"
buildConfigField "boolean", "HAS_EMBEDDED_ZIM", "false"
buildConfigField "String", "ZIM_FILE_NAME", "\"\""
buildConfigField "long", "ZIM_FILE_SIZE", "0"
buildConfigField "int", "CONTENT_VERSION_CODE", "0"
buildConfigField "String", "ENFORCED_LANG", "\"\""
resValue "string", "app_name", "Kiwix"
resValue "string", "app_search_string", "Search Kiwix"
buildConfigField "String", "KIWIX_DOWNLOAD_URL", "\"http://mirror.download.kiwix.org/\""
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
testOptions {
execution 'ANDROIDX_TEST_ORCHESTRATOR'
}
sourceSets {
test {
java.srcDirs += "$projectDir/src/testShared"
}
androidTest {
java.srcDirs += "$projectDir/src/testShared"
}
}
}
private boolean shouldUseLocalVersion() {
file("./libs").exists()
}
dependencies {
// use jdk8 java.time backport, as long app < Build.VERSION_CODES.O
implementation(Libs.threetenabp)
// Get kiwixlib online if it is not populated locally
if (!shouldUseLocalVersion()) {
api(Libs.kiwixlib)
} else {
implementation 'com.getkeepsafe.relinker:relinker:1.3.1'
implementation fileTree(include: ['*.aar'], dir: 'libs')
}
// Android Support
implementation(Libs.appcompat)
implementation(Libs.material)
implementation(Libs.cardview)
implementation(Libs.androidx_multidex_multidex)
implementation(Libs.constraintlayout)
implementation(Libs.core_ktx)
implementation(Libs.fragment_ktx)
implementation(Libs.collection_ktx)
// Tab indicator
implementation(Libs.ink_page_indicator)
// Dagger
compileOnly(Libs.javax_annotation_api)
implementation(Libs.dagger)
implementation(Libs.dagger_android)
kapt(Libs.dagger_compiler)
kapt(Libs.dagger_android_processor)
// SquiDB
implementation(Libs.squidb)
implementation(Libs.squidb_annotations)
kapt(Libs.squidb_processor)
// Square
implementation(Libs.okhttp)
implementation(Libs.logging_interceptor)
implementation(Libs.retrofit)
implementation(Libs.adapter_rxjava2)
implementation(Libs.converter_simplexml) {
exclude group: "xpp3", module: "xpp3"
exclude group: "stax", module: "stax-api"
exclude group: "stax", module: "stax"
}
// ButterKnife
implementation(Libs.butterknife)
kapt(Libs.butterknife_compiler)
// RxJava
implementation(Libs.rxandroid)
implementation(Libs.rxjava)
// Leak canary
debugImplementation(Libs.leakcanary_android)
implementation(Libs.kotlin_stdlib_jdk7)
implementation(Libs.android_arch_lifecycle_extensions)
implementation(Libs.objectbox_kotlin)
implementation(Libs.objectbox_rxjava)
implementation(Libs.xfetch2)
implementation(Libs.xfetch2okhttp)
testImplementation(Libs.junit_jupiter)
testImplementation(Libs.mockk)
testImplementation(Libs.assertj_core)
testImplementation(Libs.testing_ktx)
testImplementation(Libs.core_testing)
}