support aqt-specific FTL files

This commit is contained in:
Damien Elmes 2020-02-23 18:00:13 +10:00
parent 515623a293
commit 7230b6e390
6 changed files with 31 additions and 6 deletions

View File

@ -25,7 +25,6 @@ PROTODEPS := $(wildcard ../proto/*.proto)
.build/py-proto: .build/dev-deps $(PROTODEPS)
protoc --proto_path=../proto --python_out=anki --mypy_out=anki $(PROTODEPS)
# fixup import path
perl -i'' -pe 's/from fluent_pb2/from anki.fluent_pb2/' anki/backend_pb2.pyi
perl -i'' -pe 's/import fluent_pb2/import anki.fluent_pb2/' anki/backend_pb2.py
@touch $@

1
qt/ftl/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
repo

View File

@ -0,0 +1,9 @@
#!/bin/bash
echo "Downloading latest translations..."
if [ ! -d repo ]; then
git clone https://github.com/ankitects/anki-desktop-ftl repo
fi
(cd repo && git pull)

View File

@ -0,0 +1,9 @@
#!/bin/bash
#
# expects to be run from the ftl folder
#
test -d repo || exit 1
rsync -av --delete *.ftl repo/desktop/templates/
(cd repo && git add desktop; git commit -m update; git push)

View File

@ -23,7 +23,7 @@ develop: .build/vernum ftl/repo
ftl/repo:
(cd ftl && ./scripts/fetch-latest-translations)
ALL_SOURCE := $(find src -type f) $(wildcard ftl/*.ftl)
ALL_SOURCE := $(shell find src -type f) $(wildcard ftl/*.ftl)
# nightly currently required for ignoring files in rustfmt.toml
RUST_TOOLCHAIN := $(shell cat rust-toolchain)

View File

@ -9,16 +9,23 @@ $(shell mkdir -p .build ../dist)
OUTDIR := ../dist
BUILDFLAGS := --release --strip
FTLS := ../qt/ftl
.PHONY: all develop build check fix clean
all: develop
develop: .build/tools .build/vernum
maturin develop $(BUILDFLAGS)
develop: .build/develop
build: .build/tools .build/vernum
.build/develop: .build/tools .build/vernum $(wildcard $(FTLS)/*.ftl)
touch ../proto/backend.proto
FTL_TEMPLATE_DIRS="$(FTLS)" maturin develop $(BUILDFLAGS)
touch $@
build: .build/tools .build/vernum $(wildcard $(FTLS)/*.ftl)
rm -rf $(OUTDIR)/ankirspy*
maturin build -i $(shell which python3) -o $(OUTDIR) $(BUILDFLAGS)
touch ../proto/backend.proto
FTL_TEMPLATE_DIRS="$(FTLS)" maturin build -i $(shell which python3) -o $(OUTDIR) $(BUILDFLAGS)
check: .build/check