From 7d5fa5a603765326b55293c59849f05eaeca9282 Mon Sep 17 00:00:00 2001 From: Carlos <2092019+CarlosEsco@users.noreply.github.com> Date: Sat, 30 May 2020 20:30:53 -0400 Subject: [PATCH] remove shortcuts.xml plugin since shortcuts arent used anymore (#463) updated gradle to 6.1.1 update android gradle to 4.0 add buildSrc to use kotlin for versions didnt convert them all --- app/build.gradle.kts | 132 ++++++++++------------- app/shortcuts.xml | 39 ------- app/src/main/AndroidManifest.xml | 2 - build.gradle.kts | 4 +- buildSrc/.gitignore | 1 + buildSrc/build.gradle.kts | 6 ++ buildSrc/src/main/kotlin/Dependencies.kt | 34 ++++++ gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 24 ++--- 9 files changed, 113 insertions(+), 131 deletions(-) delete mode 100644 app/shortcuts.xml create mode 100644 buildSrc/.gitignore create mode 100644 buildSrc/build.gradle.kts create mode 100644 buildSrc/src/main/kotlin/Dependencies.kt diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 684edb6998..1f5f7f240d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -4,14 +4,13 @@ import java.time.ZoneOffset import java.time.format.DateTimeFormatter plugins { - id("com.android.application") - id("com.google.android.gms.oss-licenses-plugin") - kotlin("android") - kotlin("android.extensions") - kotlin("kapt") - id("org.jmailen.kotlinter") version "2.3.1" - id("com.github.zellius.shortcut-helper") - id("com.google.gms.google-services") apply false + id("com.android.application") version BuildPluginsVersion.AGP + id("com.google.android.gms.oss-licenses-plugin") version BuildPluginsVersion.OSS_LICENSE + kotlin("android") version BuildPluginsVersion.KOTLIN + kotlin("android.extensions") version BuildPluginsVersion.KOTLIN + kotlin("kapt") version BuildPluginsVersion.KOTLIN + id("com.google.gms.google-services") version BuildPluginsVersion.GOOGLE_SERVICES apply false + id("org.jmailen.kotlinter") version BuildPluginsVersion.KOTLINTER } fun getBuildTime() = DateTimeFormatter.ISO_DATE_TIME.format(LocalDateTime.now(ZoneOffset.UTC)) @@ -28,15 +27,15 @@ fun runCommand(command: String): String { } android { - compileSdkVersion(29) - buildToolsVersion("29.0.3") + compileSdkVersion(AndroidVersions.COMPILE_SDK) + buildToolsVersion(AndroidVersions.BUILD_TOOL) defaultConfig { - minSdkVersion(23) - targetSdkVersion(29) + minSdkVersion(AndroidVersions.MIN_SDK) + targetSdkVersion(AndroidVersions.TARGET_SDK) applicationId = "eu.kanade.tachiyomi" - versionCode = 66 - versionName = "1.0.7" + versionCode = AndroidVersions.VERSION_CODE + versionName = AndroidVersions.VERSION_NAME testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" multiDexEnabled = true @@ -45,7 +44,6 @@ android { buildConfigField("String", "BUILD_TIME", "\"${getBuildTime()}\"") buildConfigField("Boolean", "INCLUDE_UPDATER", "false") - ndk { abiFilters("armeabi-v7a", "arm64-v8a", "x86") } @@ -87,10 +85,6 @@ androidExtensions { isExperimental = true } -shortcutHelper { - setFilePath("./shortcuts.xml") -} - dependencies { // Modified dependencies implementation("com.github.inorichi:subsampling-scale-image-view:ac0dae7") @@ -107,7 +101,6 @@ dependencies { implementation("androidx.biometric:biometric:1.0.1") implementation("androidx.palette:palette:1.0.0") - implementation("androidx.constraintlayout:constraintlayout:1.1.3") implementation("androidx.multidex:multidex:2.0.1") @@ -119,7 +112,6 @@ dependencies { implementation("androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion") implementation("androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion") - // ReactiveX implementation("io.reactivex:rxandroid:1.2.1") implementation("io.reactivex:rxjava:1.3.8") @@ -131,35 +123,32 @@ dependencies { implementation("com.github.tfcporciuncula:flow-preferences:1.1.1") // Network client - val okhttpVersion = "4.5.0" - implementation("com.squareup.okhttp3:okhttp:$okhttpVersion") - implementation("com.squareup.okhttp3:logging-interceptor:$okhttpVersion") + implementation("com.squareup.okhttp3:okhttp:${Versions.OKHTTP}") + implementation("com.squareup.okhttp3:logging-interceptor:${Versions.OKHTTP}") implementation("com.squareup.okio:okio:2.6.0") - //Chucker + // Chucker val chuckerVersion = "3.2.0" - debugImplementation ("com.github.ChuckerTeam.Chucker:library:$chuckerVersion") - releaseImplementation ("com.github.ChuckerTeam.Chucker:library-no-op:$chuckerVersion") + debugImplementation("com.github.ChuckerTeam.Chucker:library:${Versions.CHUCKER}") + releaseImplementation("com.github.ChuckerTeam.Chucker:library-no-op:${Versions.CHUCKER}") - //hyperion - val hyperionVersion = "0.9.27" - debugImplementation("com.willowtreeapps.hyperion:hyperion-core:$hyperionVersion") - debugImplementation("com.willowtreeapps.hyperion:hyperion-timber:$hyperionVersion") - debugImplementation("com.willowtreeapps.hyperion:hyperion-core:$hyperionVersion") - debugImplementation("com.willowtreeapps.hyperion:hyperion-attr:$hyperionVersion") - debugImplementation("com.willowtreeapps.hyperion:hyperion-build-config:$hyperionVersion") - debugImplementation("com.willowtreeapps.hyperion:hyperion-crash:$hyperionVersion") - debugImplementation("com.willowtreeapps.hyperion:hyperion-disk:$hyperionVersion") - debugImplementation("com.willowtreeapps.hyperion:hyperion-geiger-counter:$hyperionVersion") - debugImplementation("com.willowtreeapps.hyperion:hyperion-measurement:$hyperionVersion") - debugImplementation("com.willowtreeapps.hyperion:hyperion-phoenix:$hyperionVersion") - debugImplementation("com.willowtreeapps.hyperion:hyperion-recorder:$hyperionVersion") - debugImplementation("com.willowtreeapps.hyperion:hyperion-shared-preferences:$hyperionVersion") + // hyperion + debugImplementation("com.willowtreeapps.hyperion:hyperion-core:${Versions.HYPERION}") + debugImplementation("com.willowtreeapps.hyperion:hyperion-timber:${Versions.HYPERION}") + debugImplementation("com.willowtreeapps.hyperion:hyperion-core:${Versions.HYPERION}") + debugImplementation("com.willowtreeapps.hyperion:hyperion-attr:${Versions.HYPERION}") + debugImplementation("com.willowtreeapps.hyperion:hyperion-build-config:${Versions.HYPERION}") + debugImplementation("com.willowtreeapps.hyperion:hyperion-crash:${Versions.HYPERION}") + debugImplementation("com.willowtreeapps.hyperion:hyperion-disk:${Versions.HYPERION}") + debugImplementation("com.willowtreeapps.hyperion:hyperion-geiger-counter:${Versions.HYPERION}") + debugImplementation("com.willowtreeapps.hyperion:hyperion-measurement:${Versions.HYPERION}") + debugImplementation("com.willowtreeapps.hyperion:hyperion-phoenix:${Versions.HYPERION}") + debugImplementation("com.willowtreeapps.hyperion:hyperion-recorder:${Versions.HYPERION}") + debugImplementation("com.willowtreeapps.hyperion:hyperion-shared-preferences:${Versions.HYPERION}") // REST - val retrofitVersion = "2.7.2" - implementation("com.squareup.retrofit2:retrofit:$retrofitVersion") - implementation("com.squareup.retrofit2:converter-gson:$retrofitVersion") + implementation("com.squareup.retrofit2:retrofit:${Versions.RETROFIT}") + implementation("com.squareup.retrofit2:converter-gson:${Versions.RETROFIT}") // JSON implementation("com.google.code.gson:gson:2.8.6") @@ -176,9 +165,8 @@ dependencies { implementation("org.jsoup:jsoup:1.13.1") // Job scheduling - val workManagerVersion = "2.3.3" - implementation("android.arch.work:work-runtime:$workManagerVersion") - implementation("android.arch.work:work-runtime-ktx:$workManagerVersion") + implementation("android.arch.work:work-runtime:${Versions.WORKMANAGER}") + implementation("android.arch.work:work-runtime-ktx:${Versions.WORKMANAGER}") implementation("com.google.android.gms:play-services-gcm:17.0.0") // Changelog @@ -191,28 +179,26 @@ dependencies { implementation("io.requery:sqlite-android:3.31.0") // Model View Presenter - val nucleusVersion = "3.0.0" - implementation("info.android15.nucleus:nucleus:$nucleusVersion") - implementation("info.android15.nucleus:nucleus-support-v7:$nucleusVersion") + implementation("info.android15.nucleus:nucleus:${Versions.NUCLEUS}") + implementation("info.android15.nucleus:nucleus-support-v7:${Versions.NUCLEUS}") // Dependency injection implementation("com.github.inorichi.injekt:injekt-core:65b0440") // Image library val coilVersion = "0.10.1" - implementation("io.coil-kt:coil:$coilVersion") - implementation("io.coil-kt:coil-gif:$coilVersion") - implementation("io.coil-kt:coil-svg:$coilVersion") + implementation("io.coil-kt:coil:${Versions.COIL}") + implementation("io.coil-kt:coil-gif:${Versions.COIL}") + implementation("io.coil-kt:coil-svg:${Versions.COIL}") // Logging - implementation("com.jakewharton.timber:timber:4.7.1") + implementation("com.jakewharton.timber:timber:${Versions.TIMBER}") // UI implementation("com.dmitrymalkovich.android:material-design-dimens:1.4") implementation("com.github.dmytrodanylyk.android-process-button:library:1.0.4") - val latestFastAdapterRelease = "5.0.0" - implementation("com.mikepenz:fastadapter:${latestFastAdapterRelease}") - implementation("com.mikepenz:fastadapter-extensions-binding:${latestFastAdapterRelease}") + implementation("com.mikepenz:fastadapter:${Versions.FASTADAPTER}") + implementation("com.mikepenz:fastadapter-extensions-binding:${Versions.FASTADAPTER}") implementation("eu.davidea:flexible-adapter:5.1.0") implementation("eu.davidea:flexible-adapter-ui:1.0.0") implementation("com.nononsenseapps:filepicker:2.5.2") @@ -236,39 +222,35 @@ dependencies { implementation("com.github.inorichi:conductor-support-preference:a32c357") // RxBindings - val rxbindingsVersion = "1.0.1" - implementation("com.jakewharton.rxbinding:rxbinding-kotlin:$rxbindingsVersion") - implementation("com.jakewharton.rxbinding:rxbinding-appcompat-v7-kotlin:$rxbindingsVersion") - implementation("com.jakewharton.rxbinding:rxbinding-support-v4-kotlin:$rxbindingsVersion") - implementation("com.jakewharton.rxbinding:rxbinding-recyclerview-v7-kotlin:$rxbindingsVersion") + implementation("com.jakewharton.rxbinding:rxbinding-kotlin:${Versions.RX_BINDING}") + implementation("com.jakewharton.rxbinding:rxbinding-appcompat-v7-kotlin:${Versions.RX_BINDING}") + implementation("com.jakewharton.rxbinding:rxbinding-support-v4-kotlin:${Versions.RX_BINDING}") + implementation("com.jakewharton.rxbinding:rxbinding-recyclerview-v7-kotlin:${Versions.RX_BINDING}") // Tests testImplementation("junit:junit:4.13") testImplementation("org.assertj:assertj-core:3.12.2") testImplementation("org.mockito:mockito-core:1.10.19") - val robolectricVersion = "3.1.4" - testImplementation("org.robolectric:robolectric:$robolectricVersion") - testImplementation("org.robolectric:shadows-multidex:$robolectricVersion") - testImplementation("org.robolectric:shadows-play-services:$robolectricVersion") - + testImplementation("org.robolectric:robolectric:${Versions.ROBO_ELECTRIC}") + testImplementation("org.robolectric:shadows-multidex:${Versions.ROBO_ELECTRIC}") + testImplementation("org.robolectric:shadows-play-services:${Versions.ROBO_ELECTRIC}") implementation(kotlin("stdlib", org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION)) - val coroutinesVersion = "1.3.5" - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.COROUTINES}") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.COROUTINES}") - //Crash reports - val acraVersion = "4.9.2" - implementation("ch.acra:acra:$acraVersion") + // Crash reports + implementation("ch.acra:acra:${Versions.ACRA}") // Text distance implementation("info.debatty:java-string-similarity:1.2.1") - implementation("com.google.android.gms:play-services-oss-licenses:17.0.0") + implementation("com.google.android.gms:play-services-oss-licenses:${Versions.OSS_LICENSE}") } + tasks.preBuild { dependsOn(tasks.lintKotlin) } @@ -278,4 +260,4 @@ tasks.lintKotlin { if (gradle.startParameter.taskRequests.toString().contains("Standard")) { apply(mapOf("plugin" to "com.google.gms.google-services")) -} \ No newline at end of file +} diff --git a/app/shortcuts.xml b/app/shortcuts.xml deleted file mode 100644 index f831c257ed..0000000000 --- a/app/shortcuts.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6018bb9638..f44415d819 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -39,8 +39,6 @@ - -