Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to use Anki 2.1.54's code #202

Merged
merged 61 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
a8649ed
Migrate most rsdroid code into rslib patch
dae Jun 16, 2022
6fb558a
Update majority of remaining source files to Kotlin; address test fai…
dae Jun 16, 2022
be9cbf6
BackendV1 -> Backend
dae Jun 15, 2022
1e13e6f
Use messages for certain backend inputs
dae Jun 16, 2022
cb6cbaa
Unpack single-field outputs like desktop
dae Jun 16, 2022
9bfe3d2
Generate translation accessors as part of the build
dae Jun 16, 2022
3a37197
Add i18n submodule in new path
dae Jun 16, 2022
179da19
Automatically update submodule as part of i18n build
dae Jun 16, 2022
96299a3
Update Rust version in build scripts
dae Jun 16, 2022
d05c0e9
Mention stringcase requirement; add to CI
dae Jun 16, 2022
93e90e8
Use the pinned submodule commit, not branch head
dae Jun 16, 2022
c8111ee
Remove fluent.proto upload/download step; some tweaks to the docs
dae Jun 16, 2022
c938d3e
Install+upgrade protobuf
dae Jun 16, 2022
3476441
Update rslib commit
dae Jun 16, 2022
fc2e373
Setup linker symlink on Linux roboelectric test
dae Jun 16, 2022
1408efd
Bump version number
dae Jun 16, 2022
10d6fa0
Remove unused JsonDatabaseCursor
dae Jun 17, 2022
cfd2685
Fix warnings and some lints
dae Jun 17, 2022
2c7cdaa
Tweak version
dae Jun 17, 2022
0e489f2
Update Rust libs
dae Jun 17, 2022
70999d5
Interface tidy-ups
dae Jun 18, 2022
8b2d06e
Bump version
dae Jun 18, 2022
80b60f7
Update easy-testing instructions
dae Jun 19, 2022
5499f2f
Convert RustBackendLoader to Kotlin
dae Jun 19, 2022
ec0226b
Fix /tmp filling up with librsdroid copies
dae Jun 19, 2022
2ed5c23
Stream library to avoid Windows test OOM
dae Jun 19, 2022
ef3ddae
Fix extraction of panic strings
dae Jun 19, 2022
7794f3f
Add buildinfo.txt file
dae Jun 19, 2022
1bcd7e7
Skip outer lock for routines that do not touch the DB
dae Jun 19, 2022
1ef4484
Send logs from the backend to the Android log
dae Jun 19, 2022
c9903eb
Reduce logging verbosity
dae Jun 19, 2022
9794ba9
Enable media handling in new backend
dae Jun 19, 2022
c05e6d1
Tweaks for Robolectric case
dae Jun 21, 2022
2780dfb
Make it easier to switch between local testing and full build
dae Jun 21, 2022
57769a9
Make it easier to use a venv
dae Jun 21, 2022
2768c42
Rename easy-testing, tweak docs
dae Jun 21, 2022
4c3eea4
Use zip of desktop artifacts in build
dae Jun 21, 2022
60a4233
Revert "Use zip of desktop artifacts in build"
dae Jun 21, 2022
1a2afad
Remove Python 3.8 syntax, allowing CI build to work
dae Jun 21, 2022
41cc1f5
Exclude awaitBackupCompletion from mutex
dae Jun 21, 2022
dd19004
Log stdout/stderr to ease println() debugging
dae Jun 22, 2022
f65cd99
Add script to run tests on current platform/sim
dae Jun 22, 2022
4ce057b
Update rslib for backup fix
dae Jun 22, 2022
1760ab9
Ignore s_glBindAttribLocation lines from sim
dae Jun 23, 2022
75e19bd
Warn when executing SQL statements on main thread; remove other logging
dae Jun 23, 2022
6955d8d
Report backend requests that happen on UI thread
dae Jun 23, 2022
bd65477
Log caller for SQL statements
dae Jun 24, 2022
5d29116
Fix oneof detection in code generation script
dae Jun 25, 2022
21a43f5
Support customizing log level (see follow-up commit in AnkiDroid repo)
dae Jun 26, 2022
8c024b5
Update OVERVIEW.md
dae Jun 26, 2022
442db0a
Enable Kotlin extensions to generated protobuf
dae Jun 27, 2022
cd1f797
Add two more language maps
dae Jun 27, 2022
43fa4dc
Check Bazel is installed
dae Jun 27, 2022
c6bf63b
Clarify venv+pip
dae Jun 27, 2022
d5c26f4
Use connectedAndroidTest
dae Jun 27, 2022
d70ded0
Add stringcase to doctor
dae Jun 27, 2022
979695c
Remove unused branch label from .gitmodules
dae Jun 27, 2022
3e3f0af
Update rslib commit to Mike's rebase
dae Jun 27, 2022
b1114d8
Update to Anki 2.1.54
dae Jun 27, 2022
8714da7
Fetch new changes before trying to switch commits
dae Jun 27, 2022
bf699dc
Bump protobuf version
dae Jun 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[env]
RSLIB_FTL_ROOT = { value = "ftl/core/l10n.toml", relative = true }
BUILDINFO = { value = "rslib-bridge/buildinfo.txt", relative = true }
BAZEL = "1"
96 changes: 50 additions & 46 deletions .github/workflows/linux_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,60 +15,64 @@ jobs:
timeout-minutes: 80
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Fetch submodules
run: git submodule update --init --recursive --remote --force
- name: Fetch submodules
run: git submodule update --init --recursive

- name: Configure JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11" # minimum for Android API31
- name: Configure JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11" # minimum for Android API31

- name: Install Android Command Line Tools
uses: android-actions/setup-android@v2
- name: Install Android Command Line Tools
uses: android-actions/setup-android@v2

# COULD_BE_BETTER: Consider turning this into a GitHub action - help the wider community
# NDK install (unzipping) is really noisy - silence the log spam with grep, while keeping errors
- name: Install NDK (silent)
run: .github/scripts/install_ndk.sh 22.0.7026061
# COULD_BE_BETTER: Consider turning this into a GitHub action - help the wider community
# NDK install (unzipping) is really noisy - silence the log spam with grep, while keeping errors
- name: Install NDK (silent)
run: .github/scripts/install_ndk.sh 22.0.7026061

- name: Install linker
run: .github/scripts/linux_install_x86_64-unknown-linux-gnu-gcc.sh
- name: Install linker
run: .github/scripts/linux_install_x86_64-unknown-linux-gnu-gcc.sh

# install cargo
- name: Install Rust
uses: actions-rs/[email protected]
with:
toolchain: 1.54.0
override: true
components: rustfmt
# install cargo
- name: Install Rust
uses: actions-rs/[email protected]
with:
toolchain: 1.58.1
override: true
components: rustfmt

# actions-rs only accepts "target" (although a "targets" param to be added in v2). We need 7 targets.
- name: Install Rust Targets
run: .github/scripts/install_rust_targets.sh
# actions-rs only accepts "target" (although a "targets" param to be added in v2). We need 7 targets.
- name: Install Rust Targets
run: .github/scripts/install_rust_targets.sh

- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Rust Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
rslib-bridge/target
key: ${{ runner.os }}-rust-v1-assembleRelease-${{ hashFiles('rslib-bridge/**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-rust-v1-assembleRelease
${{ runner.os }}-rust-v1
- name: Install Python libs
run: |
pip3 install --upgrade protobuf stringcase

- name: Build
run: ./gradlew clean assembleRelease -DtestBuildType=release -Dorg.gradle.daemon=false -Dorg.gradle.console=plain # assembleAndroidTest
- name: Rust Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
rslib-bridge/target
key: ${{ runner.os }}-rust-v1-assembleRelease-${{ hashFiles('rslib-bridge/**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-rust-v1-assembleRelease
${{ runner.os }}-rust-v1

# Our publish workflow (publish_library.yaml) is on Ubuntu and needs javadocs (#57)
- name: Test Javadoc
run: ./gradlew :rsdroid:androidJavadocs -DtestBuildType=release -Dorg.gradle.daemon=false -Dorg.gradle.console=plain
- name: Build
run: ./gradlew clean assembleRelease -DtestBuildType=release -Dorg.gradle.daemon=false -Dorg.gradle.console=plain # assembleAndroidTest

# Our publish workflow (publish_library.yaml) is on Ubuntu and needs javadocs (#57)
- name: Test Javadoc
run: ./gradlew :rsdroid:androidJavadocs -DtestBuildType=release -Dorg.gradle.daemon=false -Dorg.gradle.console=plain
199 changes: 99 additions & 100 deletions .github/workflows/macos_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,72 +16,71 @@ jobs:
runs-on: macos-latest
timeout-minutes: 80
steps:
- uses: actions/checkout@v2

- name: Fetch submodules
run: git submodule update --init --recursive --remote --force

- name: Configure JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11" # minimum for Android API31

- name: Install Android Command Line Tools
uses: android-actions/setup-android@v2

- name: Install NDK
run: .github/scripts/install_ndk.sh 22.0.7026061

- name: Test NDK
run: echo "NDK set to $ANDROID_NDK_HOME"

- name: Install Rust
uses: actions-rs/[email protected]
with:
toolchain: 1.54.0
override: true
components: rustfmt

# actions-rs only accepts "target" (although a "targets" param to be added in v2). We need 7 targets.
- name: Install Rust Targets
run: .github/scripts/install_rust_targets.sh

- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install & Test Protobuf Compiler
run: |
pip3 install protobuf
python3 .github/scripts/protoc_gen_deps.py

- name: Rust Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
rslib-bridge/target
key: ${{ runner.os }}-rust-v1-assembleDebug-${{ hashFiles('rslib-bridge/**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-rust-v1-assembleDebug
${{ runner.os }}-rust-v1

- name: Build
run: ./gradlew clean assembleDebug -DtestBuildType=debug -Dorg.gradle.daemon=false -Dorg.gradle.console=plain

- name: Build Instrumented Test APKs
run: ./gradlew rsdroid-instrumented:assembleDebug rsdroid-instrumented:assembleAndroidTest -DtestBuildType=debug -Dorg.gradle.daemon=false -Dorg.gradle.console=plain

- name: Upload APKs as Artifact
uses: actions/upload-artifact@v2
with:
name: rsdroid-instrumented
if-no-files-found: error
path: rsdroid-instrumented/build/outputs/apk

- uses: actions/checkout@v2

- name: Fetch submodules
run: git submodule update --init --recursive

- name: Configure JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11" # minimum for Android API31

- name: Install Android Command Line Tools
uses: android-actions/setup-android@v2

- name: Install NDK
run: .github/scripts/install_ndk.sh 22.0.7026061

- name: Test NDK
run: echo "NDK set to $ANDROID_NDK_HOME"

- name: Install Rust
uses: actions-rs/[email protected]
with:
toolchain: 1.58.1
override: true
components: rustfmt

# actions-rs only accepts "target" (although a "targets" param to be added in v2). We need 7 targets.
- name: Install Rust Targets
run: .github/scripts/install_rust_targets.sh

- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install & Test Protobuf Compiler
run: |
pip3 install --upgrade protobuf stringcase
python3 .github/scripts/protoc_gen_deps.py

- name: Rust Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
rslib-bridge/target
key: ${{ runner.os }}-rust-v1-assembleDebug-${{ hashFiles('rslib-bridge/**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-rust-v1-assembleDebug
${{ runner.os }}-rust-v1

- name: Build
run: ./gradlew clean assembleDebug -DtestBuildType=debug -Dorg.gradle.daemon=false -Dorg.gradle.console=plain

- name: Build Instrumented Test APKs
run: ./gradlew rsdroid-instrumented:assembleDebug rsdroid-instrumented:assembleAndroidTest -DtestBuildType=debug -Dorg.gradle.daemon=false -Dorg.gradle.console=plain

- name: Upload APKs as Artifact
uses: actions/upload-artifact@v2
with:
name: rsdroid-instrumented
if-no-files-found: error
path: rsdroid-instrumented/build/outputs/apk

test:
needs: build
Expand All @@ -93,37 +92,37 @@ jobs:
api-level: [21]
arch: [x86, x86_64] # arm and arm64 are not supported by reactivecircus/android-emulator-runner
steps:
- uses: actions/checkout@v2
name: Checkout

# COULD_BE_BETTER: This may not be needed - tiny speed penalty
- name: Fetch submodules
run: git submodule update --init --recursive --remote --force

- name: Download APKs
uses: actions/download-artifact@v2
with:
name: rsdroid-instrumented
path: rsdroid-instrumented/build/outputs/apk

- name: Configure JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11" # minimum for Android API31

- name: Install Android Command Line Tools
uses: android-actions/setup-android@v2

- name: Install NDK
run: .github/scripts/install_ndk.sh 22.0.7026061

- name: run tests
uses: reactivecircus/android-emulator-runner@v2
timeout-minutes: 30
with:
api-level: ${{ matrix.api-level }}
target: default
arch: ${{ matrix.arch }}
profile: Nexus 6
script: ./gradlew rsdroid-instrumented:connectedCheck -x rsdroid-instrumented:packageDebugAndroidTest -x rsdroid-instrumented:packageDebug
- uses: actions/checkout@v2
name: Checkout

# COULD_BE_BETTER: This may not be needed - tiny speed penalty
- name: Fetch submodules
run: git submodule update --init --recursive

- name: Download APKs
uses: actions/download-artifact@v2
with:
name: rsdroid-instrumented
path: rsdroid-instrumented/build/outputs/apk

- name: Configure JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11" # minimum for Android API31

- name: Install Android Command Line Tools
uses: android-actions/setup-android@v2

- name: Install NDK
run: .github/scripts/install_ndk.sh 22.0.7026061

- name: run tests
uses: reactivecircus/android-emulator-runner@v2
timeout-minutes: 30
with:
api-level: ${{ matrix.api-level }}
target: default
arch: ${{ matrix.arch }}
profile: Nexus 6
script: ./gradlew rsdroid-instrumented:connectedCheck -x rsdroid-instrumented:packageDebugAndroidTest -x rsdroid-instrumented:packageDebug
Loading