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: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' apply plugin: 'io.objectbox' apply plugin: 'jacoco-android' apply plugin: "org.jlleitschuh.gradle.ktlint" apply plugin: 'com.jakewharton.butterknife' android { compileSdkVersion 28 defaultConfig { minSdkVersion 15 targetSdkVersion 28 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' } } compileOptions { encoding = "UTF-8" sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } androidExtensions { experimental = true } lintOptions { abortOnError true checkAllWarnings true warningsAsErrors true ignore 'SyntheticAccessor', //TODO stop ignoring below this 'MissingTranslation', 'CheckResult', 'LabelFor', 'DuplicateStrings', 'LogConditional' warning 'UnknownNullness', 'SelectableText', 'IconDensities', 'SyntheticAccessor' baseline file("lint-baseline.xml") } sourceSets { test { java.srcDirs += "$projectDir/src/testShared" } androidTest { java.srcDirs += "$projectDir/src/testShared" } } } jacoco { toolVersion = "0.8.3" } tasks.withType(Test) { jacoco.includeNoLocationClasses = true } ktlint { android = true } 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()) { implementation(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) }