Skip to content

Commit

Permalink
WIP: Add endless-key-kolibri-home to build output
Browse files Browse the repository at this point in the history
To enable this, we need to install `kolibri` in the build systme. It is
used to generate a Kolibri home with content from a provided content
manifest.

Helps: endlessm/endless-key-content-private#97
  • Loading branch information
dylanmccall committed Sep 27, 2023
1 parent 601a04d commit 1ed63dc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ CLEAN_DEPS = \
clean-kolibri \
clean-apps-bundle \
clean-collections \
clean-endless-key-kolibri-home \
clean-local-kolibri-explore-plugin \
clean-loadingScreen
CLEAN_FILES = \
Expand Down Expand Up @@ -145,6 +146,20 @@ clean-apps-bundle:
src/apps-bundle: clean-apps-bundle apps-bundle.zip
unzip -qo apps-bundle.zip -d src/apps-bundle

.PHONY: clean-endless-key-kolibri-home
clean-endless-key-kolibri-home:
- rm -rf src/kolibri/dist/home

# This is phony because we are replacing existing files inside src/kolibri :(
.PHONY: src/kolibri/dist/home
src/kolibri/dist/home: src/collections src/kolibri
export KOLIBRI_HOME=src/kolibri/dist/home
rm -rf ${KOLIBRI_HOME}
kolibri manage migrate
cat src/collections/artist-0001.json | jq '.channels[] | .id' | xargs -n1 echo kolibri manage importchannel network
cat src/collections/artist-0001.json | jq '.channels[] | .id' | xargs -n1 echo kolibri manage importcontent --manifest=src/collections/artist-0001.json network
yes 'yes' | kolibri manage deprovision

.PHONY: collections.zip
collections.zip:
wget -N https://github.com/endlessm/endless-key-collections/releases/latest/download/collections.zip
Expand Down Expand Up @@ -193,6 +208,7 @@ DIST_DEPS = \
src/kolibri \
src/apps-bundle \
src/collections \
src/kolibri/dist/home \
assets/loadingScreen \
needs-version \
dist/version.json
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cython~=0.29
virtualenv
git+https://github.com/endlessm/python-for-android@v2022.09.04-endless10#egg=python-for-android
kolibri
3 changes: 3 additions & 0 deletions src/kolibri_android/kolibri_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ def _init_kolibri_env():
os.environ["KOLIBRI_CONTENT_COLLECTIONS_PATH"] = SCRIPT_PATH.joinpath(
"collections"
).as_posix()
os.environ["KOLIBRI_CONTENT_FALLBACK_DIRS"] = SCRIPT_PATH.joinpath(
"kolibri", "dist", "home", "content"
).as_posix()

node_id = get_android_node_id()

Expand Down

0 comments on commit 1ed63dc

Please sign in to comment.