0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 03:52:15 +02:00
Anki-Android/AnkiDroid/build.gradle

456 lines
19 KiB
Groovy
Raw Normal View History

2019-02-17 16:53:25 +01:00
plugins {
// Gradle plugin portal
alias(libs.plugins.tripletPlay)
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.keeper)
id 'idea'
2019-02-17 16:53:25 +01:00
}
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
keeper {
traceReferences {
// Silence missing definitions
arguments.set(["--map-diagnostics:MissingDefinitionsDiagnostic", "error", "none"])
}
}
idea {
module {
downloadJavadoc = System.getenv("CI") != "true"
downloadSources = System.getenv("CI") != "true"
}
}
def homePath = System.properties['user.home']
/**
* @return the current git hash
* @example edf739d95bad7b370a6ed4398d46723f8219b3cd
*/
static def gitCommitHash() {
"git rev-parse HEAD".execute().text.trim()
}
android {
2023-04-30 08:43:32 +02:00
namespace "com.ichi2.anki"
compileSdk libs.versions.compileSdk.get().toInteger()
Dependency updates 20230630 (#14058) * Bump com.squareup.leakcanary:leakcanary-android from 2.11 to 2.12 Bumps [com.squareup.leakcanary:leakcanary-android](https://github.com/square/leakcanary) from 2.11 to 2.12. - [Release notes](https://github.com/square/leakcanary/releases) - [Changelog](https://github.com/square/leakcanary/blob/main/docs/changelog.md) - [Commits](https://github.com/square/leakcanary/compare/v2.11...v2.12) --- updated-dependencies: - dependency-name: com.squareup.leakcanary:leakcanary-android dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump org.jetbrains.kotlinx:kotlinx-coroutines-test from 1.7.1 to 1.7.2 Bumps [org.jetbrains.kotlinx:kotlinx-coroutines-test](https://github.com/Kotlin/kotlinx.coroutines) from 1.7.1 to 1.7.2. - [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases) - [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md) - [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.7.1...1.7.2) --- updated-dependencies: - dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-test dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump com.github.triplet.play from 3.8.3 to 3.8.4 Bumps com.github.triplet.play from 3.8.3 to 3.8.4. --- updated-dependencies: - dependency-name: com.github.triplet.play dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump com.android.tools.build:gradle from 7.4.2 to 8.0.2 (#13912) * Bump com.android.tools.build:gradle from 7.4.2 to 8.0.2 Bumps com.android.tools.build:gradle from 7.4.2 to 8.0.2. --- updated-dependencies: - dependency-name: com.android.tools.build:gradle dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): forward-port BuildConfig / aidl / default-component to gradle 8 * convert to non-transitive R.attr style - directly address the attributes via their specific names - remove an R-containing IntDef since R is no longer constant (the whole UndoAction class will disappear with new backend anyway) * Use attrs directly from `android` Practically, it is a non-functional change, but is is best and more natural to use attrs directly from android instead of using `com.google.android.material` as a intermediate --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mike Hardy <github@mikehardy.net> Co-authored-by: Brayan Oliveira <69634269+brayandso@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brayan Oliveira <69634269+brayandso@users.noreply.github.com>
2023-07-01 17:09:10 +02:00
buildFeatures {
buildConfig = true
aidl = true
}
if (rootProject.testReleaseBuild) {
testBuildType "release"
} else {
testBuildType "debug"
}
defaultConfig {
applicationId "com.ichi2.anki"
buildConfigField "Boolean", "CI", (System.getenv("CI") == "true").toString()
buildConfigField "String", "ACRA_URL", '"https://ankidroid.org/acra/report"'
buildConfigField "String", "BACKEND_VERSION", "\"${libs.versions.ankiBackend.get()}\""
buildConfigField "Boolean", "ENABLE_LEAK_CANARY", "false"
buildConfigField "Boolean", "ALLOW_UNSAFE_MIGRATION", "false"
buildConfigField "String", "GIT_COMMIT_HASH", "\"${gitCommitHash()}\""
2023-11-13 16:54:10 +01:00
buildConfigField "long", "BUILD_TIME", System.currentTimeMillis().toString()
resValue "string", "app_name", "AnkiDroid"
// The version number is of the form:
// <major>.<minor>.<maintenance>[dev|alpha<build>|beta<build>|]
// The <build> is only present for alpha and beta releases (e.g., 2.0.4alpha2 or 2.0.4beta4), developer builds do
// not have a build number (e.g., 2.0.4dev) and official releases only have three components (e.g., 2.0.4).
//
// The version code is derived from the version name as follows:
// AbbCCtDD
// A: 1-digit decimal number representing the major version
// bb: 2-digit decimal number representing the minor version
// CC: 2-digit decimal number representing the maintenance version
// t: 1-digit decimal number representing the type of the build
// 0: developer build
// 1: alpha release
// 2: beta release
// 3: public release
// DD: 2-digit decimal number representing the build
// 00 for internal builds and public releases
// alpha/beta build number for alpha/beta releases
//
// This ensures the correct ordering between the various types of releases (dev < alpha < beta < release) which is
// needed for upgrades to be offered correctly.
2024-08-23 23:18:32 +02:00
versionCode=21900201
versionName="2.19beta1"
minSdk libs.versions.minSdk.get().toInteger()
// Stays until this is in a release: https://github.com/google/desugar_jdk_libs/commit/c01a5446ca13586b801dbba4d83c6821337b3cc2
if (testReleaseBuild && minSdk < 24) {
minSdk 24
}
// After #13695: change .tests_emulator.yml
targetSdk libs.versions.targetSdk.get().toInteger()
2014-11-10 13:10:07 +01:00
testApplicationId "com.ichi2.anki.tests"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner 'com.ichi2.testutils.NewCollectionPathTestRunner'
}
signingConfigs {
release {
2024-06-22 16:50:01 +02:00
storeFile file(System.getenv("KEYSTOREPATH") ?: "${homePath}/src/android-keystore")
storePassword System.getenv("KEYSTOREPWD") ?: System.getenv("KSTOREPWD")
keyAlias System.getenv("KEYALIAS") ?: "nrkeystorealias"
keyPassword System.getenv("KEYPWD")
}
}
buildTypes {
Dependency updates 20231130 (#14855) * build(deps): bump commons-io:commons-io from 2.15.0 to 2.15.1 Bumps commons-io:commons-io from 2.15.0 to 2.15.1. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump androidx.webkit:webkit from 1.8.0 to 1.9.0 Bumps androidx.webkit:webkit from 1.8.0 to 1.9.0. --- updated-dependencies: - dependency-name: androidx.webkit:webkit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update Gradle Wrapper from 8.4 to 8.5. Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> * build(deps): remove JDK18, support JDK21 (LTS) * build(deps): adopt jacoco 0.8.11 - supports JDK21 * style(lint): use new build variant configuration style documentation: https://developer.android.com/build/build-variants - defer configuration of build types / flavors with create/named, used in example - flavorDimensions is now a property so you += custom dimensions to it * style(lint): gradle .all --> .configureEach * style(lint): use imports vs fully qualified names * docs(gradle): update comment describing CI vCPU determination * style(lint): use deferred-configuration-compatible task registration/dependency * style(lint): deprecated kotlinOptions -> current compilerOptions * style(lint): project.buildDir -> project.layout.buildDirectory required a slightly different way of building the file tree for kotlin class location as input to the report, but despite being a little subtle it is not at all hard to understand --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2023-11-30 22:01:31 +01:00
named('debug') {
versionNameSuffix "-debug"
2018-08-28 17:21:35 +02:00
debuggable true
ci: debug identifier -> 'com.ichi2.anki.debug' Since we're moving to scoped storage, uninstalling the app will very likely delete user data. In Debug/Dev, we want this to impact the dev's workflow as little as possible So we change the applicationId. This relays the expectation that a 'stable' anki should be using 'com.ichi2.anki' and an 'unstable/dev' AnkiDroid should be 'com.ichi2.anki.debug'. A developer should have two copies of the app, each with their own storage location. API: As previously, define the API permissions/authority using the applicationId: permission: 'com.ichi2.anki.debug.permission' authority: 'com.ichi2.anki.debug.flashcards' androidTest needs to access 'com.ichi2.anki.debug.flashcards' and have 'com.ichi2.anki.debug.permission'. To resolve this, if the API is built in debug mode, the constants are modified: (api/build.gradle) * AUTHORITY = "com.ichi2.anki.debug.flashcards" * READ_WRITE_PERMISSION = "com.ichi2.anki.debug.permission.READ_WRITE_DATABASE" Implementation: High level: * Define variables in build.gradle * Handle modifying them via parallel-package-name.sh Low level: * Use 'applicationIdSuffix' for this * Modifies '<provider android:authorities>' in AndroidManifest.xml * Required for installation on device * Use 'applicationId' * Modifies '<permission android:name' in AndroidManifest.xml * Not required - cleanup on parallel-package-name.sh * Modifies preferences_sync.xml * via resValue in build.gradle * Fixes crash Source for both: https://developer.android.com/studio/build/build-variants#build-types applicationIdSuffix: https://developer.android.com/reference/tools/gradle-api/7.3/com/android/build/api/dsl/ApplicationVariantDimension#applicationIdSuffix() @string/applicationId * syntax ref: https://stackoverflow.com/questions/27954215/changing-resvalue-in-variant manifestPlaceholders/${applicationId} https://developer.android.com/studio/build/manage-manifests Learning: > By default, the build tools also provide your app's application ID in the ${applicationId} placeholder. The value always matches the final application ID for the current build, including changes by build variants. This is useful when you want to use a unique namespace for identifiers such as an intent action, even between your build variants. https://developer.android.com/studio/build/manage-manifests
2023-01-10 01:01:02 +01:00
applicationIdSuffix ".debug"
splits.abi.universalApk = true // Build universal APK for debug always
2018-08-28 17:21:35 +02:00
// Check Crash Reports page on developer wiki for info on ACRA testing
// buildConfigField "String", "ACRA_URL", '"https://918f7f55-f238-436c-b34f-c8b5f1331fe5-bluemix.cloudant.com/acra-ankidroid/_design/acra-storage/_update/report"'
if (project.rootProject.file('local.properties').exists()) {
Properties localProperties = new Properties()
localProperties.load(project.rootProject.file('local.properties').newDataInputStream())
// #6009 Allow optional disabling of JaCoCo for general build (assembleDebug).
// jacocoDebug task was slow, hung, and wasn't required unless I wanted coverage
testCoverageEnabled localProperties['enable_coverage'] != "false"
// not profiled: optimization for build times
if (localProperties['enable_languages'] == "false") {
android.defaultConfig.resConfigs "en"
}
// allows the scoped storage migration when the user is not logged in
if (localProperties["allow_unsafe_migration"] != null) {
buildConfigField "Boolean", "ALLOW_UNSAFE_MIGRATION", localProperties["allow_unsafe_migration"]
}
// allow disabling leak canary
if (localProperties["enable_leak_canary"] != null) {
buildConfigField "Boolean", "ENABLE_LEAK_CANARY", localProperties["enable_leak_canary"]
} else {
buildConfigField "Boolean", "ENABLE_LEAK_CANARY", "true"
}
} else {
testCoverageEnabled true
}
// make the icon red if in debug mode
resValue 'color', 'anki_foreground_icon_color_0', "#FFFF0000"
resValue 'color', 'anki_foreground_icon_color_1', "#FFFF0000"
ci: debug identifier -> 'com.ichi2.anki.debug' Since we're moving to scoped storage, uninstalling the app will very likely delete user data. In Debug/Dev, we want this to impact the dev's workflow as little as possible So we change the applicationId. This relays the expectation that a 'stable' anki should be using 'com.ichi2.anki' and an 'unstable/dev' AnkiDroid should be 'com.ichi2.anki.debug'. A developer should have two copies of the app, each with their own storage location. API: As previously, define the API permissions/authority using the applicationId: permission: 'com.ichi2.anki.debug.permission' authority: 'com.ichi2.anki.debug.flashcards' androidTest needs to access 'com.ichi2.anki.debug.flashcards' and have 'com.ichi2.anki.debug.permission'. To resolve this, if the API is built in debug mode, the constants are modified: (api/build.gradle) * AUTHORITY = "com.ichi2.anki.debug.flashcards" * READ_WRITE_PERMISSION = "com.ichi2.anki.debug.permission.READ_WRITE_DATABASE" Implementation: High level: * Define variables in build.gradle * Handle modifying them via parallel-package-name.sh Low level: * Use 'applicationIdSuffix' for this * Modifies '<provider android:authorities>' in AndroidManifest.xml * Required for installation on device * Use 'applicationId' * Modifies '<permission android:name' in AndroidManifest.xml * Not required - cleanup on parallel-package-name.sh * Modifies preferences_sync.xml * via resValue in build.gradle * Fixes crash Source for both: https://developer.android.com/studio/build/build-variants#build-types applicationIdSuffix: https://developer.android.com/reference/tools/gradle-api/7.3/com/android/build/api/dsl/ApplicationVariantDimension#applicationIdSuffix() @string/applicationId * syntax ref: https://stackoverflow.com/questions/27954215/changing-resvalue-in-variant manifestPlaceholders/${applicationId} https://developer.android.com/studio/build/manage-manifests Learning: > By default, the build tools also provide your app's application ID in the ${applicationId} placeholder. The value always matches the final application ID for the current build, including changes by build variants. This is useful when you want to use a unique namespace for identifiers such as an intent action, even between your build variants. https://developer.android.com/studio/build/manage-manifests
2023-01-10 01:01:02 +01:00
resValue "string", "applicationId", "${defaultConfig.applicationId}${applicationIdSuffix}"
2018-08-28 17:21:35 +02:00
}
Dependency updates 20231130 (#14855) * build(deps): bump commons-io:commons-io from 2.15.0 to 2.15.1 Bumps commons-io:commons-io from 2.15.0 to 2.15.1. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump androidx.webkit:webkit from 1.8.0 to 1.9.0 Bumps androidx.webkit:webkit from 1.8.0 to 1.9.0. --- updated-dependencies: - dependency-name: androidx.webkit:webkit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update Gradle Wrapper from 8.4 to 8.5. Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> * build(deps): remove JDK18, support JDK21 (LTS) * build(deps): adopt jacoco 0.8.11 - supports JDK21 * style(lint): use new build variant configuration style documentation: https://developer.android.com/build/build-variants - defer configuration of build types / flavors with create/named, used in example - flavorDimensions is now a property so you += custom dimensions to it * style(lint): gradle .all --> .configureEach * style(lint): use imports vs fully qualified names * docs(gradle): update comment describing CI vCPU determination * style(lint): use deferred-configuration-compatible task registration/dependency * style(lint): deprecated kotlinOptions -> current compilerOptions * style(lint): project.buildDir -> project.layout.buildDirectory required a slightly different way of building the file tree for kotlin class location as input to the report, but despite being a little subtle it is not at all hard to understand --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2023-11-30 22:01:31 +01:00
named('release') {
testCoverageEnabled = testReleaseBuild
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
testProguardFile 'proguard-test-rules.pro'
splits.abi.universalApk = universalApkEnabled // Build universal APK for release with `-Duniversal-apk=true`
signingConfig signingConfigs.release
// syntax: assembleRelease -PcustomSuffix="suffix" -PcustomName="New name"
if (project.hasProperty("customSuffix")) {
// the suffix needs a '.' at the start
applicationIdSuffix project.property("customSuffix").replaceFirst(/^\.*/, ".")
2023-03-05 01:48:43 +01:00
resValue "string", "applicationId", "${defaultConfig.applicationId}${applicationIdSuffix}"
} else {
resValue "string", "applicationId", defaultConfig.applicationId
}
if (project.hasProperty("customName")) {
resValue "string", "app_name", project.property("customName")
}
resValue 'color', 'anki_foreground_icon_color_0', "#FF29B6F6"
resValue 'color', 'anki_foreground_icon_color_1', "#FF0288D1"
}
}
2016-03-11 23:45:45 +01:00
/**
* Product Flavors are used for Amazon App Store and Google Play Store.
* This is because we cannot use Camera Permissions in Amazon App Store (for FireTv etc...)
* Therefore, different AndroidManifest for Camera Permissions is used in Amazon flavor.
*
* This flavor block must stay in sync with the same block in testlib/build.gradle.kts
*/
Dependency updates 20231130 (#14855) * build(deps): bump commons-io:commons-io from 2.15.0 to 2.15.1 Bumps commons-io:commons-io from 2.15.0 to 2.15.1. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump androidx.webkit:webkit from 1.8.0 to 1.9.0 Bumps androidx.webkit:webkit from 1.8.0 to 1.9.0. --- updated-dependencies: - dependency-name: androidx.webkit:webkit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update Gradle Wrapper from 8.4 to 8.5. Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> * build(deps): remove JDK18, support JDK21 (LTS) * build(deps): adopt jacoco 0.8.11 - supports JDK21 * style(lint): use new build variant configuration style documentation: https://developer.android.com/build/build-variants - defer configuration of build types / flavors with create/named, used in example - flavorDimensions is now a property so you += custom dimensions to it * style(lint): gradle .all --> .configureEach * style(lint): use imports vs fully qualified names * docs(gradle): update comment describing CI vCPU determination * style(lint): use deferred-configuration-compatible task registration/dependency * style(lint): deprecated kotlinOptions -> current compilerOptions * style(lint): project.buildDir -> project.layout.buildDirectory required a slightly different way of building the file tree for kotlin class location as input to the report, but despite being a little subtle it is not at all hard to understand --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2023-11-30 22:01:31 +01:00
flavorDimensions += "appStore"
productFlavors {
Dependency updates 20231130 (#14855) * build(deps): bump commons-io:commons-io from 2.15.0 to 2.15.1 Bumps commons-io:commons-io from 2.15.0 to 2.15.1. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump androidx.webkit:webkit from 1.8.0 to 1.9.0 Bumps androidx.webkit:webkit from 1.8.0 to 1.9.0. --- updated-dependencies: - dependency-name: androidx.webkit:webkit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update Gradle Wrapper from 8.4 to 8.5. Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> * build(deps): remove JDK18, support JDK21 (LTS) * build(deps): adopt jacoco 0.8.11 - supports JDK21 * style(lint): use new build variant configuration style documentation: https://developer.android.com/build/build-variants - defer configuration of build types / flavors with create/named, used in example - flavorDimensions is now a property so you += custom dimensions to it * style(lint): gradle .all --> .configureEach * style(lint): use imports vs fully qualified names * docs(gradle): update comment describing CI vCPU determination * style(lint): use deferred-configuration-compatible task registration/dependency * style(lint): deprecated kotlinOptions -> current compilerOptions * style(lint): project.buildDir -> project.layout.buildDirectory required a slightly different way of building the file tree for kotlin class location as input to the report, but despite being a little subtle it is not at all hard to understand --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2023-11-30 22:01:31 +01:00
create('play') {
dimension "appStore"
}
Dependency updates 20231130 (#14855) * build(deps): bump commons-io:commons-io from 2.15.0 to 2.15.1 Bumps commons-io:commons-io from 2.15.0 to 2.15.1. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump androidx.webkit:webkit from 1.8.0 to 1.9.0 Bumps androidx.webkit:webkit from 1.8.0 to 1.9.0. --- updated-dependencies: - dependency-name: androidx.webkit:webkit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update Gradle Wrapper from 8.4 to 8.5. Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> * build(deps): remove JDK18, support JDK21 (LTS) * build(deps): adopt jacoco 0.8.11 - supports JDK21 * style(lint): use new build variant configuration style documentation: https://developer.android.com/build/build-variants - defer configuration of build types / flavors with create/named, used in example - flavorDimensions is now a property so you += custom dimensions to it * style(lint): gradle .all --> .configureEach * style(lint): use imports vs fully qualified names * docs(gradle): update comment describing CI vCPU determination * style(lint): use deferred-configuration-compatible task registration/dependency * style(lint): deprecated kotlinOptions -> current compilerOptions * style(lint): project.buildDir -> project.layout.buildDirectory required a slightly different way of building the file tree for kotlin class location as input to the report, but despite being a little subtle it is not at all hard to understand --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2023-11-30 22:01:31 +01:00
create('amazon') {
dimension "appStore"
}
// A 'full' build has no restrictions on storage/camera. Distributed on GitHub/F-Droid
Dependency updates 20231130 (#14855) * build(deps): bump commons-io:commons-io from 2.15.0 to 2.15.1 Bumps commons-io:commons-io from 2.15.0 to 2.15.1. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump androidx.webkit:webkit from 1.8.0 to 1.9.0 Bumps androidx.webkit:webkit from 1.8.0 to 1.9.0. --- updated-dependencies: - dependency-name: androidx.webkit:webkit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update Gradle Wrapper from 8.4 to 8.5. Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> * build(deps): remove JDK18, support JDK21 (LTS) * build(deps): adopt jacoco 0.8.11 - supports JDK21 * style(lint): use new build variant configuration style documentation: https://developer.android.com/build/build-variants - defer configuration of build types / flavors with create/named, used in example - flavorDimensions is now a property so you += custom dimensions to it * style(lint): gradle .all --> .configureEach * style(lint): use imports vs fully qualified names * docs(gradle): update comment describing CI vCPU determination * style(lint): use deferred-configuration-compatible task registration/dependency * style(lint): deprecated kotlinOptions -> current compilerOptions * style(lint): project.buildDir -> project.layout.buildDirectory required a slightly different way of building the file tree for kotlin class location as input to the report, but despite being a little subtle it is not at all hard to understand --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2023-11-30 22:01:31 +01:00
create('full') {
dimension "appStore"
}
}
/**
* Set this to true to create five separate APKs instead of one:
* - 2 APKs that only work on ARM/ARM64 devices
* - 2 APKs that only works on x86/x86_64 devices
* - a universal APK that works on all devices
* The advantage is the size of most APKs is reduced by about 2.5MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = true
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
//universalApk enableUniversalApk // set in debug + release config blocks above
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
// applicationVariants are e.g. debug, release
Dependency updates 20231130 (#14855) * build(deps): bump commons-io:commons-io from 2.15.0 to 2.15.1 Bumps commons-io:commons-io from 2.15.0 to 2.15.1. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump androidx.webkit:webkit from 1.8.0 to 1.9.0 Bumps androidx.webkit:webkit from 1.8.0 to 1.9.0. --- updated-dependencies: - dependency-name: androidx.webkit:webkit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update Gradle Wrapper from 8.4 to 8.5. Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> * build(deps): remove JDK18, support JDK21 (LTS) * build(deps): adopt jacoco 0.8.11 - supports JDK21 * style(lint): use new build variant configuration style documentation: https://developer.android.com/build/build-variants - defer configuration of build types / flavors with create/named, used in example - flavorDimensions is now a property so you += custom dimensions to it * style(lint): gradle .all --> .configureEach * style(lint): use imports vs fully qualified names * docs(gradle): update comment describing CI vCPU determination * style(lint): use deferred-configuration-compatible task registration/dependency * style(lint): deprecated kotlinOptions -> current compilerOptions * style(lint): project.buildDir -> project.layout.buildDirectory required a slightly different way of building the file tree for kotlin class location as input to the report, but despite being a little subtle it is not at all hard to understand --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2023-11-30 22:01:31 +01:00
applicationVariants.configureEach { variant ->
// We want the same version stream for all ABIs in debug but for release we can split them
if (variant.buildType.name == 'release') {
Dependency updates 20231130 (#14855) * build(deps): bump commons-io:commons-io from 2.15.0 to 2.15.1 Bumps commons-io:commons-io from 2.15.0 to 2.15.1. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump androidx.webkit:webkit from 1.8.0 to 1.9.0 Bumps androidx.webkit:webkit from 1.8.0 to 1.9.0. --- updated-dependencies: - dependency-name: androidx.webkit:webkit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update Gradle Wrapper from 8.4 to 8.5. Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> * build(deps): remove JDK18, support JDK21 (LTS) * build(deps): adopt jacoco 0.8.11 - supports JDK21 * style(lint): use new build variant configuration style documentation: https://developer.android.com/build/build-variants - defer configuration of build types / flavors with create/named, used in example - flavorDimensions is now a property so you += custom dimensions to it * style(lint): gradle .all --> .configureEach * style(lint): use imports vs fully qualified names * docs(gradle): update comment describing CI vCPU determination * style(lint): use deferred-configuration-compatible task registration/dependency * style(lint): deprecated kotlinOptions -> current compilerOptions * style(lint): project.buildDir -> project.layout.buildDirectory required a slightly different way of building the file tree for kotlin class location as input to the report, but despite being a little subtle it is not at all hard to understand --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2023-11-30 22:01:31 +01:00
variant.outputs.configureEach { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
def abi = output.getFilter("ABI")
if (abi != null) { // null for the universal-debug, universal-release variants
// From: https://developer.android.com/studio/publish/versioning#appversioning
// "Warning: The greatest value Google Play allows for versionCode is 2100000000"
// AnkiDroid versionCodes have a budget 8 digits (through AnkiDroid 9)
// This style does ABI version code ranges with the 9th digit as 0-4.
// This consumes ~20% of the version range space, w/50 years of versioning at our major-version pace
output.versionCodeOverride =
// ex: 321200106 = 3 * 100000000 + 21200106
versionCodes.get(abi) * 100000000 + defaultConfig.versionCode
}
}
}
}
}
testOptions {
animationsDisabled true
kotlinOptions {
freeCompilerArgs += [
'-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi',
]
}
}
2018-08-28 17:21:35 +02:00
compileOptions {
Dependency updates 20230628 (#14046) * Bump org.jlleitschuh.gradle:ktlint-gradle from 11.4.1 to 11.4.2 Bumps org.jlleitschuh.gradle:ktlint-gradle from 11.4.1 to 11.4.2. --- updated-dependencies: - dependency-name: org.jlleitschuh.gradle:ktlint-gradle dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): require JDK17 for the build, use JDK17 in workflows 17+ is a requirement for new AndroidX library versions, fragment library lint rules in particular are already failing our lint workflow because they no longer operate on JDK11 * Bump lint_version from 30.4.2 to 31.0.2 Bumps `lint_version` from 30.4.2 to 31.0.2. Updates `com.android.tools.lint:lint-api` from 30.4.2 to 31.0.2 Updates `com.android.tools.lint:lint` from 30.4.2 to 31.0.2 Updates `com.android.tools.lint:lint-tests` from 30.4.2 to 31.0.2 --- updated-dependencies: - dependency-name: com.android.tools.lint:lint-api dependency-type: direct:production update-type: version-update:semver-major - dependency-name: com.android.tools.lint:lint dependency-type: direct:production update-type: version-update:semver-major - dependency-name: com.android.tools.lint:lint-tests dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * build: bump JDK source/target compat to JDK11 This is needed for new versions of deps, it passes jacocoAndroidTestReport target against an API21 emulator (current minSdkVersion) so seems to be compatible with all required things * Bump org.mockito.kotlin:mockito-kotlin from 4.1.0 to 5.0.0 Bumps [org.mockito.kotlin:mockito-kotlin](https://github.com/mockito/mockito-kotlin) from 4.1.0 to 5.0.0. - [Release notes](https://github.com/mockito/mockito-kotlin/releases) - [Commits](https://github.com/mockito/mockito-kotlin/compare/4.1.0...5.0.0) --- updated-dependencies: - dependency-name: org.mockito.kotlin:mockito-kotlin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): have gradle wrapper update PRs go into dependencies --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-28 18:06:44 +02:00
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
coreLibraryDesugaringEnabled true
2018-08-28 17:21:35 +02:00
}
Dependency updates 20220216 (#13280) * Bump kotlin_version from 1.7.22 to 1.8.10 (#13196) * Bump kotlin_version from 1.7.22 to 1.8.10 Bumps `kotlin_version` from 1.7.22 to 1.8.10. Updates `org.jetbrains.kotlin:kotlin-gradle-plugin` from 1.7.22 to 1.8.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.8.10/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.22...v1.8.10) Updates `org.jetbrains.kotlin:kotlin-stdlib` from 1.7.22 to 1.8.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.8.10/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.22...v1.8.10) Updates `org.jetbrains.kotlin:kotlin-test` from 1.7.22 to 1.8.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.8.10/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.22...v1.8.10) Updates `org.jetbrains.kotlin:kotlin-reflect` from 1.7.22 to 1.8.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.8.10/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.22...v1.8.10) Updates `org.jetbrains.kotlin:kotlin-test-junit5` from 1.7.22 to 1.8.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.8.10/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.22...v1.8.10) Updates `org.jetbrains.kotlin:kotlin-test-junit` from 1.7.22 to 1.8.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.8.10/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.22...v1.8.10) --- updated-dependencies: - dependency-name: org.jetbrains.kotlin:kotlin-gradle-plugin dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.jetbrains.kotlin:kotlin-stdlib dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.jetbrains.kotlin:kotlin-test dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.jetbrains.kotlin:kotlin-reflect dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.jetbrains.kotlin:kotlin-test-junit5 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.jetbrains.kotlin:kotlin-test-junit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Enable OptIn(ExperimentalCoroutinesApi) for project This will eliminate all warnings related to experimental coroutines api usages in the project, with the exception of the "api" module which was ignored. The reason for this is that the module doesn't currently use coroutines so the library( and the annotation) isn't available which results in a warning(and a crash as all warnings are fatal) when building. See: https://youtrack.jetbrains.com/issue/KT-28777/Using-experimental-coroutines-api-causes-unresolved-dependency --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: lukstbit <52494258+lukstbit@users.noreply.github.com> * Bump androidx.exifinterface:exifinterface from 1.3.5 to 1.3.6 Bumps androidx.exifinterface:exifinterface from 1.3.5 to 1.3.6. --- updated-dependencies: - dependency-name: androidx.exifinterface:exifinterface dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump androidx.browser:browser from 1.4.0 to 1.5.0 Bumps androidx.browser:browser from 1.4.0 to 1.5.0. --- updated-dependencies: - dependency-name: androidx.browser:browser dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump sqlite-framework from 2.2.0 to 2.3.0 (#13104) Bumps sqlite-framework from 2.2.0 to 2.3.0. --- updated-dependencies: - dependency-name: androidx.sqlite:sqlite-framework dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update database related code to match the new release parameter types Changes in this PR: - DatabaseChangeDecorator: update of the methods signatures according to the library types changes, safe because we went from non nullable parameter types to more permisive nullable types - DB: went from nullable query/bindArgs parameters to non null types. Reviewed all usages of the changed methods and verified that the changes are ok. One of the methods was changed to remove the bindArgs param(which was set to null) because they weren't used and they were breaking the type system. - Anki2Importer: remove the null bindArgs parameter as it wasn't used and it was breaking the type system. - Finder: replaced bindArgs parameter value with an emptyArray() if it is null to conform to the new type system(I assumed that a null value represented no bindARgs parameters). This SHOULD be ok but is difficult to say for sure as the code building the query is complex. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: lukstbit <52494258+lukstbit@users.noreply.github.com> * Bump androidx.appcompat:appcompat from 1.6.0-rc01 to 1.7.0-alpha02 Bumps androidx.appcompat:appcompat from 1.6.0-rc01 to 1.7.0-alpha02. --- updated-dependencies: - dependency-name: androidx.appcompat:appcompat dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix kotlin/java compile target harmony issues ``` * What went wrong: Execution failed for task ':lint-rules:compileTestKotlin'. 'compileTestJava' task (current target is 11) and 'compileTestKotlin' task (current target is 18) jvm target compatibility should be set to the same Java version. Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain ``` https://issuetracker.google.com/issues/260059413 https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: lukstbit <52494258+lukstbit@users.noreply.github.com>
2023-02-17 13:34:53 +01:00
kotlinOptions {
Dependency updates 20230628 (#14046) * Bump org.jlleitschuh.gradle:ktlint-gradle from 11.4.1 to 11.4.2 Bumps org.jlleitschuh.gradle:ktlint-gradle from 11.4.1 to 11.4.2. --- updated-dependencies: - dependency-name: org.jlleitschuh.gradle:ktlint-gradle dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): require JDK17 for the build, use JDK17 in workflows 17+ is a requirement for new AndroidX library versions, fragment library lint rules in particular are already failing our lint workflow because they no longer operate on JDK11 * Bump lint_version from 30.4.2 to 31.0.2 Bumps `lint_version` from 30.4.2 to 31.0.2. Updates `com.android.tools.lint:lint-api` from 30.4.2 to 31.0.2 Updates `com.android.tools.lint:lint` from 30.4.2 to 31.0.2 Updates `com.android.tools.lint:lint-tests` from 30.4.2 to 31.0.2 --- updated-dependencies: - dependency-name: com.android.tools.lint:lint-api dependency-type: direct:production update-type: version-update:semver-major - dependency-name: com.android.tools.lint:lint dependency-type: direct:production update-type: version-update:semver-major - dependency-name: com.android.tools.lint:lint-tests dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * build: bump JDK source/target compat to JDK11 This is needed for new versions of deps, it passes jacocoAndroidTestReport target against an API21 emulator (current minSdkVersion) so seems to be compatible with all required things * Bump org.mockito.kotlin:mockito-kotlin from 4.1.0 to 5.0.0 Bumps [org.mockito.kotlin:mockito-kotlin](https://github.com/mockito/mockito-kotlin) from 4.1.0 to 5.0.0. - [Release notes](https://github.com/mockito/mockito-kotlin/releases) - [Commits](https://github.com/mockito/mockito-kotlin/compare/4.1.0...5.0.0) --- updated-dependencies: - dependency-name: org.mockito.kotlin:mockito-kotlin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): have gradle wrapper update PRs go into dependencies --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-28 18:06:44 +02:00
jvmTarget = JavaVersion.VERSION_11
Dependency updates 20220216 (#13280) * Bump kotlin_version from 1.7.22 to 1.8.10 (#13196) * Bump kotlin_version from 1.7.22 to 1.8.10 Bumps `kotlin_version` from 1.7.22 to 1.8.10. Updates `org.jetbrains.kotlin:kotlin-gradle-plugin` from 1.7.22 to 1.8.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.8.10/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.22...v1.8.10) Updates `org.jetbrains.kotlin:kotlin-stdlib` from 1.7.22 to 1.8.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.8.10/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.22...v1.8.10) Updates `org.jetbrains.kotlin:kotlin-test` from 1.7.22 to 1.8.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.8.10/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.22...v1.8.10) Updates `org.jetbrains.kotlin:kotlin-reflect` from 1.7.22 to 1.8.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.8.10/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.22...v1.8.10) Updates `org.jetbrains.kotlin:kotlin-test-junit5` from 1.7.22 to 1.8.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.8.10/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.22...v1.8.10) Updates `org.jetbrains.kotlin:kotlin-test-junit` from 1.7.22 to 1.8.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.8.10/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.22...v1.8.10) --- updated-dependencies: - dependency-name: org.jetbrains.kotlin:kotlin-gradle-plugin dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.jetbrains.kotlin:kotlin-stdlib dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.jetbrains.kotlin:kotlin-test dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.jetbrains.kotlin:kotlin-reflect dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.jetbrains.kotlin:kotlin-test-junit5 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.jetbrains.kotlin:kotlin-test-junit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Enable OptIn(ExperimentalCoroutinesApi) for project This will eliminate all warnings related to experimental coroutines api usages in the project, with the exception of the "api" module which was ignored. The reason for this is that the module doesn't currently use coroutines so the library( and the annotation) isn't available which results in a warning(and a crash as all warnings are fatal) when building. See: https://youtrack.jetbrains.com/issue/KT-28777/Using-experimental-coroutines-api-causes-unresolved-dependency --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: lukstbit <52494258+lukstbit@users.noreply.github.com> * Bump androidx.exifinterface:exifinterface from 1.3.5 to 1.3.6 Bumps androidx.exifinterface:exifinterface from 1.3.5 to 1.3.6. --- updated-dependencies: - dependency-name: androidx.exifinterface:exifinterface dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump androidx.browser:browser from 1.4.0 to 1.5.0 Bumps androidx.browser:browser from 1.4.0 to 1.5.0. --- updated-dependencies: - dependency-name: androidx.browser:browser dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump sqlite-framework from 2.2.0 to 2.3.0 (#13104) Bumps sqlite-framework from 2.2.0 to 2.3.0. --- updated-dependencies: - dependency-name: androidx.sqlite:sqlite-framework dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update database related code to match the new release parameter types Changes in this PR: - DatabaseChangeDecorator: update of the methods signatures according to the library types changes, safe because we went from non nullable parameter types to more permisive nullable types - DB: went from nullable query/bindArgs parameters to non null types. Reviewed all usages of the changed methods and verified that the changes are ok. One of the methods was changed to remove the bindArgs param(which was set to null) because they weren't used and they were breaking the type system. - Anki2Importer: remove the null bindArgs parameter as it wasn't used and it was breaking the type system. - Finder: replaced bindArgs parameter value with an emptyArray() if it is null to conform to the new type system(I assumed that a null value represented no bindARgs parameters). This SHOULD be ok but is difficult to say for sure as the code building the query is complex. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: lukstbit <52494258+lukstbit@users.noreply.github.com> * Bump androidx.appcompat:appcompat from 1.6.0-rc01 to 1.7.0-alpha02 Bumps androidx.appcompat:appcompat from 1.6.0-rc01 to 1.7.0-alpha02. --- updated-dependencies: - dependency-name: androidx.appcompat:appcompat dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix kotlin/java compile target harmony issues ``` * What went wrong: Execution failed for task ':lint-rules:compileTestKotlin'. 'compileTestJava' task (current target is 11) and 'compileTestKotlin' task (current target is 18) jvm target compatibility should be set to the same Java version. Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain ``` https://issuetracker.google.com/issues/260059413 https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: lukstbit <52494258+lukstbit@users.noreply.github.com>
2023-02-17 13:34:53 +01:00
}
packagingOptions {
resources {
excludes += ['META-INF/DEPENDENCIES']
}
}
}
play {
serviceAccountCredentials.set(file("${homePath}/src/AnkiDroid-GCP-Publish-Credentials.json"))
track.set('beta')
}
2021-05-31 15:50:12 +02:00
// Install Git pre-commit hook for Ktlint
Dependency updates 20231130 (#14855) * build(deps): bump commons-io:commons-io from 2.15.0 to 2.15.1 Bumps commons-io:commons-io from 2.15.0 to 2.15.1. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump androidx.webkit:webkit from 1.8.0 to 1.9.0 Bumps androidx.webkit:webkit from 1.8.0 to 1.9.0. --- updated-dependencies: - dependency-name: androidx.webkit:webkit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update Gradle Wrapper from 8.4 to 8.5. Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> * build(deps): remove JDK18, support JDK21 (LTS) * build(deps): adopt jacoco 0.8.11 - supports JDK21 * style(lint): use new build variant configuration style documentation: https://developer.android.com/build/build-variants - defer configuration of build types / flavors with create/named, used in example - flavorDimensions is now a property so you += custom dimensions to it * style(lint): gradle .all --> .configureEach * style(lint): use imports vs fully qualified names * docs(gradle): update comment describing CI vCPU determination * style(lint): use deferred-configuration-compatible task registration/dependency * style(lint): deprecated kotlinOptions -> current compilerOptions * style(lint): project.buildDir -> project.layout.buildDirectory required a slightly different way of building the file tree for kotlin class location as input to the report, but despite being a little subtle it is not at all hard to understand --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2023-11-30 22:01:31 +01:00
tasks.register('installGitHook', Copy) {
2021-05-31 15:50:12 +02:00
from new File(rootProject.rootDir, 'pre-commit')
into { new File(rootProject.rootDir, '.git/hooks') }
fileMode 0755
}
2024-02-29 13:09:49 +01:00
// to run manually: `./gradlew installGitHook`
Dependency updates 20231130 (#14855) * build(deps): bump commons-io:commons-io from 2.15.0 to 2.15.1 Bumps commons-io:commons-io from 2.15.0 to 2.15.1. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump androidx.webkit:webkit from 1.8.0 to 1.9.0 Bumps androidx.webkit:webkit from 1.8.0 to 1.9.0. --- updated-dependencies: - dependency-name: androidx.webkit:webkit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update Gradle Wrapper from 8.4 to 8.5. Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> * build(deps): remove JDK18, support JDK21 (LTS) * build(deps): adopt jacoco 0.8.11 - supports JDK21 * style(lint): use new build variant configuration style documentation: https://developer.android.com/build/build-variants - defer configuration of build types / flavors with create/named, used in example - flavorDimensions is now a property so you += custom dimensions to it * style(lint): gradle .all --> .configureEach * style(lint): use imports vs fully qualified names * docs(gradle): update comment describing CI vCPU determination * style(lint): use deferred-configuration-compatible task registration/dependency * style(lint): deprecated kotlinOptions -> current compilerOptions * style(lint): project.buildDir -> project.layout.buildDirectory required a slightly different way of building the file tree for kotlin class location as input to the report, but despite being a little subtle it is not at all hard to understand --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2023-11-30 22:01:31 +01:00
tasks.named('preBuild').configure { dependsOn('installGitHook') }
2021-05-31 15:50:12 +02:00
tasks.register('copyTestLibIntoAndroidTest', Copy) {
into new File(rootProject.rootDir, 'AnkiDroid/src/androidTest/java/com/ichi2/testutils')
from new File(rootProject.rootDir, 'testlib/src/main/java/com/ichi2/testutils')
into ('common') {
from 'common'
}
}
tasks.named('preBuild').configure { dependsOn('copyTestLibIntoAndroidTest') }
tasks.named('runKtlintCheckOverAndroidTestSourceSet').configure { mustRunAfter('copyTestLibIntoAndroidTest') }
// Issue 11078 - some emulators run, but run zero tests, and still report success
Dependency updates 20231130 (#14855) * build(deps): bump commons-io:commons-io from 2.15.0 to 2.15.1 Bumps commons-io:commons-io from 2.15.0 to 2.15.1. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump androidx.webkit:webkit from 1.8.0 to 1.9.0 Bumps androidx.webkit:webkit from 1.8.0 to 1.9.0. --- updated-dependencies: - dependency-name: androidx.webkit:webkit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update Gradle Wrapper from 8.4 to 8.5. Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> * build(deps): remove JDK18, support JDK21 (LTS) * build(deps): adopt jacoco 0.8.11 - supports JDK21 * style(lint): use new build variant configuration style documentation: https://developer.android.com/build/build-variants - defer configuration of build types / flavors with create/named, used in example - flavorDimensions is now a property so you += custom dimensions to it * style(lint): gradle .all --> .configureEach * style(lint): use imports vs fully qualified names * docs(gradle): update comment describing CI vCPU determination * style(lint): use deferred-configuration-compatible task registration/dependency * style(lint): deprecated kotlinOptions -> current compilerOptions * style(lint): project.buildDir -> project.layout.buildDirectory required a slightly different way of building the file tree for kotlin class location as input to the report, but despite being a little subtle it is not at all hard to understand --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2023-11-30 22:01:31 +01:00
tasks.register('assertNonzeroAndroidTests') {
doLast {
// androidTest currently creates one .xml file per emulator with aggregate results in this dir
File folder = file("./build/outputs/androidTest-results/connected/flavors/play")
File[] listOfFiles = folder.listFiles({ d, f -> f ==~ /.*.xml/ } as FilenameFilter)
for (File file : listOfFiles) {
// The aggregate results file currently contains a line with this pattern holding test count
String[] matches = file.readLines().findAll { it.contains('<testsuite') }
if (matches.length != 1) {
throw new GradleScriptException("Unable to determine count of tests executed for " + file.name + ". Regex pattern out of date?", null)
}
if (!(matches[0] ==~ /.* tests="\d+" .*/) || matches[0].contains('tests="0"')) {
throw new GradleScriptException("androidTest executed 0 tests for " + file.name + " - Probably a bug with the emulator. Try another image.", null)
}
}
}
}
afterEvaluate {
tasks.named(androidTestName).configure { finalizedBy('assertNonzeroAndroidTests') }
}
apply from: "./robolectricDownloader.gradle"
apply from: "./jacoco.gradle"
apply from: "../lint.gradle"
dependencies {
Dependency updates 20231130 (#14855) * build(deps): bump commons-io:commons-io from 2.15.0 to 2.15.1 Bumps commons-io:commons-io from 2.15.0 to 2.15.1. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump androidx.webkit:webkit from 1.8.0 to 1.9.0 Bumps androidx.webkit:webkit from 1.8.0 to 1.9.0. --- updated-dependencies: - dependency-name: androidx.webkit:webkit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update Gradle Wrapper from 8.4 to 8.5. Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> * build(deps): remove JDK18, support JDK21 (LTS) * build(deps): adopt jacoco 0.8.11 - supports JDK21 * style(lint): use new build variant configuration style documentation: https://developer.android.com/build/build-variants - defer configuration of build types / flavors with create/named, used in example - flavorDimensions is now a property so you += custom dimensions to it * style(lint): gradle .all --> .configureEach * style(lint): use imports vs fully qualified names * docs(gradle): update comment describing CI vCPU determination * style(lint): use deferred-configuration-compatible task registration/dependency * style(lint): deprecated kotlinOptions -> current compilerOptions * style(lint): project.buildDir -> project.layout.buildDirectory required a slightly different way of building the file tree for kotlin class location as input to the report, but despite being a little subtle it is not at all hard to understand --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2023-11-30 22:01:31 +01:00
configurations.configureEach {
resolutionStrategy {
Dependency updates 20231117 (#14763) * build(deps): bump androidx.browser:browser from 1.6.0 to 1.7.0 Bumps androidx.browser:browser from 1.6.0 to 1.7.0. --- updated-dependencies: - dependency-name: androidx.browser:browser dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump com.github.triplet.play from 3.8.5 to 3.8.6 Bumps com.github.triplet.play from 3.8.5 to 3.8.6. --- updated-dependencies: - dependency-name: com.github.triplet.play dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump org.jetbrains.kotlinx:kotlinx-serialization-json Bumps [org.jetbrains.kotlinx:kotlinx-serialization-json](https://github.com/Kotlin/kotlinx.serialization) from 1.6.0 to 1.6.1. - [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases) - [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md) - [Commits](https://github.com/Kotlin/kotlinx.serialization/compare/v1.6.0...v1.6.1) --- updated-dependencies: - dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump org.jetbrains:annotations from 24.0.1 to 24.1.0 (#14748) * build(deps): bump org.jetbrains:annotations from 24.0.1 to 24.1.0 Bumps [org.jetbrains:annotations](https://github.com/JetBrains/java-annotations) from 24.0.1 to 24.1.0. - [Release notes](https://github.com/JetBrains/java-annotations/releases) - [Changelog](https://github.com/JetBrains/java-annotations/blob/master/CHANGELOG.md) - [Commits](https://github.com/JetBrains/java-annotations/compare/24.0.1...24.1.0) --- updated-dependencies: - dependency-name: org.jetbrains:annotations dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update AnkiDroid/build.gradle --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mike Hardy <github@mikehardy.net> * build(deps): bump com.google.protobuf:protobuf-kotlin-lite Bumps com.google.protobuf:protobuf-kotlin-lite from 3.25.0 to 3.25.1. --- updated-dependencies: - dependency-name: com.google.protobuf:protobuf-kotlin-lite dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump androidx.activity:activity-ktx from 1.8.0 to 1.8.1 Bumps androidx.activity:activity-ktx from 1.8.0 to 1.8.1. --- updated-dependencies: - dependency-name: androidx.activity:activity-ktx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): enable nio desugaring This will allow us to bump commons-compress to 2.25.0. Previously, it needed us to wait for API 26 due to use of nio.File ``` Failed resolution of: [Ljava/nio/file/LinkOption; at org.apache.commons.compress.utils.IOUtils.<clinit>(IOUtils.java:47) ``` * build(deps): bump org.apache.commons:commons-compress `com.android.tools:desugar_jdk_libs_nio:2.0.4` allows us to update Bumps org.apache.commons:commons-compress from 1.12 to 1.25.0. Removes Dependabot ignores and comments for commons-compress --- updated-dependencies: - dependency-name: org.apache.commons:commons-compress dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * bump android gradle plugin to 8.1.4 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com>
2023-11-18 21:44:10 +01:00
// Timber has this as a dependency but they are not up to date. We want to force our version.
force 'org.jetbrains:annotations:24.1.0'
}
}
api project(":api")
implementation libs.androidx.work.runtime
lintChecks project(":lint-rules")
coreLibraryDesugaring libs.desugar.jdk.libs.nio
compileOnly libs.jetbrains.annotations
compileOnly libs.auto.service.annotations
annotationProcessor libs.auto.service
// modules
implementation project(":common")
Dependency updates 20240501 (#16315) * build(deps): bump androidx.core:core-ktx from 1.12.0 to 1.13.0 (#16202) * Reapply "Dependency updates 20240417 (#16193)" This reverts commit a75ef34cf93c809931752f986f7b7ef95d51480b. * build(deps): bump androidx.core:core-ktx from 1.12.0 to 1.13.0 Bumps androidx.core:core-ktx from 1.12.0 to 1.13.0. --- updated-dependencies: - dependency-name: androidx.core:core-ktx dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * refactor: use same named parameter name as overridden method else we get build warnings which we consider errors * refactor: call View.generateViewId directly to handle deprecation * refactor: handle CancellationSignal type ambiguity from deprecation by pinning w/declaration attempting to cast it inline with `as CancellationSignal` results in "cast never succeeds" warnings which are unsightly --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Mike Hardy <github@mikehardy.net> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump com.squareup.leakcanary:leakcanary-android Bumps [com.squareup.leakcanary:leakcanary-android](https://github.com/square/leakcanary) from 2.13 to 2.14. - [Release notes](https://github.com/square/leakcanary/releases) - [Changelog](https://github.com/square/leakcanary/blob/main/docs/changelog.md) - [Commits](https://github.com/square/leakcanary/compare/v2.13...v2.14) --- updated-dependencies: - dependency-name: com.squareup.leakcanary:leakcanary-android dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump lint from 31.3.2 to 31.4.0 Bumps `lint` from 31.3.2 to 31.4.0. Updates `com.android.tools.lint:lint-api` from 31.3.2 to 31.4.0 Updates `com.android.tools.lint:lint` from 31.3.2 to 31.4.0 Updates `com.android.tools.lint:lint-tests` from 31.3.2 to 31.4.0 --- updated-dependencies: - dependency-name: com.android.tools.lint:lint-api dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.android.tools.lint:lint dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.android.tools.lint:lint-tests dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump androidGradlePlugin from 8.3.2 to 8.4.0 Bumps `androidGradlePlugin` from 8.3.2 to 8.4.0. Updates `com.android.application` from 8.3.2 to 8.4.0 Updates `com.android.library` from 8.3.2 to 8.4.0 --- updated-dependencies: - dependency-name: com.android.application dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.android.library dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump androidx.activity:activity-ktx from 1.8.2 to 1.9.0 (#16201) * build(deps): bump androidx.activity:activity-ktx from 1.8.2 to 1.9.0 Bumps androidx.activity:activity-ktx from 1.8.2 to 1.9.0. --- updated-dependencies: - dependency-name: androidx.activity:activity-ktx dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * refactor: use activity directly, all ktx extensions in main dep now Per release notes: > The remainder of the Activity APIs have been rewritten in Kotlin and > all extensions previously available in activity-ktx have been moved > to activity. activity-ktx is now completely empty. * refactor: handle Intent nullability changes * fix: [set/add]ContentView nullability change * fix: onBackPressed deprecation * fix: further onBackPressed deprecation --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mike Hardy <github@mikehardy.net> Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com>
2024-05-02 19:59:34 +02:00
implementation libs.androidx.activity
implementation libs.androidx.annotation
implementation libs.androidx.appcompat
implementation libs.androidx.browser
implementation libs.androidx.core.ktx
implementation libs.androidx.draganddrop
implementation libs.androidx.exifinterface
implementation libs.androidx.fragment.ktx
implementation libs.androidx.media
implementation libs.androidx.preference.ktx
implementation libs.androidx.recyclerview
implementation libs.androidx.sqlite.framework
implementation libs.androidx.swiperefreshlayout
implementation libs.androidx.viewpager2
implementation libs.androidx.constraintlayout
implementation libs.androidx.webkit
implementation libs.google.material
implementation libs.android.image.cropper
implementation libs.nanohttpd
implementation libs.kotlinx.serialization.json
implementation libs.seismic
debugImplementation libs.androidx.fragment.testing.manifest
// Backend libraries
implementation libs.protobuf.kotlin.lite // This is required when loading from a file
Properties localProperties = new Properties()
if (project.rootProject.file('local.properties').exists()) {
localProperties.load(project.rootProject.file('local.properties').newDataInputStream())
}
if (localProperties['local_backend'] == "true") {
implementation files("../../Anki-Android-Backend/rsdroid/build/outputs/aar/rsdroid-release.aar")
Drop legacy schema, and update to 2.1.66 backend (#14171) * Update target API to 23 * Update to 2.1.66, and switch to new schema by default + Temporarily disable unused resource warnings * Drop legacy syncing code * Drop legacy import/export code * Drop legacy tag handling * Drop legacy config handling * Drop legacy database check * Stub out unused v1 scheduler code Can't be fully removed, as we still need to be able to open a v1 collection so the user can upgrade. moveVersions test has been removed, as backend code is used for moving outside of unit tests. * Drop legacy deck handling * Drop legacy search code * Drop legacy notetype code This breaks the card template editor, so I've temporarily disabled it in the GUI. Getting it working again will require switching to the new template rendering code in the new backend. Also breaks an "empty cards" action in CardContentProvider, as I was not sure what it was trying to accomplish. * Drop legacy media code This removes oakkitten's custom media checking code, as keeping it would require keeping a bunch of the duplicated Kotlin logic. His comment about cancellation is incorrect: the call can be cancelled with backend. setWantsAbort() on a background thread. And since the app enforces filenames are normalized when they're added anyway, I don't think avoiding automatic normalization is worth the duplicated code. * Drop legacy Collection/DB code * Drop most references to defaultLegacySchema * Remove legacy schema tests from CI CI won't work yet, because backend version needs updating * Fix import CSV call * Remove some unused symbols from anki module * Drop majority of old stats code * Remove unused symbols from libanki * Remove some broken Android tests, and fix one checkIfStudyOptionsIsDisplayedOnTablet() is also consistently failing, but was doing so before I started on these changes. * Move config methods into col.config * Simplify config API - Use kotlinx.serialization so that arbitrary typed objects can be (de)serialized - There is a single generic get(), that always returns an optional value, which will be null if the key is missing, is null, or is not the correct type. There will always be collections that have invalid data, so the calling code always needs to be prepared to substitute a reasonable default in such cases. - Expose the typed getBool() method from the backend. * Remove unused legacy importer * Drop jackson * Models -> Notetypes * Remove some more unused symbols * Remove generic type aliases * Rename Model -> Notetype I had to leave ModelTest.kt's filename alone, as changing it to Notetype.kt reorders the unit tests, and causes about 4 tests to start flaking. * Get card template editor preview working again * Enable undo on edits; fix test hang * Use backend for bulk suspend/undo By default, undoableOp() notifies all screens listening for opExecuted, so the refreshing happens automatically, and the manual refresh code at the end of the old routine is no longer required. It is possible to bypass this when you want to manually update the UI, but this is probably not worth attempting until the card browser is either switched over to a recycler view, or reimplemented as a web component. The LongArrays have been switched to simple lists, as Google's protobuf code expects Iterable<Long> * Use backend for marking/undo, and change deck/undo * Migrate reviewer actions/undo to backend * Migrate remainder of undo code to backend, apart from v2 undo Couple of notes: - The legacy v2 undo no longer returns the undone card, and instead rebuilds the queue. In some circumstances (eg a learning card has become due), this can result in a different card being shown after undoing. This is not ideal, but v2 does not have long to live at this point. - The reset/reposition tests were reusing the old card cache values, which have to be reloaded after an operation. - A test in AbstractSched had to be moved to ReviewerTest so it can have access to an activity. - UndoTest has been removed, as it mainly focused on removed code. * GetCard() -> getNextCardAndRedraw() * render_output -> renderOutput() * Drop AsyncTask Probably the hardest part of AnkiDroid's code base to follow; very glad to see the end of it. Closes #7108 * Make note addition undoable * Make bulk tag update undoable * Remove remaining explicit transaction handling The backend automatically wraps backend actions in a transaction, and removing the explicit calls will allow us to drop the redundant mutex that rsdroid acquires. * Remove remaining unused classes/methods/properties * Remove FunctionalInterfaces * Switch to backend answer comparison * Remove unused locking code + legacy storage code * Switch ContentProviderTest to new schema, and fix bug * Remove legacy Deck Options settings * fix: remove minSdkVersion < 23 code * Use short time in snackbars People complained about snackbars interrupting their reviews before * fix: don't duplicate undo label It were showing a message like `Undo Undo Add Note` * Remove "Advanced statistics" * Remove legacy_schema local property * Leave zip validation up to the backend The backend takes care of validating the zip file and ensuring files aren't written outside of the media folder. I've expanded the mime match to include the zip mime, on the assumption that's what the mime type is being changed to on some devices. If that proves to be insufficient, a much simpler approach would be to look for 50 4B 03 04 at the start of the file to determine if it's a zip file or not. This leaves only Mani's add-on code using commons-compression, so you could potentially switch to a simpler tgz-specific library in the future if that is easier. * Disable two flaky tests They started to flaky reliably after the legacy deck options test was removed. * Improve logging of HTTP requests * Remove ModelBrowser Replaced by ManageNotetypes * Remove legacy CardInfo replaced by com.ichi2.anki.pages.CardInfo * Change comments at AdvancedSettingsFragment * test: check if prefs analytics list don't have extra elements * ContextCompat.getColor -> getColor that compat method is for implementations in API < 23 * Remove more unused files * refactor: move SECONDS_PER_DAY to a separate util file in order to be able to remove Stats.kt later * refactor: remove Stats and OverviewStatsBuilder * Access sched.card directly in tests The helper was adding a 500ms sleep on every fetch, which slowed the scheduler tests down considerably. * Make v3 scheduler the default; drop support for v2 The v3 scheduler was originally released in 2021, and we've been waiting for a stable AnkiDroid release to support it before we could switch users over to it. Now that 2.16 is out, we can finally push v3 out across the ecosystem. While we could theoretically make v3 the default without removing v2, here are the reasons why I think we're better off switching to v3 only: - AnkiWeb's review interface will likely switch over to v3-only in the coming weeks, and AnkiMobile will likely drop v2 around the same time 2.17 comes out. - v2 and v3 differ in a few ways that makes maintaining the two separate paths more complicated: things like the different undo paths, counts not including the current card, and the way the v3 scheduler supports custom scheduler js. 2.17 is a chance to clean up a lot of old cruft in the code base, and the old scheduling code is part of that. - v2 and v3 are compatible with each other, and don't require a full sync to change, so it doesn't break syncing with old clients (though depending on settings, due counts may differ, which needs explanation) I had to disable a couple of tests for this that we'll probably want to restore in some form: - corruptVersion16CollectionShowsDatabaseError() needs an update, and it may be time to rip out the old CollectionHelper colIsOpen(), getColSafe() and so on, migrating code that uses it over to withCol() instead. The 'collection inaccessible' dialog also needs a rethink - perhaps the various exceptions could be handled in launchCatchingTask instead. - testUndoResetsCardCountsToCorrectValue() is failing because initLayout() creates a gesture listener, which fails with an error about the looper not being initialized. I am not sure what's going on there - one option would be to move the test to androidTest. * Drop v2 sched file; rename files * Drop AbstractSched and legacy undo code/queue code * Migrate BaseSched into Scheduler * More unused symbol removal * Remove DeckTreeNode * Remove unused processChildren() * Remove shouldDisplayCounts(), as counts always available * Remove manual hashCode()/compareTo() implementations * Drop AbstractDeckTreeNode * Turn DeckNode into a wrapper for DeckTreeNode * Drop TreeNode and simplify filtering * Remove `New card position` global preference Overridden by per-deck configuration Closes #12319 * fix: remove chess.css from card_template_html * Store current queue state in reviewer Prerequisite for solving #12620 Also dropped answerButtons(), as it's always 4 * Use local HTTP server for serving flashcard content Prerequisite for solving #12620 * Implement support for custom JS scheduling Enables FSRS and closes #12620 * Remove more unused code * Remove separate Deck(Config)V16 objects and more unused code * Move some NotetypeJson methods into its file * Finish tidying Decks.kt * Drop redundant col property on Collection * Remove some usages of CollectionGetter * Rename col->getColUnsafe to encourage migration * Remove Reviewer.sched * Handle deck tree not initialized in empty collection * refactor: move syncStatus() to Collection to avoid direct calls to the backend * fix: do not show error when updating the menu if there is no internet Reproduction steps: 1. have the collection synced 2. disable the device internet connection 3. Restart the app * Remove unused resources and re-enable lint * Restore sync cancel strings * Defer loading webpage until server has initialized * Ignore translations without a base entry https://github.com/ankidroid/Anki-Android/pull/14171#issuecomment-1660286342 * Remove the SortOrder deprecation * Remove the apparently-unused Backup.kt * Remove last remaining use of Collection's context field * Stop passing Context to backend The library loading is now AnkiDroid's responsibility, so the backend does not require access to an Android context. Also remove the unused context field from Collection. * Use backend for rendering next time labels * Use backend for rendering finished message The custom study & unbury descriptions are slightly different, but should suffice until AnkiDroid can start using the Svelte finished screen. * Run SchedulerTest without Robolectric Halves the run time. To do this, I implemented a new JvmTest class and copied some of the helpers in RobolectricTest into it. * Remove unused Kotlin implementation of template parsing * Move Util code dealing with resources out of libanki * Migrate remaining libanki tests to raw JVM + Remove some commented-out tests Total savings are a drop from about 3m40s to 2m40s, with the scheduler test class dropping its runtime by about half. * Lazy-initialize col in tests * Restore 'experimental' string * Add comments to update-localizations.py * Restore AcraAnalyticsInteraction.kt --------- Co-authored-by: Brayan Oliveira <69634269+brayandso@users.noreply.github.com>
2023-08-30 23:44:03 +02:00
testImplementation files("../../Anki-Android-Backend/rsdroid-testing/build/libs/rsdroid-testing.jar")
} else {
implementation libs.ankiBackend.backend
2024-06-20 16:25:06 +02:00
testImplementation libs.ankiBackend.testing
}
2018-10-05 19:41:05 +02:00
// May need a resolution strategy for support libs to our versions
implementation libs.acra.limiter
implementation libs.acra.toast
implementation libs.acra.dialog
implementation libs.acra.http
implementation libs.commons.compress
implementation libs.commons.collections4 // SetUniqueList
implementation libs.commons.io // FileUtils.contentEquals
implementation libs.mikehardy.google.analytics.java7
implementation libs.okhttp
implementation libs.slf4j.timber
implementation libs.jakewharton.timber
implementation libs.jsoup
implementation libs.java.semver // For AnkiDroid JS API Versioning
implementation libs.drakeet.drawer
implementation libs.tapTargetPrompt
implementation libs.colorpicker
implementation libs.kotlin.reflect
implementation libs.kotlin.test
implementation libs.search.preference
2022-06-16 21:54:47 +02:00
// Cannot use debugImplementation since classes need to be imported in AnkiDroidApp
// and there's no no-op version for release build. Usage has been disabled for release
// build via AnkiDroidApp.
implementation libs.leakcanary.android
testImplementation project(':testlib')
// A path for a testing library which provide Parameterized Test
testImplementation libs.junit.jupiter
testImplementation libs.junit.jupiter.params
testImplementation libs.junit.vintage.engine
testImplementation libs.mockito.inline
testImplementation libs.mockito.kotlin
testImplementation libs.hamcrest
// robolectricDownloader.gradle *may* need a new SDK jar entry if they release one or if we change targetSdk. Instructions in that gradle file.
testImplementation libs.robolectric
testImplementation libs.androidx.test.core
testImplementation libs.androidx.test.junit
testImplementation libs.kotlin.reflect
testImplementation libs.kotlin.test
testImplementation libs.kotlin.test.junit5
testImplementation libs.kotlinx.coroutines.test
testImplementation libs.mockk
testImplementation libs.commons.exec // obtaining the OS
testImplementation libs.androidx.fragment.testing
// in a JvmTest we need org.json.JSONObject to not be mocked
testImplementation libs.json
testImplementation libs.ivanshafran.shared.preferences.mock
testImplementation libs.androidx.test.runner
testImplementation libs.androidx.test.rules
testImplementation libs.androidx.espresso.core
testImplementation(libs.androidx.espresso.contrib) {
exclude module: "protobuf-lite"
}
testImplementation libs.androidx.work.testing
// for testing flows
testImplementation libs.cashapp.turbine
// we should depend directly on the common testlib for androidTest, but we cannot
// until coverage-breaking issue is fixed https://issuetracker.google.com/issues/332746900
// androidTestImplementation project(':testlib')
2018-10-05 19:41:05 +02:00
// May need a resolution strategy for support libs to our versions
androidTestImplementation libs.androidx.espresso.core
androidTestImplementation(libs.androidx.espresso.contrib) {
Update to Anki 2.1.54 backend Squashes a few commits: Move the legacy schema toggle into BackendFactory Simplify backend handling; rework collection instantiation When the Rust code was initially introduced, it was not clear whether it would be usable on all devices, or whether it would need to be removed for some reason. This no doubt influenced the design of the existing API, which tries to make it easy to swap the Rust code out with something else. Unfortunately this approach has some downsides: - It makes it somewhat harder to follow, as method calls jump through multiple interfaces before they're actually sent to the backend. - It makes utilizing new methods considerably more cumbersome. For example, take the extract_av_tags() call. It follows the following path: collection method or method in related helper class: https://github.com/ankidroid/Anki-Android/blob/cea79e1b077bc30e7eed8f37529002aae416d34d/AnkiDroid/src/main/java/com/ichi2/libanki/TemplateManager.kt#L242 to generic interface: https://github.com/ankidroid/Anki-Android/blob/cea79e1b077bc30e7eed8f37529002aae416d34d/AnkiDroid/src/main/java/com/ichi2/libanki/backend/DroidBackend.kt#L83 to specific implementation: https://github.com/ankidroid/Anki-Android/blob/cea79e1b077bc30e7eed8f37529002aae416d34d/AnkiDroid/src/main/java/com/ichi2/libanki/backend/RustDroidV16Backend.kt#L57 and if it's unusable with the legacy schema (which I don't believe is actually true in this case), it also needs to be added to the other implementation: https://github.com/ankidroid/Anki-Android/blob/cea79e1b077bc30e7eed8f37529002aae416d34d/AnkiDroid/src/main/java/com/ichi2/libanki/backend/RustDroidBackend.kt#L87 and then finally, a method in the backend module is invoked. The backend module has code generation so that invoking a backend method is as simple as making a method call, but currently you have to weave the call through 3 or so levels of indirection before you can actually use it. With something like 170 available methods, that's a fair amount of extra work required. Rather than trying to insulate libanki from the backend code, this PR drops some of the indirection in favour of the approach the desktop takes: libanki is the insulation layer; it can call freely into the backend methods, but consumers (eg the GUI code) are expected to only call methods on the collection, and not access the backend directly. In addition to the above, collection initialization has been reworked to be more similar to the computer version. Instead of the collection being created from a database object, a backend is passed into the collection creation, and the collection takes care of creating a DB instance that wraps the backend. Remove always-on isUsingRustBackend Drop the legacy upgrade/initialization code Schema 11 was introduced in 2012, and decks that still are <11 are very rare. The desktop dropped support for schema 10 back in early 2020. This also removes the need to modify SCHEMA_VERSION when switching between TESTING_USE_V16_BACKEND. Remove DOWNGRADE_REQUIRED and slightly simplify startup error handling - The backend automatically downgrades when required, and possible. No backup is required, as the downgrade happens in a single transaction, and the downgrade code has proven itself over time. - Store the type of failure in getColSafe(), so it can be checked later. Update to work with desktop 2.1.53 code Depends on https://github.com/ankidroid/Anki-Android-Backend/pull/202 Due to the removal and change of a few backend methods, syncing, importing and the card templates screen will not work when the schema16 setting is active (actually schema18 now). To get them working again, those code paths will need to switch to the backend implementations. A few notes: - Downgrading happens automatically when loading the collection in schema11 mode, so the extra code dealing with downgrades & "can downgrade" reporting can be stripped. - Added the ability to run col.set_config("key", JSONObject.NULL), as unit tests were attempting to write the entire collection config, which is no longer supported. - All tests pass on both old and new backends, though the latter required disabling a few failed tests when running with the new schema (eg notetype updating). Integrates, and thus closes #11579 and closes #11581 Remove the time argument to Storage.collection() Collection does not currently take a time argument, and relies on the global object instead, so this change brings Storage in line with it. Reuse the backend when closing+reopening a collection Avoids having to re-initialize the translations, and reduces leaks (the import + export code leaks backends still)
2022-06-28 08:03:17 +02:00
exclude module: "protobuf-lite"
}
androidTestImplementation libs.androidx.test.core
androidTestImplementation libs.androidx.test.junit
androidTestImplementation libs.androidx.test.rules
androidTestImplementation libs.androidx.uiautomator
androidTestImplementation libs.kotlin.test
androidTestImplementation libs.kotlin.test.junit
androidTestImplementation libs.androidx.fragment.testing
implementation libs.androidx.media3.exoplayer
implementation libs.androidx.media3.exoplayer.dash
implementation libs.androidx.media3.ui
}