Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Support 2.1.53 desktop version #2

Merged
merged 8 commits into from
Jun 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 34 additions & 0 deletions .github/workflows/anki_artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build web/build artifacts from upstream
on:
workflow_dispatch:
push:
schedule:
- cron: "0 0 * * *"
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 80
steps:
- uses: actions/checkout@v2

# todo: cache bazel folder

- name: Build artifacts
run: |
curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.10.1/bazelisk-linux-amd64 -o ./bazel
chmod +x bazel
export PATH=$(pwd):"$PATH"
./tools/build-ankidroid-artifacts.sh

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: anki_artifacts
if-no-files-found: error
path: anki_artifacts.zip
71 changes: 71 additions & 0 deletions proto/anki/ankidroid.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
syntax = "proto3";

option java_multiple_files = true;

import "anki/generic.proto";
import "anki/scheduler.proto";

package anki.ankidroid;

service AnkidroidService {
rpc SchedTimingTodayLegacy (SchedTimingTodayLegacyRequest) returns (scheduler.SchedTimingTodayResponse);
rpc LocalMinutesWestLegacy (generic.Int64) returns (generic.Int32);
rpc RunDbCommand(generic.Json) returns (generic.Json);
rpc RunDbCommandProto(generic.Json) returns (DBResponse);
rpc InsertForId(generic.Json) returns (generic.Int64);
rpc RunDbCommandForRowCount(generic.Json) returns (generic.Int64);
rpc FlushAllQueries(generic.Empty) returns (generic.Empty);
rpc FlushQuery(generic.Int32) returns (generic.Empty);
rpc GetNextResultPage(GetNextResultPageRequest) returns (DBResponse);
rpc SetPageSize(generic.Int64) returns (generic.Empty);
rpc GetColumnNamesFromQuery(generic.String) returns (generic.StringList);
rpc GetActiveSequenceNumbers(generic.Empty) returns (GetActiveSequenceNumbersResponse);
rpc DebugProduceError(generic.String) returns (generic.Empty);
}

message DebugActiveDatabaseSequenceNumbersResponse {
repeated int32 sequence_numbers = 1;
}

message SchedTimingTodayLegacyRequest {
int64 created_secs = 1;
sint32 created_mins_west = 2;
int64 now_secs = 3;
sint32 now_mins_west = 4;
sint32 rollover_hour = 5;
}

// We expect in Java: Null, String, Short, Int, Long, Float, Double, Boolean, Blob (unused)
// We get: DbResult (Null, String, i64, f64, Vec<u8>), which matches SQLite documentation
message SqlValue {
oneof Data {
string stringValue = 1;
int64 longValue = 2;
double doubleValue = 3;
bytes blobValue = 4;
}
}

message Row {
repeated SqlValue fields = 1;
}

message DbResult {
repeated Row rows = 1;
}

message DBResponse {
DbResult result = 1;
int32 sequenceNumber = 2;
int32 rowCount = 3;
int64 startIndex = 4;
}

message GetNextResultPageRequest {
int32 sequence = 1;
int64 index = 2;
}

message GetActiveSequenceNumbersResponse {
repeated int32 numbers = 1;
}
5 changes: 5 additions & 0 deletions proto/anki/backend.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option java_multiple_files = true;

package anki.backend;

import "anki/links.proto";
Expand All @@ -28,6 +30,8 @@ enum ServiceIndex {
SERVICE_INDEX_CARDS = 14;
SERVICE_INDEX_LINKS = 15;
SERVICE_INDEX_IMPORT_EXPORT = 16;

SERVICE_INDEX_ANKIDROID = 99;
}

message BackendInit {
Expand Down Expand Up @@ -62,6 +66,7 @@ message BackendError {
IMPORT_ERROR = 16;
DELETED = 17;
CARD_TYPE_ERROR = 18;
FATAL_ERROR = 99;
}

// localized error description suitable for displaying to the user
Expand Down
2 changes: 2 additions & 0 deletions proto/anki/card_rendering.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option java_multiple_files = true;

package anki.card_rendering;

import "anki/generic.proto";
Expand Down
2 changes: 2 additions & 0 deletions proto/anki/cards.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option java_multiple_files = true;

package anki.cards;

import "anki/generic.proto";
Expand Down
4 changes: 4 additions & 0 deletions proto/anki/collection.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option java_multiple_files = true;

package anki.collection;

import "anki/generic.proto";
Expand Down Expand Up @@ -33,6 +35,8 @@ message OpenCollectionRequest {
string media_folder_path = 2;
string media_db_path = 3;
string log_path = 4;

bool force_schema11 = 99;
}

message CloseCollectionRequest {
Expand Down
2 changes: 2 additions & 0 deletions proto/anki/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option java_multiple_files = true;

package anki.config;

import "anki/generic.proto";
Expand Down
9 changes: 9 additions & 0 deletions proto/anki/deckconfig.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@

syntax = "proto3";

option java_multiple_files = true;

// "The file's outer class name, "Deckconfig", matches the name of one of the
// types declared inside it when case is ignored. This can cause compilation
// issues on Windows / MacOS. Please either rename the type or use the
// java_outer_classname option to specify a different outer class name for the
// .proto file to be safe."
option java_outer_classname = "DeckConf";

package anki.deckconfig;

import "anki/generic.proto";
Expand Down
2 changes: 2 additions & 0 deletions proto/anki/decks.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option java_multiple_files = true;

package anki.decks;

import "anki/generic.proto";
Expand Down
2 changes: 2 additions & 0 deletions proto/anki/generic.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option java_multiple_files = true;

package anki.generic;

message Empty {}
Expand Down
2 changes: 2 additions & 0 deletions proto/anki/i18n.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option java_multiple_files = true;

package anki.i18n;

import "anki/generic.proto";
Expand Down
2 changes: 2 additions & 0 deletions proto/anki/import_export.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option java_multiple_files = true;

package anki.import_export;

import "anki/collection.proto";
Expand Down
2 changes: 2 additions & 0 deletions proto/anki/links.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option java_multiple_files = true;

package anki.links;

import "anki/generic.proto";
Expand Down
2 changes: 2 additions & 0 deletions proto/anki/media.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option java_multiple_files = true;

package anki.media;

import "anki/generic.proto";
Expand Down
2 changes: 2 additions & 0 deletions proto/anki/notes.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option java_multiple_files = true;

package anki.notes;

import "anki/notetypes.proto";
Expand Down
2 changes: 2 additions & 0 deletions proto/anki/notetypes.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option java_multiple_files = true;

package anki.notetypes;

import "anki/generic.proto";
Expand Down
2 changes: 2 additions & 0 deletions proto/anki/scheduler.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option java_multiple_files = true;

package anki.scheduler;

import "anki/generic.proto";
Expand Down
2 changes: 2 additions & 0 deletions proto/anki/search.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option java_multiple_files = true;

package anki.search;

import "anki/generic.proto";
Expand Down
2 changes: 2 additions & 0 deletions proto/anki/stats.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option java_multiple_files = true;

package anki.stats;

import "anki/generic.proto";
Expand Down
2 changes: 2 additions & 0 deletions proto/anki/sync.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option java_multiple_files = true;

package anki.sync;

import "anki/generic.proto";
Expand Down
2 changes: 2 additions & 0 deletions proto/anki/tags.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

syntax = "proto3";

option java_multiple_files = true;

package anki.tags;

import "anki/generic.proto";
Expand Down
1 change: 1 addition & 0 deletions rslib/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Cargo.lock
.build
.idea/
target
1 change: 0 additions & 1 deletion rslib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ reqwest = { git="https://github.com/ankitects/reqwest.git", rev="7591444614de02b
"stream",
"multipart",
# the Bazel build scripts separate these out by platform
"native-tls",
"rustls-tls",
"rustls-tls-webpki-roots",
"rustls-tls-native-roots",
Expand Down
Loading