0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 20:03:05 +02:00
Commit Graph

15144 Commits

Author SHA1 Message Date
Mike Hardy
88b60ef483 fix(build): assert that more than zero androidTests executed
Sometimes an emulator "runs" tests, but it actually discovered zero
tests, runs zero tests, and still reports success. Lookin' at you API21.

Fixes #11078
2022-04-25 22:25:52 -05:00
Mike Hardy
25473eeaff fix(build): lint-rules project should use common best build practices
extract our best-practices build settings to project-level file, apply
to all sub-projects

Fixes #11083
2022-04-25 22:25:52 -05:00
Mike Hardy
45e7c19f8b build(deps): lint-rules hamcrest use 2.2, extract hamcrest version
This is the recommended way to upgrade hamcrest from 1.x to 2.x when
using junit 4.x, see http://hamcrest.org/JavaHamcrest/distributables#gradle-upgrade-example
2022-04-25 22:25:52 -05:00
Mike Hardy
3e91bdc13e perf(ci): use gradle-build-action w/main cache only on all workflows
This should optimize LRU cache eviction so main and branches always have
reasonably fresh gradle caches and main does not ever get evicted, since
branches have independent caches and would otherwise fill up 10GB cache limit

Note that `--daemon` is specified as the default for this action is no daemon,
that is correct for long-lived runners to avoid cross-build contamination, but
on GitHub Hosted Runners (which we use) we are clean each run, so this is a small
optimization to share gradle between steps: https://github.com/gradle/gradle-build-action/issues/113#issuecomment-1003204780
2022-04-25 22:25:52 -05:00
Mike Hardy
fed9f97d87 build(deps): bump jacoco from 0.8.7 to 0.8.8 2022-04-25 22:25:52 -05:00
Mike Hardy
9de60878ba
build(deps): dependency updates 20220425
chore(deps): bump kotlin_version from 1.6.20 to 1.6.21  c275b35
chore(deps): bump mockito-inline from 4.4.0 to 4.5.0  0eee1e6
chore(deps): bump leakcanary-android from 2.7 to 2.9 (#10988)  72bede3
chore(deps): bump protobuf-java from 3.20.0 to 3.20.1  e79c835
chore(deps): bump leakcanary-android from 2.9 to 2.9.1  674c833
chore(deps): bump mockito-inline from 4.5.0 to 4.5.1  e790731
build(deps): kotlin stdlib deps are implicit now #10991
2022-04-25 11:07:21 -05:00
David Allison
f870ea277c fix(strings): missing positional string args
Plurals missing positional string args were previously
 not detected by either lint or AAPT2. A future PR will fix this
 and the code needs to have no issues.

To fix: rename:
`reviewer_window_title_days` -> `reviewer_window_title_days_new`
`reviewer_window_title_hours` -> `reviewer_window_title_hours_new`
and fix the strings: `%d` -> `%1$d`

I renamed the strings as:
* This was easier to do in the IDE, rather than deleting them
* They'll be overwritten on the next translation sync
  * and with less of a 'line change'

Issue 11072
Unblocks 11081 (adding the lint)
2022-04-25 07:21:26 -05:00
Yxx
d49ff89192 Kotlin Cleanup: AbstractFlashcardViewerTest.kt
Part of issue #10489

Update AbstractFlashcardViewerTest.kt

Fix a code style problem.

update`AbstractFlashcardViewerTest.kt`. Apply parameterized tests

update`AbstractFlashcardViewerTest.kt`. Clean the code style

Change the input parameter to tuple to improve the readability of the code

format the code style

fix code style
2022-04-24 15:18:57 -05:00
codingtosh
ced8ebb50b refactor: Convert CompatV21.kt to Kotlin
com.ichi2.compat.CompatV21
2022-04-24 15:08:26 -05:00
codingtosh
d2e651887f refactor: Rename CompatV21.java to .kt
com.ichi2.compat.CompatV21
2022-04-24 15:08:26 -05:00
David Allison
b1468a2425 fix: Don't apply lint to ignored file
tools:ignore ignores the outcome, but still processed the file

This caused a bug as it found a duplicate key in an ignored file

and flagged it as an error on the non-ignored file
2022-04-24 14:56:36 -05:00
Prince kushwaha
4c1c9390ca Migrate AnkiDroidAppTest.java to Kotlin 2022-04-24 14:33:56 -05:00
Prince kushwaha
760ea174a0 Rename AnkiDroidAppTest.java to AnkiDroidAppTest.kt 2022-04-24 14:33:56 -05:00
Mani
e3c3359e6e
[JS API] Reschedule card with x days (#11071) 2022-04-24 13:26:15 -05:00
Mike Hardy
b565d5b19c perf(ci, emulator): community emulator action / AVD caching / gradle cachine
Also adds an emulator run benchmarking suite that works in combo with matrix

If branch builds result in cache upload of emulator files the cache files there will
need to be scoped for just changes on the snapshot file(s)
2022-04-24 13:15:19 -05:00
Mani
14b3ac814b
feat: get list of addons model from json containing array of addons data (#11023) 2022-04-24 11:09:43 -05:00
codingtosh
8ac9d06227 [Kotlin Migration] ThreadUtils
Package: com.ichi2.anki.testutil
2022-04-24 11:02:40 -05:00
codingtosh
d7022ecb97 Rename ThreadUtils.java to .kt
Package: com.ichi2.anki.testutil
2022-04-24 11:02:40 -05:00
codingtosh
e799c5b56a [Kotlin Migration] InstrumentedTest
Package: com.ichi2.anki.tests
2022-04-24 10:55:37 -05:00
codingtosh
dce09cdfc5 Rename InstrumentedTest.java to .kt
Package: com.ichi2.anki.tests
2022-04-24 10:55:37 -05:00
codingtosh
fabb8d76aa [Kotlin Migration] DatabaseUtils
Package: com.ichi2.anki.testutil
2022-04-24 10:49:18 -05:00
codingtosh
299e51b71c Rename DatabaseUtils.java to .kt
Package: com.ichi2.anki.testutil
2022-04-24 10:49:18 -05:00
Brayan Oliveira
65bad3506c Convert ReviewerTest.kt to Kotlin 2022-04-24 10:40:23 -05:00
Brayan Oliveira
7aedbe8b90 Rename ReviewerTest.java to .kt 2022-04-24 10:40:23 -05:00
David Allison
625bb0ee38 feat(scoped-storage): let dialog execute migration 2022-04-24 10:24:26 -05:00
David Allison
bec3b346f1 fix: Don't apply strings lint to non-strings file
DuplicateCrowdInStrings applies to only the /values/ folder
But there are other files in the values folder aside from translatable
strings (resources, constants, etc...)

As lint does not currently have a good way to exclude files from linting
So instead we use `tools:ignore` to do this
2022-04-24 10:18:11 -05:00
David Allison
b51e99f0fd refactor: Kotlin Cleanup: DuplicateCrowdInStrings 2022-04-24 10:18:11 -05:00
Prince kushwaha
840c49ec9c Migrate MathJaxClozeTest.java to Kotlin 2022-04-24 10:11:22 -05:00
Prince kushwaha
28a7869425 Rename MathJaxClozeTest.java to MathJaxClozeTest.kt 2022-04-24 10:11:22 -05:00
oyeraghib
261ac795eb Migrate JSONArrayTest to Kotlin 2022-04-24 10:05:05 -05:00
oyeraghib
c9a489c75a Rename .java to .kt 2022-04-24 10:05:05 -05:00
Prince kushwaha
1343029502 Migrate ClozeTest.java to Kotlin 2022-04-24 09:58:52 -05:00
Prince kushwaha
0611d7233e Rename ClozeTest.java to ClozeTest.kt 2022-04-24 09:58:52 -05:00
codingtosh
9b946fd59f [Kotlin Migration] TestEnvironment
Package: com.ichi2.anki.testutil
2022-04-24 09:52:06 -05:00
codingtosh
dae5fea9e7 Rename TestEnvironment.java to .kt
Package: com.ichi2.anki.testutil
2022-04-24 09:52:06 -05:00
codingtosh
308e87721f [Kotlin Migration] MockReviewerUi
Package: com.ichi2.anki.testutil
2022-04-24 09:45:16 -05:00
codingtosh
1347353ad1 Rename MockReviewerUi.java to .kt
Package: com.ichi2.anki.testutil
2022-04-24 09:45:16 -05:00
Abhiram
9af6a09696
Added Unit Tests for ``StepsPreference.kt`` (#11058) 2022-04-24 09:36:00 -05:00
David Allison
253d72d43d kotlin migration: Enable ANDROID_TEST migration
Tested and this works
2022-04-24 09:30:11 -05:00
Sustech-yx
09e46e1c37 add the explaination for the addition test 2022-04-24 09:27:31 -05:00
oyeraghib
88670c3d75 Migrate DBTest to Kotlin 2022-04-23 22:00:34 -05:00
oyeraghib
8770a5f415 Rename .java to .kt 2022-04-23 22:00:34 -05:00
David Allison
88d71bf32d refactor: Convert ImageField.kt to Kotlin
com.ichi2.anki.multimediacard.fields.ImageField
2022-04-23 21:52:53 -05:00
David Allison
297d4e7a35 refactor: Rename ImageField.java to .kt
com.ichi2.anki.multimediacard.fields.ImageField
2022-04-23 21:52:53 -05:00
oyeraghib
81aba92430 Migrate MockTimeTest to Kotlin 2022-04-23 21:46:36 -05:00
oyeraghib
6d3e9c87ca Rename .java to .kt 2022-04-23 21:46:36 -05:00
Prince kushwaha
5e415b1c3b Migrate MetaTest.java to Kotlin 2022-04-23 21:38:49 -05:00
Prince kushwaha
c793a07ca4 Rename MetaTest.java to MetaTest.kt 2022-04-23 21:38:49 -05:00
lukstbit
ae858117f4 Migrate CompatV26.java to Kotlin 2022-04-23 21:31:19 -05:00
lukstbit
67e9fbec9b Rename CompatV26.java to .kt 2022-04-23 21:31:19 -05:00