mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 10:46:53 -04:00
use buildSrcVersions to extract dependencies, correct pre-commit script
This commit is contained in:
parent
8bb9bca68a
commit
449d47ca3f
113
app/build.gradle
113
app/build.gradle
@ -1,11 +1,4 @@
|
||||
import com.android.annotations.NonNull
|
||||
import com.android.build.OutputFile
|
||||
import com.android.builder.testing.api.TestServer
|
||||
import com.testdroid.api.APIClient
|
||||
import com.testdroid.api.APIKeyClient
|
||||
import com.testdroid.api.model.APIProject
|
||||
import com.testdroid.api.model.APIUser
|
||||
import groovy.json.JsonSlurper
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
@ -15,11 +8,11 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "com.android.tools.build:gradle:$androidGradlePluginVersion"
|
||||
classpath "org.apache.httpcomponents:httpclient-android:4.3.3"
|
||||
classpath "com.testdroid:testdroid-api:2.71"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
||||
classpath "org.jlleitschuh.gradle:ktlint-gradle:8.2.0"
|
||||
dependencies {
|
||||
classpath Libs.com_android_tools_build_gradle
|
||||
classpath Libs.kotlin_gradle_plugin
|
||||
classpath Libs.ktlint_gradle
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,7 +68,6 @@ private Integer generateVersionCode() {
|
||||
|
||||
android {
|
||||
compileSdkVersion 28
|
||||
testServer new TestDroidUpload()
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 15
|
||||
@ -124,15 +116,6 @@ android {
|
||||
}
|
||||
}
|
||||
}
|
||||
sourceSets {
|
||||
test {
|
||||
java.srcDirs += "$projectDir/src/testShared"
|
||||
}
|
||||
|
||||
androidTest {
|
||||
java.srcDirs += "$projectDir/src/testShared"
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions "default"
|
||||
|
||||
@ -191,8 +174,6 @@ android {
|
||||
versionName generateVersionName()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
@ -248,75 +229,33 @@ ktlint {
|
||||
android = true
|
||||
}
|
||||
|
||||
class TestDroidUpload extends TestServer {
|
||||
def buildNumber = System.getenv("TRAVIS_BUILD_NUMBER")
|
||||
def API_KEY = System.getenv("PUBLIC_TESTDROID_API_KEY")
|
||||
def TESTDROID_SERVER = "https://cloud.testdroid.com"
|
||||
def RUNNER_GATEWAY = System.getenv("TESTDROID_RUNNER_GATEWAY")
|
||||
def accessGroup = System.getenv("ACCESS_GROUP_ID")
|
||||
|
||||
@Override
|
||||
String getName() {
|
||||
return "kiwixtest"
|
||||
}
|
||||
|
||||
@Override
|
||||
void uploadApks(@NonNull String variantName, @NonNull File testApk, File testedApk) {
|
||||
APIUser.metaClass.shareFile { id, accessGroup ->
|
||||
System.out.println(id)
|
||||
try {
|
||||
delegate.postResource(createUri(selfURI, "/files/" + id + "/share"),
|
||||
[accessGroupId: accessGroup], APIProject.class)
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getLocalizedMessage())
|
||||
}
|
||||
}
|
||||
|
||||
APIClient client = new APIKeyClient(TESTDROID_SERVER, API_KEY)
|
||||
APIUser user = client.me()
|
||||
String testId = user.uploadFile(testApk).getId()
|
||||
user.shareFile(testId, accessGroup)
|
||||
String testedId = user.uploadFile(testedApk).getId()
|
||||
user.shareFile(testedId, accessGroup)
|
||||
|
||||
new URL(RUNNER_GATEWAY + "?apk=" + testedId + "&test=" + testId + "&buildno=" + buildNumber).
|
||||
getText()
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isConfigured() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
apply from: "${rootDir}/team-props/git-hooks.gradle"
|
||||
afterEvaluate {
|
||||
tasks['preBuild'].dependsOn installGitHooks
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(":core")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:$espressoVersion")
|
||||
androidTestImplementation "androidx.test.espresso:espresso-web:$espressoVersion"
|
||||
androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoVersion"
|
||||
androidTestImplementation("com.schibsted.spain:barista:$baristaVersion") {
|
||||
implementation(Libs.appcompat)
|
||||
androidTestImplementation(Libs.espresso_core)
|
||||
androidTestImplementation(Libs.espresso_web)
|
||||
androidTestImplementation(Libs.espresso_intents)
|
||||
androidTestImplementation(Libs.barista) {
|
||||
exclude group: "com.android.support.test.uiautomator"
|
||||
}
|
||||
androidTestImplementation("androidx.test.espresso:espresso-contrib:$espressoVersion")
|
||||
androidTestImplementation "androidx.annotation:annotation:$annotationVersion"
|
||||
androidTestImplementation "androidx.test.ext:junit:1.1.1"
|
||||
androidTestImplementation "androidx.test:runner:1.2.0"
|
||||
androidTestImplementation "androidx.test:rules:1.2.0"
|
||||
androidTestImplementation "androidx.test:core:1.2.0"
|
||||
androidTestImplementation "com.squareup.okhttp3:mockwebserver:3.6.0"
|
||||
androidTestUtil 'androidx.test:orchestrator:1.1.0'
|
||||
androidTestImplementation "org.mockito:mockito-android:$mockitoVersion"
|
||||
androidTestCompileOnly "javax.annotation:javax.annotation-api:$javaxAnnotationVersion"
|
||||
kaptAndroidTest "com.google.dagger:dagger-compiler:$daggerVersion"
|
||||
androidTestImplementation "io.mockk:mockk-android:1.9"
|
||||
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
|
||||
androidTestImplementation "org.assertj:assertj-core:3.11.1"
|
||||
androidTestImplementation("org.simpleframework:simple-xml:2.7.1") {
|
||||
androidTestImplementation(Libs.espresso_contrib)
|
||||
androidTestImplementation(Libs.androidx_annotation)
|
||||
androidTestImplementation(Libs.junit)
|
||||
androidTestImplementation(Libs.androidx_test_runner)
|
||||
androidTestImplementation(Libs.androidx_test_rules)
|
||||
androidTestImplementation(Libs.androidx_test_core)
|
||||
androidTestImplementation(Libs.mockwebserver)
|
||||
androidTestUtil(Libs.orchestrator)
|
||||
androidTestImplementation(Libs.mockito_android)
|
||||
androidTestCompileOnly(Libs.javax_annotation_api)
|
||||
implementation(Libs.dagger)
|
||||
kaptAndroidTest(Libs.dagger_compiler)
|
||||
androidTestImplementation(Libs.mockk_android)
|
||||
androidTestImplementation(Libs.uiautomator)
|
||||
androidTestImplementation(Libs.assertj_core)
|
||||
androidTestImplementation(Libs.simple_xml) {
|
||||
exclude module: 'stax'
|
||||
exclude module: 'stax-api'
|
||||
exclude module: 'xpp3'
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -26,7 +26,9 @@ abstract class BaseActivityTest<T : Activity> {
|
||||
getInstrumentation().targetContext.applicationContext
|
||||
}
|
||||
|
||||
inline fun <reified T : Activity> activityTestRule(noinline beforeActivityAction: (() -> Unit)? = null) =
|
||||
inline fun <reified T : Activity> activityTestRule(
|
||||
noinline beforeActivityAction: (() -> Unit)? = null
|
||||
) =
|
||||
object : ActivityTestRule<T>(T::class.java) {
|
||||
override fun beforeActivityLaunched() {
|
||||
super.beforeActivityLaunched()
|
||||
|
@ -45,7 +45,10 @@ class KiwixMockServer {
|
||||
override fun dispatch(request: RecordedRequest) =
|
||||
mapOfPathsToResponses[request.path]?.let(::successfulResponse)
|
||||
?: forcedResponse?.let { return@let it }
|
||||
?: throw RuntimeException("No response mapped for ${request.path}\nmapped $mapOfPathsToResponses\nqueued $forcedResponse")
|
||||
?: throw RuntimeException(
|
||||
"No response mapped for ${request.path}" +
|
||||
"\nmapped $mapOfPathsToResponses\nqueued $forcedResponse"
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
@ -67,5 +70,3 @@ class KiwixMockServer {
|
||||
"$it"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -33,7 +33,14 @@ import javax.inject.Singleton
|
||||
*/
|
||||
|
||||
@Singleton
|
||||
@Component(modules = [ApplicationModule::class, TestNetworkModule::class, JNIModule::class, DataModule::class])
|
||||
@Component(
|
||||
modules = [
|
||||
ApplicationModule::class,
|
||||
TestNetworkModule::class,
|
||||
JNIModule::class,
|
||||
DataModule::class
|
||||
]
|
||||
)
|
||||
interface TestComponent : ApplicationComponent {
|
||||
|
||||
@Component.Builder
|
||||
|
@ -11,6 +11,9 @@ buildscript {
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
plugins {
|
||||
buildSrcVersions
|
||||
}
|
||||
|
||||
ext {
|
||||
set("androidGradlePluginVersion", "3.5.0")
|
||||
|
2
buildSrc/.gitignore
vendored
Normal file
2
buildSrc/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
.gradle/
|
||||
build/
|
6
buildSrc/build.gradle.kts
Normal file
6
buildSrc/build.gradle.kts
Normal file
@ -0,0 +1,6 @@
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
408
buildSrc/src/main/kotlin/Libs.kt
Normal file
408
buildSrc/src/main/kotlin/Libs.kt
Normal file
@ -0,0 +1,408 @@
|
||||
import kotlin.String
|
||||
|
||||
/**
|
||||
* Generated by https://github.com/jmfayard/buildSrcVersions
|
||||
*
|
||||
* Update this file with
|
||||
* `$ ./gradlew buildSrcVersions`
|
||||
*/
|
||||
object Libs {
|
||||
const val de_fayard_buildsrcversions_gradle_plugin: String =
|
||||
"de.fayard.buildSrcVersions:de.fayard.buildSrcVersions.gradle.plugin:" +
|
||||
Versions.de_fayard_buildsrcversions_gradle_plugin
|
||||
|
||||
const val com_github_triplet_play_gradle_plugin: String =
|
||||
"com.github.triplet.play:com.github.triplet.play.gradle.plugin:" +
|
||||
Versions.com_github_triplet_play_gradle_plugin
|
||||
|
||||
/**
|
||||
* https://developer.android.com/topic/libraries/architecture/index.html
|
||||
*/
|
||||
const val android_arch_lifecycle_extensions: String = "android.arch.lifecycle:extensions:" +
|
||||
Versions.android_arch_lifecycle_extensions
|
||||
|
||||
/**
|
||||
* https://developer.android.com/studio
|
||||
*/
|
||||
const val com_android_tools_build_gradle: String = "com.android.tools.build:gradle:" +
|
||||
Versions.com_android_tools_build_gradle
|
||||
|
||||
const val androidx_multidex_multidex: String = "androidx.multidex:multidex:" +
|
||||
Versions.androidx_multidex_multidex
|
||||
|
||||
/**
|
||||
* https://github.com/JakeWharton/butterknife/
|
||||
*/
|
||||
const val butterknife_gradle_plugin: String = "com.jakewharton:butterknife-gradle-plugin:" +
|
||||
Versions.butterknife_gradle_plugin
|
||||
|
||||
const val multidex_instrumentation: String = "androidx.multidex:multidex-instrumentation:" +
|
||||
Versions.multidex_instrumentation
|
||||
|
||||
/**
|
||||
* https://developer.android.com/testing
|
||||
*/
|
||||
const val espresso_contrib: String = "androidx.test.espresso:espresso-contrib:" +
|
||||
Versions.androidx_test_espresso
|
||||
|
||||
/**
|
||||
* https://developer.android.com/testing
|
||||
*/
|
||||
const val espresso_core: String = "androidx.test.espresso:espresso-core:" +
|
||||
Versions.androidx_test_espresso
|
||||
|
||||
/**
|
||||
* https://developer.android.com/testing
|
||||
*/
|
||||
const val espresso_intents: String = "androidx.test.espresso:espresso-intents:" +
|
||||
Versions.androidx_test_espresso
|
||||
|
||||
/**
|
||||
* https://developer.android.com/testing
|
||||
*/
|
||||
const val espresso_web: String = "androidx.test.espresso:espresso-web:" +
|
||||
Versions.androidx_test_espresso
|
||||
|
||||
/**
|
||||
* https://github.com/square/retrofit/
|
||||
*/
|
||||
const val adapter_rxjava2: String = "com.squareup.retrofit2:adapter-rxjava2:" +
|
||||
Versions.com_squareup_retrofit2
|
||||
|
||||
/**
|
||||
* https://github.com/square/retrofit/
|
||||
*/
|
||||
const val converter_simplexml: String = "com.squareup.retrofit2:converter-simplexml:" +
|
||||
Versions.com_squareup_retrofit2
|
||||
|
||||
/**
|
||||
* https://github.com/square/retrofit/
|
||||
*/
|
||||
const val retrofit: String = "com.squareup.retrofit2:retrofit:" + Versions.com_squareup_retrofit2
|
||||
|
||||
const val play_services_location: String = "com.google.android.gms:play-services-location:" +
|
||||
Versions.play_services_location
|
||||
|
||||
/**
|
||||
* https://developer.android.com/testing
|
||||
*/
|
||||
const val androidx_test_runner: String = "androidx.test:runner:" + Versions.androidx_test_runner
|
||||
|
||||
/**
|
||||
* https://github.com/JakeWharton/butterknife/
|
||||
*/
|
||||
const val butterknife_compiler: String = "com.jakewharton:butterknife-compiler:" +
|
||||
Versions.butterknife_compiler
|
||||
|
||||
/**
|
||||
* http://jcp.org/en/jsr/detail?id=250
|
||||
*/
|
||||
const val javax_annotation_api: String = "javax.annotation:javax.annotation-api:" +
|
||||
Versions.javax_annotation_api
|
||||
|
||||
/**
|
||||
* https://kotlinlang.org/
|
||||
*/
|
||||
const val kotlin_android_extensions: String = "org.jetbrains.kotlin:kotlin-android-extensions:" +
|
||||
Versions.org_jetbrains_kotlin
|
||||
|
||||
/**
|
||||
* https://kotlinlang.org/
|
||||
*/
|
||||
const val kotlin_android_extensions_runtime: String =
|
||||
"org.jetbrains.kotlin:kotlin-android-extensions-runtime:" + Versions.org_jetbrains_kotlin
|
||||
|
||||
/**
|
||||
* https://kotlinlang.org/
|
||||
*/
|
||||
const val kotlin_annotation_processing_gradle: String =
|
||||
"org.jetbrains.kotlin:kotlin-annotation-processing-gradle:" + Versions.org_jetbrains_kotlin
|
||||
|
||||
/**
|
||||
* https://kotlinlang.org/
|
||||
*/
|
||||
const val kotlin_gradle_plugin: String = "org.jetbrains.kotlin:kotlin-gradle-plugin:" +
|
||||
Versions.org_jetbrains_kotlin
|
||||
|
||||
/**
|
||||
* https://kotlinlang.org/
|
||||
*/
|
||||
const val kotlin_stdlib_jdk7: String = "org.jetbrains.kotlin:kotlin-stdlib-jdk7:" +
|
||||
Versions.org_jetbrains_kotlin
|
||||
|
||||
/**
|
||||
* https://developer.android.com/testing
|
||||
*/
|
||||
const val androidx_test_rules: String = "androidx.test:rules:" + Versions.androidx_test_rules
|
||||
|
||||
/**
|
||||
* https://github.com/square/okhttp
|
||||
*/
|
||||
const val logging_interceptor: String = "com.squareup.okhttp3:logging-interceptor:" +
|
||||
Versions.logging_interceptor
|
||||
|
||||
/**
|
||||
* https://developer.android.com/testing
|
||||
*/
|
||||
const val androidx_test_core: String = "androidx.test:core:" + Versions.androidx_test_core
|
||||
|
||||
/**
|
||||
* http://hc.apache.org/httpcomponents-client/
|
||||
*/
|
||||
const val httpclient_android: String = "org.apache.httpcomponents:httpclient-android:" +
|
||||
Versions.httpclient_android
|
||||
|
||||
const val ink_page_indicator: String = "com.pacioianu.david:ink-page-indicator:" +
|
||||
Versions.ink_page_indicator
|
||||
|
||||
/**
|
||||
* http://github.com/square/leakcanary/
|
||||
*/
|
||||
const val leakcanary_android: String = "com.squareup.leakcanary:leakcanary-android:" +
|
||||
Versions.leakcanary_android
|
||||
|
||||
/**
|
||||
* https://github.com/google/dagger
|
||||
*/
|
||||
const val dagger: String = "com.google.dagger:dagger:" + Versions.com_google_dagger
|
||||
|
||||
/**
|
||||
* https://github.com/google/dagger
|
||||
*/
|
||||
const val dagger_android: String = "com.google.dagger:dagger-android:" +
|
||||
Versions.com_google_dagger
|
||||
|
||||
/**
|
||||
* https://github.com/google/dagger
|
||||
*/
|
||||
const val dagger_android_processor: String = "com.google.dagger:dagger-android-processor:" +
|
||||
Versions.com_google_dagger
|
||||
|
||||
/**
|
||||
* https://github.com/google/dagger
|
||||
*/
|
||||
const val dagger_compiler: String = "com.google.dagger:dagger-compiler:" +
|
||||
Versions.com_google_dagger
|
||||
|
||||
/**
|
||||
* https://github.com/yahoo/squidb
|
||||
*/
|
||||
const val squidb: String = "com.yahoo.squidb:squidb:" + Versions.com_yahoo_squidb
|
||||
|
||||
/**
|
||||
* https://github.com/yahoo/squidb
|
||||
*/
|
||||
const val squidb_annotations: String = "com.yahoo.squidb:squidb-annotations:" +
|
||||
Versions.com_yahoo_squidb
|
||||
|
||||
/**
|
||||
* https://github.com/yahoo/squidb
|
||||
*/
|
||||
const val squidb_processor: String = "com.yahoo.squidb:squidb-processor:" +
|
||||
Versions.com_yahoo_squidb
|
||||
|
||||
/**
|
||||
* http://tools.android.com
|
||||
*/
|
||||
const val constraintlayout: String = "androidx.constraintlayout:constraintlayout:" +
|
||||
Versions.constraintlayout
|
||||
|
||||
/**
|
||||
* https://github.com/mockito/mockito
|
||||
*/
|
||||
const val mockito_android: String = "org.mockito:mockito-android:" + Versions.mockito_android
|
||||
|
||||
/**
|
||||
* http://developer.android.com/tools/extras/support-library.html
|
||||
*/
|
||||
const val collection_ktx: String = "androidx.collection:collection-ktx:" + Versions.collection_ktx
|
||||
|
||||
const val jacoco_android: String = "com.dicedmelon.gradle:jacoco-android:" +
|
||||
Versions.jacoco_android
|
||||
|
||||
/**
|
||||
* https://junit.org/junit5/
|
||||
*/
|
||||
const val junit_jupiter: String = "org.junit.jupiter:junit-jupiter:" + Versions.junit_jupiter
|
||||
|
||||
const val ktlint_gradle: String = "org.jlleitschuh.gradle:ktlint-gradle:" + Versions.ktlint_gradle
|
||||
|
||||
/**
|
||||
* https://github.com/square/okhttp
|
||||
*/
|
||||
const val mockwebserver: String = "com.squareup.okhttp3:mockwebserver:" + Versions.mockwebserver
|
||||
|
||||
/**
|
||||
* https://github.com/bitbar/testdroid-api
|
||||
*/
|
||||
const val testdroid_api: String = "com.testdroid:testdroid-api:" + Versions.testdroid_api
|
||||
|
||||
const val xfetch2okhttp: String = "androidx.tonyodev.fetch2okhttp:xfetch2okhttp:" +
|
||||
Versions.xfetch2okhttp
|
||||
|
||||
/**
|
||||
* http://assertj.org
|
||||
*/
|
||||
const val assertj_core: String = "org.assertj:assertj-core:" + Versions.assertj_core
|
||||
|
||||
/**
|
||||
* https://developer.android.com/topic/libraries/architecture/index.html
|
||||
*/
|
||||
const val core_testing: String = "androidx.arch.core:core-testing:" + Versions.core_testing
|
||||
|
||||
/**
|
||||
* https://developer.android.com/jetpack/androidx
|
||||
*/
|
||||
const val fragment_ktx: String = "androidx.fragment:fragment-ktx:" + Versions.fragment_ktx
|
||||
|
||||
/**
|
||||
* http://objectbox.io
|
||||
*/
|
||||
const val objectbox_android: String = "io.objectbox:objectbox-android:" + Versions.io_objectbox
|
||||
|
||||
/**
|
||||
* https://objectbox.io
|
||||
*/
|
||||
const val objectbox_gradle_plugin: String = "io.objectbox:objectbox-gradle-plugin:" +
|
||||
Versions.io_objectbox
|
||||
|
||||
/**
|
||||
* http://objectbox.io
|
||||
*/
|
||||
const val objectbox_kotlin: String = "io.objectbox:objectbox-kotlin:" + Versions.io_objectbox
|
||||
|
||||
/**
|
||||
* https://objectbox.io
|
||||
*/
|
||||
const val objectbox_processor: String = "io.objectbox:objectbox-processor:" +
|
||||
Versions.io_objectbox
|
||||
|
||||
/**
|
||||
* http://objectbox.io
|
||||
*/
|
||||
const val objectbox_rxjava: String = "io.objectbox:objectbox-rxjava:" + Versions.io_objectbox
|
||||
|
||||
/**
|
||||
* http://objectbox.io
|
||||
*/
|
||||
const val objectbox_windows: String = "io.objectbox:objectbox-windows:" + Versions.io_objectbox
|
||||
|
||||
/**
|
||||
* https://developer.android.com/testing
|
||||
*/
|
||||
const val orchestrator: String = "androidx.test:orchestrator:" + Versions.orchestrator
|
||||
|
||||
/**
|
||||
* https://github.com/JakeWharton/butterknife/
|
||||
*/
|
||||
const val butterknife: String = "com.jakewharton:butterknife:" + Versions.butterknife
|
||||
|
||||
/**
|
||||
* https://developer.android.com/studio
|
||||
*/
|
||||
const val lint_gradle: String = "com.android.tools.lint:lint-gradle:" + Versions.lint_gradle
|
||||
|
||||
/**
|
||||
* https://github.com/jraska/livedata-testing
|
||||
*/
|
||||
const val testing_ktx: String = "com.jraska.livedata:testing-ktx:" + Versions.testing_ktx
|
||||
|
||||
/**
|
||||
* https://github.com/JakeWharton/ThreeTenABP/
|
||||
*/
|
||||
const val threetenabp: String = "com.jakewharton.threetenabp:threetenabp:" + Versions.threetenabp
|
||||
|
||||
/**
|
||||
* https://developer.android.com/testing
|
||||
*/
|
||||
const val uiautomator: String = "androidx.test.uiautomator:uiautomator:" + Versions.uiautomator
|
||||
|
||||
/**
|
||||
* http://developer.android.com/tools/extras/support-library.html
|
||||
*/
|
||||
const val androidx_annotation: String = "androidx.annotation:annotation:" + Versions.annotation
|
||||
|
||||
/**
|
||||
* http://jacoco.org
|
||||
*/
|
||||
const val org_jacoco_agent: String = "org.jacoco:org.jacoco.agent:" + Versions.org_jacoco
|
||||
|
||||
/**
|
||||
* http://jacoco.org
|
||||
*/
|
||||
const val org_jacoco_ant: String = "org.jacoco:org.jacoco.ant:" + Versions.org_jacoco
|
||||
|
||||
/**
|
||||
* http://simple.sourceforge.net
|
||||
*/
|
||||
const val simple_xml: String = "org.simpleframework:simple-xml:" + Versions.simple_xml
|
||||
|
||||
/**
|
||||
* https://developer.android.com/jetpack/androidx
|
||||
*/
|
||||
const val appcompat: String = "androidx.appcompat:appcompat:" + Versions.appcompat
|
||||
|
||||
/**
|
||||
* https://github.com/ReactiveX/RxAndroid
|
||||
*/
|
||||
const val rxandroid: String = "io.reactivex.rxjava2:rxandroid:" + Versions.rxandroid
|
||||
|
||||
/**
|
||||
* http://developer.android.com/tools/extras/support-library.html
|
||||
*/
|
||||
const val cardview: String = "androidx.cardview:cardview:" + Versions.cardview
|
||||
|
||||
/**
|
||||
* http://developer.android.com/tools/extras/support-library.html
|
||||
*/
|
||||
const val core_ktx: String = "androidx.core:core-ktx:" + Versions.core_ktx
|
||||
|
||||
/**
|
||||
* http://mockk.io
|
||||
*/
|
||||
const val mockk: String = "io.mockk:mockk:" + Versions.io_mockk
|
||||
|
||||
/**
|
||||
* http://mockk.io
|
||||
*/
|
||||
const val mockk_android: String = "io.mockk:mockk-android:" + Versions.io_mockk
|
||||
|
||||
/**
|
||||
* https://github.com/kiwix/kiwix-lib
|
||||
*/
|
||||
const val kiwixlib: String = "org.kiwix.kiwixlib:kiwixlib:" + Versions.kiwixlib
|
||||
|
||||
/**
|
||||
* http://developer.android.com/tools/extras/support-library.html
|
||||
*/
|
||||
const val material: String = "com.google.android.material:material:" + Versions.material
|
||||
|
||||
const val barista: String = "com.schibsted.spain:barista:" + Versions.barista
|
||||
|
||||
const val xfetch2: String = "androidx.tonyodev.fetch2:xfetch2:" + Versions.xfetch2
|
||||
|
||||
/**
|
||||
* http://findbugs.sourceforge.net/
|
||||
*/
|
||||
const val jsr305: String = "com.google.code.findbugs:jsr305:" + Versions.jsr305
|
||||
|
||||
/**
|
||||
* https://github.com/square/okhttp
|
||||
*/
|
||||
const val okhttp: String = "com.squareup.okhttp3:okhttp:" + Versions.okhttp
|
||||
|
||||
/**
|
||||
* https://github.com/ReactiveX/RxJava
|
||||
*/
|
||||
const val rxjava: String = "io.reactivex.rxjava2:rxjava:" + Versions.rxjava
|
||||
|
||||
/**
|
||||
* https://developer.android.com/studio
|
||||
*/
|
||||
const val aapt2: String = "com.android.tools.build:aapt2:" + Versions.aapt2
|
||||
|
||||
/**
|
||||
* https://developer.android.com/testing
|
||||
*/
|
||||
const val junit: String = "androidx.test.ext:junit:" + Versions.junit
|
||||
}
|
145
buildSrc/src/main/kotlin/Versions.kt
Normal file
145
buildSrc/src/main/kotlin/Versions.kt
Normal file
@ -0,0 +1,145 @@
|
||||
import kotlin.String
|
||||
import org.gradle.plugin.use.PluginDependenciesSpec
|
||||
import org.gradle.plugin.use.PluginDependencySpec
|
||||
|
||||
/**
|
||||
* Generated by https://github.com/jmfayard/buildSrcVersions
|
||||
*
|
||||
* Find which updates are available by running
|
||||
* `$ ./gradlew buildSrcVersions`
|
||||
* This will only update the comments.
|
||||
*
|
||||
* YOU are responsible for updating manually the dependency version.
|
||||
*/
|
||||
object Versions {
|
||||
const val de_fayard_buildsrcversions_gradle_plugin: String = "0.6.1"
|
||||
|
||||
const val com_github_triplet_play_gradle_plugin: String = "2.4.1" // available: "2.4.2"
|
||||
|
||||
const val android_arch_lifecycle_extensions: String = "1.1.1"
|
||||
|
||||
const val com_android_tools_build_gradle: String = "3.5.0"
|
||||
|
||||
const val androidx_multidex_multidex: String = "2.0.1"
|
||||
|
||||
const val butterknife_gradle_plugin: String = "10.2.0"
|
||||
|
||||
const val multidex_instrumentation: String = "2.0.0"
|
||||
|
||||
const val androidx_test_espresso: String = "3.1.1" // available: "3.2.0"
|
||||
|
||||
const val com_squareup_retrofit2: String = "2.5.0" // available: "2.6.2"
|
||||
|
||||
const val play_services_location: String = "17.0.0"
|
||||
|
||||
const val androidx_test_runner: String = "1.2.0"
|
||||
|
||||
const val butterknife_compiler: String = "10.1.0" // available: "10.2.0"
|
||||
|
||||
const val javax_annotation_api: String = "1.3.2"
|
||||
|
||||
const val org_jetbrains_kotlin: String = "1.3.50"
|
||||
|
||||
const val androidx_test_rules: String = "1.2.0"
|
||||
|
||||
const val logging_interceptor: String = "3.12.1" // available: "4.2.0"
|
||||
|
||||
const val androidx_test_core: String = "1.2.0"
|
||||
|
||||
const val httpclient_android: String = "4.3.3" // available: "4.3.5.1"
|
||||
|
||||
const val ink_page_indicator: String = "1.3.0"
|
||||
|
||||
const val leakcanary_android: String = "2.0-alpha-2"
|
||||
|
||||
const val com_google_dagger: String = "2.21" // available: "2.24"
|
||||
|
||||
const val com_yahoo_squidb: String = "2.0.0" // available: "3.2.3"
|
||||
|
||||
const val constraintlayout: String = "1.1.3"
|
||||
|
||||
const val mockito_android: String = "2.24.5" // available: "3.0.0"
|
||||
|
||||
const val collection_ktx: String = "1.1.0"
|
||||
|
||||
const val jacoco_android: String = "0.1.4"
|
||||
|
||||
const val junit_jupiter: String = "5.4.2" // available: "5.5.2"
|
||||
|
||||
const val ktlint_gradle: String = "8.2.0"
|
||||
|
||||
const val mockwebserver: String = "3.6.0" // available: "4.2.0"
|
||||
|
||||
const val testdroid_api: String = "2.71" // available: "2.81"
|
||||
|
||||
const val xfetch2okhttp: String = "3.1.4"
|
||||
|
||||
const val assertj_core: String = "3.11.1" // available: "3.13.2"
|
||||
|
||||
const val core_testing: String = "2.0.1" // available: "2.1.0"
|
||||
|
||||
const val fragment_ktx: String = "1.0.0" // available: "1.1.0"
|
||||
|
||||
const val io_objectbox: String = "2.3.4"
|
||||
|
||||
const val orchestrator: String = "1.1.0" // available: "1.2.0"
|
||||
|
||||
const val butterknife: String = "10.1.0" // available: "10.2.0"
|
||||
|
||||
const val lint_gradle: String = "26.5.0"
|
||||
|
||||
const val testing_ktx: String = "1.1.0"
|
||||
|
||||
const val threetenabp: String = "1.1.1" // available: "1.2.1"
|
||||
|
||||
const val uiautomator: String = "2.2.0"
|
||||
|
||||
const val annotation: String = "1.0.0" // available: "1.1.0"
|
||||
|
||||
const val org_jacoco: String = "0.7.9"
|
||||
|
||||
const val simple_xml: String = "2.7.1"
|
||||
|
||||
const val appcompat: String = "1.0.2" // available: "1.1.0"
|
||||
|
||||
const val rxandroid: String = "2.1.0" // available: "2.1.1"
|
||||
|
||||
const val cardview: String = "1.0.0"
|
||||
|
||||
const val core_ktx: String = "1.0.2" // available: "1.1.0"
|
||||
|
||||
const val io_mockk: String = "1.9" // available: "1.9.3"
|
||||
|
||||
const val kiwixlib: String = "8.1.0"
|
||||
|
||||
const val material: String = "1.0.0"
|
||||
|
||||
const val barista: String = "2.7.1" // available: "3.2.0"
|
||||
|
||||
const val xfetch2: String = "3.1.4"
|
||||
|
||||
const val jsr305: String = "3.0.2"
|
||||
|
||||
const val okhttp: String = "3.12.1" // available: "4.2.0"
|
||||
|
||||
const val rxjava: String = "2.2.5" // available: "2.2.12"
|
||||
|
||||
const val aapt2: String = "3.5.0-5435860"
|
||||
|
||||
const val junit: String = "1.1.1"
|
||||
|
||||
/**
|
||||
* Current version: "5.6.1"
|
||||
* See issue 19: How to update Gradle itself?
|
||||
* https://github.com/jmfayard/buildSrcVersions/issues/19
|
||||
*/
|
||||
const val gradleLatestVersion: String = "5.6.2"
|
||||
}
|
||||
|
||||
/**
|
||||
* See issue #47: how to update buildSrcVersions itself
|
||||
* https://github.com/jmfayard/buildSrcVersions/issues/47
|
||||
*/
|
||||
val PluginDependenciesSpec.buildSrcVersions: PluginDependencySpec
|
||||
inline get() =
|
||||
id("de.fayard.buildSrcVersions").version(Versions.de_fayard_buildsrcversions_gradle_plugin)
|
@ -6,13 +6,11 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "com.android.tools.build:gradle:$androidGradlePluginVersion"
|
||||
classpath "org.apache.httpcomponents:httpclient-android:4.3.3"
|
||||
classpath "com.testdroid:testdroid-api:2.71"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
||||
classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion"
|
||||
classpath "org.jlleitschuh.gradle:ktlint-gradle:8.2.0"
|
||||
classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.0'
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,6 +64,34 @@ android {
|
||||
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 {
|
||||
@ -87,49 +113,49 @@ private boolean shouldUseLocalVersion() {
|
||||
dependencies {
|
||||
|
||||
// use jdk8 java.time backport, as long app < Build.VERSION_CODES.O
|
||||
implementation("com.jakewharton.threetenabp:threetenabp:1.1.1")
|
||||
implementation(Libs.threetenabp)
|
||||
|
||||
// Get kiwixlib online if it is not populated locally
|
||||
if (!shouldUseLocalVersion()) {
|
||||
implementation 'org.kiwix.kiwixlib:kiwixlib:8.1.0'
|
||||
implementation(Libs.kiwixlib)
|
||||
} else {
|
||||
implementation 'com.getkeepsafe.relinker:relinker:1.3.1'
|
||||
implementation fileTree(include: ['*.aar'], dir: 'libs')
|
||||
}
|
||||
|
||||
// Android Support
|
||||
implementation "androidx.appcompat:appcompat:$appCompatVersion"
|
||||
implementation "com.google.android.material:material:$materialVersion"
|
||||
implementation "androidx.cardview:cardview:$cardViewVersion"
|
||||
implementation "androidx.multidex:multidex:$multidexVersion"
|
||||
implementation "androidx.constraintlayout:constraintlayout:$constraintLayoutVersion"
|
||||
implementation "androidx.core:core-ktx:1.0.2"
|
||||
implementation "androidx.fragment:fragment-ktx:1.0.0"
|
||||
implementation "androidx.collection:collection-ktx:1.1.0"
|
||||
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 "com.pacioianu.david:ink-page-indicator:$inkPageIndicatorVersion"
|
||||
implementation(Libs.ink_page_indicator)
|
||||
|
||||
// Dagger
|
||||
compileOnly "javax.annotation:javax.annotation-api:$javaxAnnotationVersion"
|
||||
compileOnly(Libs.javax_annotation_api)
|
||||
|
||||
implementation "com.google.dagger:dagger:$daggerVersion"
|
||||
implementation "com.google.dagger:dagger-android:$daggerVersion"
|
||||
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
|
||||
kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
|
||||
implementation(Libs.dagger)
|
||||
implementation(Libs.dagger_android)
|
||||
kapt(Libs.dagger_compiler)
|
||||
kapt(Libs.dagger_android_processor)
|
||||
|
||||
|
||||
// SquiDB
|
||||
implementation 'com.yahoo.squidb:squidb:2.0.0'
|
||||
implementation 'com.yahoo.squidb:squidb-annotations:2.0.0'
|
||||
kapt 'com.yahoo.squidb:squidb-processor:2.0.0'
|
||||
implementation(Libs.squidb)
|
||||
implementation(Libs.squidb_annotations)
|
||||
kapt(Libs.squidb_processor)
|
||||
|
||||
// Square
|
||||
implementation "com.squareup.okhttp3:okhttp:$okHttpVersion"
|
||||
implementation "com.squareup.okhttp3:logging-interceptor:$okHttpVersion"
|
||||
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
|
||||
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"
|
||||
implementation("com.squareup.retrofit2:converter-simplexml:$retrofitVersion") {
|
||||
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"
|
||||
@ -137,28 +163,27 @@ dependencies {
|
||||
|
||||
|
||||
// ButterKnife
|
||||
implementation "com.jakewharton:butterknife:$butterKnifeVersion"
|
||||
kapt "com.jakewharton:butterknife-compiler:$butterKnifeVersion"
|
||||
implementation(Libs.butterknife)
|
||||
kapt(Libs.butterknife_compiler)
|
||||
|
||||
// RxJava
|
||||
implementation "io.reactivex.rxjava2:rxandroid:$rxAndroidVersion"
|
||||
implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion"
|
||||
implementation(Libs.rxandroid)
|
||||
implementation(Libs.rxjava)
|
||||
|
||||
// Leak canary
|
||||
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-alpha-2'
|
||||
debugImplementation(Libs.leakcanary_android)
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
|
||||
implementation "android.arch.lifecycle:extensions:1.1.1"
|
||||
implementation "io.objectbox:objectbox-kotlin:$objectboxVersion"
|
||||
implementation "io.objectbox:objectbox-rxjava:$objectboxVersion"
|
||||
implementation 'com.google.android.gms:play-services-location:17.0.0'
|
||||
implementation(Libs.kotlin_stdlib_jdk7)
|
||||
implementation(Libs.android_arch_lifecycle_extensions)
|
||||
implementation(Libs.objectbox_kotlin)
|
||||
implementation(Libs.objectbox_rxjava)
|
||||
|
||||
implementation "androidx.tonyodev.fetch2:xfetch2:$fetchVersion"
|
||||
implementation "androidx.tonyodev.fetch2okhttp:xfetch2okhttp:$fetchVersion"
|
||||
implementation(Libs.xfetch2)
|
||||
implementation(Libs.xfetch2okhttp)
|
||||
|
||||
testImplementation "org.junit.jupiter:junit-jupiter:5.4.2"
|
||||
testImplementation "io.mockk:mockk:1.9"
|
||||
testImplementation "org.assertj:assertj-core:3.11.1"
|
||||
testImplementation 'com.jraska.livedata:testing-ktx:1.1.0'
|
||||
testImplementation 'androidx.arch.core:core-testing:2.0.1'
|
||||
testImplementation(Libs.junit_jupiter)
|
||||
testImplementation(Libs.mockk)
|
||||
testImplementation(Libs.assertj_core)
|
||||
testImplementation(Libs.testing_ktx)
|
||||
testImplementation(Libs.core_testing)
|
||||
}
|
||||
|
7846
core/lint-baseline.xml
Normal file
7846
core/lint-baseline.xml
Normal file
File diff suppressed because it is too large
Load Diff
@ -30,7 +30,6 @@ import org.kiwix.kiwixlib.JNIKiwixInt
|
||||
import org.kiwix.kiwixlib.JNIKiwixReader
|
||||
import org.kiwix.kiwixlib.JNIKiwixString
|
||||
import org.kiwix.kiwixlib.Pair
|
||||
import org.kiwix.kiwixmobile.core.BuildConfig
|
||||
import org.kiwix.kiwixmobile.KiwixApplication
|
||||
import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book
|
||||
import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil
|
||||
@ -220,7 +219,8 @@ class ZimFileReader(
|
||||
@JvmField
|
||||
val UI_URI: Uri? = Uri.parse("content://org.kiwix.ui/")
|
||||
@JvmField
|
||||
val CONTENT_URI: Uri? = Uri.parse("content://${KiwixApplication.getInstance().packageName}.zim.base/")
|
||||
val CONTENT_URI: Uri? =
|
||||
Uri.parse("content://${KiwixApplication.getInstance().packageName}.zim.base/")
|
||||
private const val INVERT_IMAGES_VIDEO =
|
||||
"img, video { \n -webkit-filter: invert(1); \n filter: invert(1); \n} \n"
|
||||
private val VIDEO_REGEX = Regex("([^\\s]+(\\.(?i)(3gp|mp4|m4a|webm|mkv|ogg|ogv))\$)")
|
||||
|
@ -5,8 +5,6 @@ import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import androidx.core.content.FileProvider
|
||||
import org.kiwix.kiwixmobile.KiwixApplication
|
||||
import org.kiwix.kiwixmobile.core.BuildConfig
|
||||
import org.kiwix.kiwixmobile.core.R
|
||||
import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk
|
||||
|
||||
|
@ -39,7 +39,7 @@ import org.kiwix.kiwixmobile.language.viewmodel.State.Content
|
||||
import org.kiwix.kiwixmobile.language.viewmodel.State.Loading
|
||||
import org.kiwix.kiwixmobile.language.viewmodel.State.Saving
|
||||
import org.kiwix.kiwixmobile.languageItem
|
||||
import org.kiwix.kiwixmobile.core.ResetSchedulers
|
||||
import org.kiwix.kiwixmobile.resetSchedulers
|
||||
import org.kiwix.kiwixmobile.setScheduler
|
||||
import org.kiwix.kiwixmobile.zim_manager.Language
|
||||
|
||||
|
@ -24,7 +24,7 @@ import io.mockk.verify
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.kiwix.kiwixmobile.database.newdb.dao.NewLanguagesDao
|
||||
import org.kiwix.kiwixmobile.core.ResetSchedulers
|
||||
import org.kiwix.kiwixmobile.resetSchedulers
|
||||
import org.kiwix.kiwixmobile.setScheduler
|
||||
import org.kiwix.kiwixmobile.zim_manager.Language
|
||||
|
||||
|
@ -35,7 +35,7 @@ import org.junit.jupiter.api.AfterAll
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
import org.junit.jupiter.api.Nested
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.kiwix.kiwixmobile.core.ResetSchedulers
|
||||
import org.kiwix.kiwixmobile.resetSchedulers
|
||||
import org.kiwix.kiwixmobile.setScheduler
|
||||
import java.io.File
|
||||
|
||||
|
@ -48,7 +48,7 @@ import org.kiwix.kiwixmobile.downloader.model.DownloadModel
|
||||
import org.kiwix.kiwixmobile.language
|
||||
import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity.Book
|
||||
import org.kiwix.kiwixmobile.libraryNetworkEntity
|
||||
import org.kiwix.kiwixmobile.core.ResetSchedulers
|
||||
import org.kiwix.kiwixmobile.resetSchedulers
|
||||
import org.kiwix.kiwixmobile.setScheduler
|
||||
import org.kiwix.kiwixmobile.utils.BookUtils
|
||||
import org.kiwix.kiwixmobile.zim_manager.Fat32Checker.FileSystemState
|
||||
|
@ -30,7 +30,7 @@ import org.kiwix.kiwixmobile.book
|
||||
import org.kiwix.kiwixmobile.bookOnDisk
|
||||
import org.kiwix.kiwixmobile.database.newdb.dao.FetchDownloadDao
|
||||
import org.kiwix.kiwixmobile.downloader.model.DownloadModel
|
||||
import org.kiwix.kiwixmobile.core.ResetSchedulers
|
||||
import org.kiwix.kiwixmobile.resetSchedulers
|
||||
import org.kiwix.kiwixmobile.setScheduler
|
||||
import org.kiwix.kiwixmobile.utils.SharedPreferenceUtil
|
||||
import org.kiwix.kiwixmobile.utils.files.FileSearch
|
||||
|
@ -143,8 +143,29 @@ android {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
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")
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(':core')
|
||||
implementation(Libs.appcompat)
|
||||
}
|
||||
|
188
custom/lint-baseline.xml
Normal file
188
custom/lint-baseline.xml
Normal file
@ -0,0 +1,188 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<issues format="5" by="lint 3.5.0" client="gradle" variant="all" version="3.5.0">
|
||||
|
||||
<issue
|
||||
id="ObsoleteLintCustomCheck"
|
||||
message="Lint found one or more custom checks that could not be loaded. The most likely reason for this is that it is using an older, incompatible or unsupported API in lint. Make sure these lint checks are updated to the new APIs. The issue registry class is com.lint.CustomIssueRegistry. The class loading issue is com/android/tools/lint/detector/api/Detector$JavaPsiScanner: ClassLoader.defineClass1(ClassLoader.java:-2)←ClassLoader.defineClass(ClassLoader.java:763)←ClassLoader.defineClass(ClassLoader.java:642)←UrlClassLoader._defineClass(UrlClassLoader.java:306)←UrlClassLoader.defineClass(UrlClassLoader.java:302)←UrlClassLoader._findClass(UrlClassLoader.java:271)←UrlClassLoader.findClass(UrlClassLoader.java:254)←ClassLoader.loadClass(ClassLoader.java:424)">
|
||||
<location
|
||||
file="..\..\..\.android\lint\customlint.jar"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="OldTargetApi"
|
||||
message="Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details."
|
||||
errorLine1=" targetSdkVersion 28"
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="build.gradle"
|
||||
line="36"
|
||||
column="5"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="UnusedAttribute"
|
||||
message="Attribute `networkSecurityConfig` is only used in API level 24 and higher (current min is 15)"
|
||||
errorLine1=" android:networkSecurityConfig="@xml/network_security_config""
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src\main\AndroidManifest.xml"
|
||||
line="25"
|
||||
column="5"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="ExportedContentProvider"
|
||||
message="Exported content providers can provide access to potentially sensitive data"
|
||||
errorLine1=" <provider"
|
||||
errorLine2=" ~~~~~~~~">
|
||||
<location
|
||||
file="src\main\AndroidManifest.xml"
|
||||
line="168"
|
||||
column="6"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="AllowBackup"
|
||||
message="On SDK version 23 and up, your app data will be automatically backed up and restored on app install. Consider adding the attribute `android:fullBackupContent` to specify an `@xml` resource which configures which files to backup. More info: https://developer.android.com/training/backup/autosyncapi.html"
|
||||
errorLine1=" <application"
|
||||
errorLine2=" ~~~~~~~~~~~">
|
||||
<location
|
||||
file="src\main\AndroidManifest.xml"
|
||||
line="19"
|
||||
column="4"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="UnpackedNativeCode"
|
||||
message="Missing attribute android:extractNativeLibs="false" on the `<application>` tag."
|
||||
errorLine1=" <application"
|
||||
errorLine2=" ^">
|
||||
<location
|
||||
file="src\main\AndroidManifest.xml"
|
||||
line="19"
|
||||
column="3"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="UnusedResources"
|
||||
message="The resource `R.drawable.ic_kiwix_widget` appears to be unused">
|
||||
<location
|
||||
file="src\customexample\res\drawable-hdpi\ic_kiwix_widget.png"/>
|
||||
<location
|
||||
file="src\customexample\res\drawable-mdpi\ic_kiwix_widget.png"/>
|
||||
<location
|
||||
file="src\customexample\res\drawable-xhdpi\ic_kiwix_widget.png"/>
|
||||
<location
|
||||
file="src\customexample\res\drawable-xxhdpi\ic_kiwix_widget.png"/>
|
||||
<location
|
||||
file="src\customexample\res\drawable-xxxhdpi\ic_kiwix_widget.png"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="UnusedResources"
|
||||
message="The resource `R.drawable.kiwix_icon_with_title` appears to be unused">
|
||||
<location
|
||||
file="src\customexample\res\drawable\kiwix_icon_with_title.png"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="UnusedResources"
|
||||
message="The resource `R.string.customapp_missing_content` appears to be unused"
|
||||
errorLine1=" <string name="customapp_missing_content">Ray Charles</string>"
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src\customexample\res\values\strings.xml"
|
||||
line="3"
|
||||
column="11"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="IconDipSize"
|
||||
message="The image `ic_kiwix_widget.png` varies significantly in its density-independent (dip) size across the various density versions: drawable-hdpi\\ic_kiwix_widget.png: 48x48 dp (72x72 px), drawable-mdpi\\ic_kiwix_widget.png: 72x72 dp (72x72 px), drawable-xhdpi\\ic_kiwix_widget.png: 48x48 dp (96x96 px), drawable-xxhdpi\\ic_kiwix_widget.png: 48x48 dp (144x144 px), drawable-xxxhdpi\\ic_kiwix_widget.png: 48x48 dp (192x192 px)">
|
||||
<location
|
||||
file="src\customexample\res\drawable-hdpi\ic_kiwix_widget.png"/>
|
||||
<location
|
||||
file="src\customexample\res\drawable-xhdpi\ic_kiwix_widget.png"/>
|
||||
<location
|
||||
file="src\customexample\res\drawable-xxxhdpi\ic_kiwix_widget.png"/>
|
||||
<location
|
||||
file="src\customexample\res\drawable-xxhdpi\ic_kiwix_widget.png"/>
|
||||
<location
|
||||
file="src\customexample\res\drawable-mdpi\ic_kiwix_widget.png"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="IconDipSize"
|
||||
message="The image `kiwix_icon.png` varies significantly in its density-independent (dip) size across the various density versions: mipmap-hdpi\\kiwix_icon.png: 48x48 dp (72x72 px), mipmap-mdpi\\kiwix_icon.png: 72x72 dp (72x72 px), mipmap-xhdpi\\kiwix_icon.png: 48x48 dp (96x96 px), mipmap-xxhdpi\\kiwix_icon.png: 48x48 dp (144x144 px), mipmap-xxxhdpi\\kiwix_icon.png: 48x48 dp (192x192 px)">
|
||||
<location
|
||||
file="src\customexample\res\mipmap-xxhdpi\kiwix_icon.png"/>
|
||||
<location
|
||||
file="src\customexample\res\mipmap-xhdpi\kiwix_icon.png"/>
|
||||
<location
|
||||
file="src\customexample\res\mipmap-xxxhdpi\kiwix_icon.png"/>
|
||||
<location
|
||||
file="src\customexample\res\mipmap-hdpi\kiwix_icon.png"/>
|
||||
<location
|
||||
file="src\customexample\res\mipmap-mdpi\kiwix_icon.png"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="IconExpectedSize"
|
||||
message="Incorrect icon size for `mipmap-mdpi\\kiwix_icon.png`: expected 48x48, but was 72x72">
|
||||
<location
|
||||
file="src\customexample\res\mipmap-mdpi\kiwix_icon.png"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="IconLocation"
|
||||
message="Found bitmap drawable `res/drawable/kiwix_icon_with_title.png` in densityless folder">
|
||||
<location
|
||||
file="src\customexample\res\drawable\kiwix_icon_with_title.png"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="IconDuplicates"
|
||||
message="The following unrelated icon files have identical contents: ic_kiwix_widget.png, kiwix_icon.png">
|
||||
<location
|
||||
file="src\customexample\res\mipmap-hdpi\kiwix_icon.png"/>
|
||||
<location
|
||||
file="src\customexample\res\drawable-hdpi\ic_kiwix_widget.png"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="IconDuplicates"
|
||||
message="The following unrelated icon files have identical contents: ic_kiwix_widget.png, kiwix_icon.png">
|
||||
<location
|
||||
file="src\customexample\res\mipmap-mdpi\kiwix_icon.png"/>
|
||||
<location
|
||||
file="src\customexample\res\drawable-mdpi\ic_kiwix_widget.png"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="IconDuplicates"
|
||||
message="The following unrelated icon files have identical contents: ic_kiwix_widget.png, kiwix_icon.png">
|
||||
<location
|
||||
file="src\customexample\res\mipmap-xhdpi\kiwix_icon.png"/>
|
||||
<location
|
||||
file="src\customexample\res\drawable-xhdpi\ic_kiwix_widget.png"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="IconDuplicates"
|
||||
message="The following unrelated icon files have identical contents: ic_kiwix_widget.png, kiwix_icon.png">
|
||||
<location
|
||||
file="src\customexample\res\mipmap-xxhdpi\kiwix_icon.png"/>
|
||||
<location
|
||||
file="src\customexample\res\drawable-xxhdpi\ic_kiwix_widget.png"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="IconDuplicates"
|
||||
message="The following unrelated icon files have identical contents: ic_kiwix_widget.png, kiwix_icon.png">
|
||||
<location
|
||||
file="src\customexample\res\mipmap-xxxhdpi\kiwix_icon.png"/>
|
||||
<location
|
||||
file="src\customexample\res\drawable-xxxhdpi\ic_kiwix_widget.png"/>
|
||||
</issue>
|
||||
|
||||
</issues>
|
@ -1,24 +0,0 @@
|
||||
package org.kiwix.kiwixmobile.custom
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("org.kiwix.kiwixmobile.custom", appContext.packageName)
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package org.kiwix.kiwixmobile.custom
|
||||
|
||||
import org.junit.Test
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
class ExampleUnitTest {
|
||||
@Test
|
||||
fun addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2)
|
||||
}
|
||||
}
|
@ -24,3 +24,7 @@ task installGitHooks(type: Exec) {
|
||||
logger.info('Git hook installed successfully.')
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
tasks['preBuild'].dependsOn installGitHooks
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
echo "Running lint..."
|
||||
|
||||
./gradlew app:ktlintKiwixDebugCheck app:lintKiwixDebug --daemon
|
||||
./gradlew ktlintCheck lint --daemon
|
||||
|
||||
status=$?
|
||||
|
||||
@ -10,7 +10,7 @@ if [ "$status" = 0 ] ; then
|
||||
echo "Static analysis found no problems."
|
||||
exit 0
|
||||
else
|
||||
./gradlew app:ktlintKiwixDebugFormat --daemon
|
||||
./gradlew ktlintFormat --daemon
|
||||
echo 1>&2 "Static analysis found violations and attempted to autofix, please commit these autoformat changes"
|
||||
echo "If the build failed for another reason please make sure JAVA_HOME is set to JDK8"
|
||||
exit 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user