David Allison
e3f69c2a9b
ci: Use two CPUs when building on CI
...
GitHub Actions (Standard_DS2_v2) are 1:1 on Linux/Windows with two vCPU cores
On macOS, this uses a separate cloud.
Sources:
https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#cloud-hosts-for-github-hosted-runners
https://docs.microsoft.com/en-gb/azure/virtual-machines/acu
https://docs.microsoft.com/en-gb/azure/virtual-machines/dv2-dsv2-series
2022-05-13 13:52:33 -05:00
David Allison
fcdb08fe24
feat: Speed up tests on M1 Macs
...
M1 Macs don't have SMT, so there's no need to halve the processors when
running tests
Before:
BUILD SUCCESSFUL in 3m 1s
BUILD SUCCESSFUL in 2m 57s
After:
BUILD SUCCESSFUL in 2m 08s
BUILD SUCCESSFUL in 1m 53s
2022-05-13 13:52:33 -05:00
oyeraghib
05b96990ce
[Kotlin Cleanup] CollectionUtils
2022-05-13 10:30:09 -05:00
oyeraghib
381b1bd2af
[Kotlin Cleanup] MockCursor
2022-05-13 10:25:09 -05:00
lukstbit
3fa836ba99
Refactor IField to prepare for its migration to java
...
Actions:
- remove unsused methods
- change signatures of methods to make the transition to properties easier
- rename an extra reference of a property from one of the subclasses of IField which would clash with some class methods
during migration
2022-05-13 10:24:26 -05:00
oyeraghib
21d8a142ee
[Kotlin Cleanup] ReminderServiceTest
2022-05-13 10:18:40 -05:00
dorrin-sot
9101795b3c
Fix AutoFocus EditText Preferences Back/Return Button Bug
2022-05-13 10:17:55 -05:00
lukstbit
6306a0aec6
Fix ModelBrowser leaking its ModelBrowserContextMenu reference
...
To solve the leak and decouple the two classes, this PR also:
- refactors the ModelBrowserContextMenu class to remove it's reference to the activity
- fixes a @KotlinCleanup for the method where the leak occurs
2022-05-13 10:16:10 -05:00
David Allison
2704fcb866
feat(scoped-storage): complete migrateEssentialFiles ( #11049 )
...
* feat(scoped-storage): implement migrateEssentialFiles
Handles selection of the correct directory, and handling deletion
if an issue occurred with the copy
Co-authored-by: Arthur Milchior <arthur@milchior.fr>
2022-05-13 10:03:37 -05:00
David Allison
fa15aeb759
fix: invalid sourceSets for Android Chipmunk
...
Due to https://issuetracker.google.com/issues/37001185 we were defining
`manifest.srcFile` for `debug` instead of for `test`. This is
because manifest merging previously occurred only with build variants
Was required for robolectric. Apparently fixed in AGP 0.13.0:
https://issuetracker.google.com/issues/37001185
It seems we can manifest merge based on 'test' and 'androidTest',
so remove the `debug` sourceSet.
This caused a bug on Android Chipmunk, as we included 'test' in the
'main' source set due to a change in how sourceSets were processed
Fixes 11291
Main comments: https://issuetracker.google.com/issues/232007221
https://issuetracker.google.com/issues/220326930
Originally added in ee463c2a3e
2022-05-12 11:36:03 -05:00
Nishant
6957e562fc
Bumped API version due to kotlin visibility change on package protected
2022-05-12 09:21:07 -05:00
Nishant
f5c8c5ebb7
Migrate BasicModel to Kotlin
2022-05-12 09:21:07 -05:00
Nishant
e87ddac85e
Rename .java to .kt
2022-05-12 09:21:07 -05:00
Mike Hardy
f731c47c5b
fix(test): shorten time and use greaterThanOrEqualTo for sleep test
2022-05-12 09:06:28 -05:00
lukstbit
6f40e0211c
Ignore image and audio paths check for text based fields
2022-05-12 08:21:50 -05:00
David Allison
1fa46e39b7
refactor: Kotlin Cleanup
2022-05-12 08:12:07 -05:00
David Allison
7813b56cab
refactor: IDE Lint
2022-05-12 08:12:07 -05:00
David Allison
65eb32de13
refactor: Kotlin Cleanup: nullability
2022-05-12 08:12:07 -05:00
David Allison
03e41e7fe6
refactor: Kotlin Cleanup: nullability
2022-05-12 08:12:07 -05:00
David Allison
f80c4e8a3e
refactor: Kotlin Cleanup: nullability
2022-05-12 08:12:07 -05:00
lukstbit
ca058f9226
Remove useless abstraction for IControllerFactory
2022-05-12 07:56:00 -05:00
David Allison
2902cff08d
docs: Rationale for @NeedsTest
...
Explain the impact now: new contributors think about tests,
and encourage tests to be written without being overbearing
And future plans: moving to a codebase with better coverage and
better formalizing the requirements for writing a test for GSoC
2022-05-12 07:46:05 -05:00
Jatin
df38bc3f49
[KotlinCleanup] AsyncDialogFragment.kt ( #11287 )
2022-05-12 10:02:58 +01:00
oyeraghib
888b518ac2
[Kotlin Cleanup] ListUtil
2022-05-11 09:18:05 -05:00
oyeraghib
e992dab68d
[Kotlin Cleanup] Various
2022-05-11 09:02:18 -05:00
Nishant Bhandari
6148c90ebb
Allow only single imports on the .colpkg option. ( #11303 )
2022-05-11 08:47:06 -05:00
oyeraghib
20ff63ae8d
[Kotlin Cleanup] CollectionTaskCheckDatabaseTest
2022-05-11 08:34:54 -05:00
lukstbit
6dff1b63c5
Remove code related to translation from project
2022-05-11 08:33:19 -05:00
lukstbit
8d9e79f90b
Migrate FieldControllerBase.java to kotlin
...
This PR has changes besides the output of the java-kotlin IDE migration tool:
- the tool made the fields in FieldControllerBase as nullable which triggered a lot of changes in
subclasses for adding !!. To reduce the number of changes this PR tackles the nullability of the class properties and
made them lateinit var
- there's one extra getter method added for the mActivity field because one of the subclasses' test requires access to
the field. It is possible to access protected fields from the same packages in java but this isn't possible in kotlin
code.
2022-05-11 08:17:27 -05:00
lukstbit
6807964cba
Rename FieldControllerBase.java to .kt
2022-05-11 08:17:27 -05:00
oyeraghib
51059791c2
[Unit Test] ThreadUtilTest.kt
2022-05-11 08:08:20 -05:00
David Allison
e136d85362
docs: better explain cleanup annotation
2022-05-11 05:02:32 +01:00
David Allison
853d76de7d
refactor: kotlin cleanup - documentation fix
...
No semicolons in Kotlin
2022-05-11 05:02:32 +01:00
David Allison
d597bbd2db
refactor: kotlin cleanup - improve readability
...
add method: removeHungarianPrefix and document it
2022-05-11 05:02:32 +01:00
David Allison
e8c79f0f84
refactor: kotlin cleanup - shorten method
2022-05-11 05:02:32 +01:00
David Allison
e264e0260e
refactor: remove requireNonNull
...
No longer required
2022-05-11 05:02:32 +01:00
David Allison
f7374d23ac
refactor: Kotlin Cleanup: use listOf
...
Reduction in code without reduction of readability
2022-05-11 05:02:32 +01:00
David Allison
56fcdf4922
refactor(lint-rules): fix IDE lint
...
Removes all IDE lint warnings from the non-test Kotlin classes
2022-05-11 05:02:32 +01:00
David Allison
330854683f
refactor: ignore "UnstableApiUsage" lint warnings
...
We're aware that these classes are using `@Beta` functionality
Removes a lot of IDE lint warnings
2022-05-11 05:02:32 +01:00
Mike Hardy
a145c032fd
Bumped version to 2.16alpha65
2022-05-11 01:15:54 +00:00
David Allison
168407e8f0
refactor: Convert DirectSystemTimeInstantiation to Kotlin
...
com.ichi2.anki.lint.rules.DirectSystemTimeInstantiation
2022-05-10 20:14:25 -05:00
David Allison
c964b1fae6
refactor: Rename DirectSystemTimeInstantiation.java to .kt
...
com.ichi2.anki.lint.rules.DirectSystemTimeInstantiation
2022-05-10 20:14:25 -05:00
lukstbit
078d4bd3b8
Migrate TagsList.java to Kotlin
2022-05-10 19:55:24 -05:00
lukstbit
663cc197cf
Rename TagsList.java to .kt
2022-05-10 19:55:24 -05:00
lukstbit
05d3369abe
Migrate RemoteMediaServer.java to Kotlin
2022-05-10 19:40:55 -05:00
lukstbit
dd90cff363
Rename RemoteMediaServer.java to .kt
2022-05-10 19:40:55 -05:00
David Allison
9ae744759a
refactor: Convert Constants to Kotlin
...
com.ichi2.anki.lint.utils.Constants
2022-05-10 19:26:31 -05:00
David Allison
966b0142c1
refactor: Rename Constants.java to .kt
...
com.ichi2.anki.lint.utils.Constants
2022-05-10 19:26:31 -05:00
David Allison
dcba4fbd3a
refactor: Convert JavaFieldNamingPatternDetector to Kotlin
...
com.ichi2.anki.lint.rules.JavaFieldNamingPatternDetector
2022-05-10 19:17:42 -05:00
David Allison
22ddbe7c67
refactor: Rename JavaFieldNamingPatternDetector.java to .kt
...
com.ichi2.anki.lint.rules.JavaFieldNamingPatternDetector
2022-05-10 19:17:42 -05:00