Skip to content

Commit f1bb756

Browse files
committed
Merge branch 'master' of https://github.com/ankidroid/Anki-Android into addons
2 parents 38a4869 + 3cca3b1 commit f1bb756

482 files changed

Lines changed: 4965 additions & 1086 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codecov.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
1+
# the comments are too noisy to be useful
2+
comment: false
3+
4+
# disable noisy inline-annotations ("Added line [LineNum] was not covered by tests") on PRs (#8296)
5+
# https://docs.codecov.io/docs/github-checks-beta
6+
github_checks:
7+
annotations: false
8+
19
coverage:
210
range: "36...100"
11+
status:
12+
project:
13+
default:
14+
# dropping slightly is ok - this stops the check failing on test timing variability
15+
# .12 was observed as the largest variability owing to timing forcing different test branch choice
16+
threshold: 0.15

.github/workflows/lint.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,21 @@ jobs:
3333
timeout-minutes: 15
3434
runs-on: ubuntu-latest
3535
steps:
36-
- uses: styfle/cancel-workflow-action@0.6.0
37-
with:
38-
access_token: ${{ github.token }}
36+
- uses: styfle/cancel-workflow-action@0.8.0
3937

4038
- uses: actions/checkout@v2
4139
with:
4240
fetch-depth: 1
4341

44-
- name: Configure JDK 1.8
42+
- name: Configure JDK 1.11
4543
uses: actions/setup-java@v1
4644
with:
47-
java-version: '8' # ubuntu-latest is about to default to 11, force 8
45+
java-version: "11" # ubuntu-latest is about to default to 11, force it everywhere
4846

49-
- name: Verify JDK8
50-
# OpenJDK1.8 is the default in GitHub macOS 10.15 runner, setup is not required
51-
# On ubuntu-latest it is OpenJDK1.8 but is about to switch, so we should setup
52-
# It may be required on other runners though
53-
# Run a check that exits with error unless it is 1.8 version to future-proof against unexpected upgrades
54-
run: java -fullversion 2>&1 | grep '1.8'
47+
- name: Verify JDK11
48+
# Default JDK varies depending on different runner flavors, make sure we are on 11
49+
# Run a check that exits with error unless it is 11 version to future-proof against unexpected upgrades
50+
run: java -fullversion 2>&1 | grep '11.0'
5551
shell: bash
5652

5753
- name: Gradle Cache

.github/workflows/publish.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
release_app:
88
name: 'Release App'
9-
timeout-minutes: 20
9+
timeout-minutes: 40
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
@@ -17,10 +17,15 @@ jobs:
1717
path: ~/.gradle/caches
1818
key: gradle-${{ hashFiles('**/*.gradle*') }}-v1
1919

20-
- name: Verify JDK 1.8
21-
# OpenJDK1.8 is the default in GitHub macOS 10.15 runner, setup is not required
22-
# Run a check that exits with error unless it is 1.8 version to future-proof against unexpected upgrades
23-
run: java -fullversion 2>&1 | grep '1.8'
20+
- name: Configure JDK 1.11
21+
uses: actions/setup-java@v1
22+
with:
23+
java-version: "11" # ubuntu-latest is about to default to 11, force it everywhere
24+
25+
- name: Verify JDK11
26+
# Default JDK varies depending on different runner flavors, make sure we are on 11
27+
# Run a check that exits with error unless it is 11 version to future-proof against unexpected upgrades
28+
run: java -fullversion 2>&1 | grep '11.0'
2429
shell: bash
2530

2631
- name: Install Release Utilities

.github/workflows/tests_emulator.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ jobs:
3636
EMULATOR_COMMAND: "-avd TestingAVD -noaudio -gpu swiftshader_indirect -camera-back none -no-snapshot -no-window -no-boot-anim -nojni -memory 2048 -timezone 'Europe/London' -cores 2"
3737
EMULATOR_EXECUTABLE: qemu-system-x86_64-headless
3838
steps:
39-
- uses: styfle/cancel-workflow-action@0.6.0
40-
with:
41-
access_token: ${{ github.token }}
39+
- uses: styfle/cancel-workflow-action@0.8.0
4240

4341
- uses: actions/checkout@v2
4442
with:
@@ -50,10 +48,15 @@ jobs:
5048
path: ~/.gradle/caches
5149
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-v1
5250

53-
- name: Verify JDK 1.8
54-
# OpenJDK1.8 is the default in GitHub macOS 10.15 runner, setup is not required
55-
# Run a check that exits with error unless it is 1.8 version to future-proof against unexpected upgrades
56-
run: java -fullversion 2>&1 | grep '1.8'
51+
- name: Configure JDK 1.11
52+
uses: actions/setup-java@v1
53+
with:
54+
java-version: "11" # ubuntu-latest is about to default to 11, force it everywhere
55+
56+
- name: Verify JDK11
57+
# Default JDK varies depending on different runner flavors, make sure we are on 11
58+
# Run a check that exits with error unless it is 11 version to future-proof against unexpected upgrades
59+
run: java -fullversion 2>&1 | grep '11.0'
5760
shell: bash
5861

5962
- name: Warm Gradle Cache
@@ -72,10 +75,10 @@ jobs:
7275
timeout_minutes: 10
7376
retry_wait_seconds: 60
7477
max_attempts: 3
75-
command: echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install "system-images;android-30;google_apis;x86_64"
78+
command: echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "system-images;android-30;google_apis;x86_64"
7679

7780
- name: Create Emulator
78-
run: echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd --force --name TestingAVD --device "Nexus 5X" -k 'system-images;android-30;google_apis;x86_64' -g google_apis
81+
run: echo "no" | $ANDROID_HOME/cmdline-tools/latest/bin//avdmanager create avd --force --name TestingAVD --device "Nexus 5X" -k 'system-images;android-30;google_apis;x86_64' -g google_apis
7982

8083
# These Emulator start steps are the current best practice to do retries on multi-line commands with persistent (nohup) processes
8184
- name: Start Android Emulator

.github/workflows/tests_unit.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,21 @@ jobs:
3535
#env:
3636
# CODACY_TOKEN: ${{ secrets.CODACY_TOKEN }}
3737
steps:
38-
- uses: styfle/cancel-workflow-action@0.6.0
39-
with:
40-
access_token: ${{ github.token }}
38+
- uses: styfle/cancel-workflow-action@0.8.0
4139

4240
- uses: actions/checkout@v2
4341
with:
4442
fetch-depth: 50
4543

46-
- name: Configure JDK 1.8
44+
- name: Configure JDK 1.11
4745
uses: actions/setup-java@v1
4846
with:
49-
java-version: '8' # ubuntu-latest is about to default to 11, force 8
47+
java-version: "11" # ubuntu-latest is about to default to 11, force it everywhere
5048

51-
- name: Verify JDK 1.8
52-
# OpenJDK1.8 is the default in GitHub macOS 10.15 runner, setup is not required
53-
# On ubuntu-latest it is OpenJDK1.8 but is about to switch, so we should setup
54-
# It may be required on other runners though
55-
# Run a check that exits with error unless it is 1.8 version to future-proof against unexpected upgrades
56-
run: java -fullversion 2>&1 | grep '1.8'
49+
- name: Verify JDK11
50+
# Default JDK varies depending on different runner flavors, make sure we are on 11
51+
# Run a check that exits with error unless it is 11 version to future-proof against unexpected upgrades
52+
run: java -fullversion 2>&1 | grep '11.0'
5753
shell: bash
5854

5955
- name: Gradle Cache

AnkiDroid/build.gradle

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ android {
5050
//
5151
// This ensures the correct ordering between the various types of releases (dev < alpha < beta < release) which is
5252
// needed for upgrades to be offered correctly.
53-
versionCode=21500130
54-
versionName="2.15alpha30"
53+
versionCode=21500137
54+
versionName="2.15alpha37"
5555
minSdkVersion 21
5656
//noinspection OldTargetApi - also performed in api/build.fradle
5757
targetSdkVersion 29 // change .travis.yml platform download at same time
@@ -154,6 +154,7 @@ android {
154154
preDexLibraries = preDexEnabled && !ciBuild
155155
}
156156
compileOptions {
157+
coreLibraryDesugaringEnabled true
157158
sourceCompatibility JavaVersion.VERSION_1_8
158159
targetCompatibility JavaVersion.VERSION_1_8
159160
}
@@ -216,15 +217,18 @@ dependencies {
216217
}
217218
}
218219

220+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.9'
219221
compileOnly 'org.jetbrains:annotations:20.1.0'
220222
compileOnly "com.google.auto.service:auto-service-annotations:1.0-rc7"
221223
annotationProcessor "com.google.auto.service:auto-service:1.0-rc7"
222224

223225
implementation fileTree(dir: 'libs', include: ['*.jar'])
224-
implementation 'androidx.annotation:annotation:1.1.0'
225-
implementation 'androidx.appcompat:appcompat:1.2.0'
226+
implementation 'androidx.activity:activity:1.2.2'
227+
implementation 'androidx.annotation:annotation:1.2.0'
228+
implementation 'androidx.appcompat:appcompat:1.3.0-rc01'
226229
implementation 'androidx.browser:browser:1.3.0'
227230
implementation 'androidx.exifinterface:exifinterface:1.3.2'
231+
implementation 'androidx.fragment:fragment:1.3.2'
228232
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
229233
implementation "androidx.preference:preference:1.1.1"
230234
implementation 'androidx.recyclerview:recyclerview:1.1.0'
@@ -243,7 +247,7 @@ dependencies {
243247
// build with ./gradlew rsdroid:assembleRelease
244248
// In my experience, using `files()` currently requires a reindex operation, which is slow.
245249
// implementation files("C:\\GitHub\\Rust-Test\\rsdroid\\build\\outputs\\aar\\rsdroid-release.aar")
246-
implementation 'com.google.protobuf:protobuf-java:3.15.3' // This is required when loading from a file
250+
implementation 'com.google.protobuf:protobuf-java:3.15.6' // This is required when loading from a file
247251
implementation "io.github.david-allison-1:anki-android-backend:$backendVersion"
248252
// build with ./gradlew rsdroid-testing:assembleRelease
249253
// RobolectricTest.java: replace RustBackendLoader.init(); with RustBackendLoader.loadRsdroid(path);
@@ -262,9 +266,9 @@ dependencies {
262266
// io.github.java-diff-utils:java-diff-utils is the natural successor here, but requires API24, #7091
263267
implementation 'org.bitbucket.cowwoc:diff-match-patch:1.2'
264268
implementation 'org.apache.commons:commons-compress:1.12' // #6419 - handle >2GB apkg files
269+
implementation 'org.apache.commons:commons-collections4:4.4' // SetUniqueList
265270
implementation 'net.mikehardy:google-analytics-java7:2.0.13'
266-
//noinspection GradleDependency NewerVersionAvailable
267-
implementation 'com.squareup.okhttp3:okhttp:3.12.12'
271+
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
268272
implementation 'com.arcao:slf4j-timber:3.1'
269273
implementation 'com.jakewharton.timber:timber:4.7.1'
270274
implementation 'org.jsoup:jsoup:1.13.1'
@@ -281,10 +285,7 @@ dependencies {
281285
testImplementation 'androidx.test:core:1.3.0'
282286
testImplementation 'androidx.test.ext:junit:1.1.2'
283287
// debugImplementation required vs testImplementation: https://issuetracker.google.com/issues/128612536
284-
debugImplementation("androidx.fragment:fragment-testing:1.2.5") {
285-
// monitor dep constrained to 1.2 by fragment-testing, 1.3+ is needed: https://github.com/android/android-test/issues/481
286-
exclude group:'androidx.test', module:'monitor'
287-
}
288+
debugImplementation 'androidx.fragment:fragment-testing:1.3.2'
288289

289290
// May need a resolution strategy for support libs to our versions
290291
androidTestImplementation 'com.azimolabs.conditionwatcher:conditionwatcher:0.2'

AnkiDroid/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
android:banner="@drawable/tv_banner"
6868
android:requestLegacyExternalStorage="true"
6969
android:resizeableActivity="true"
70+
android:supportsRtl="true"
7071
>
7172
<activity
7273
android:name="com.ichi2.anki.IntentHandler"

0 commit comments

Comments
 (0)