Compare commits

...

43 Commits

Author SHA1 Message Date
Florian du Garage Num
be36969dce remove hard-coded uid 1000
Some checks failed
Sync with private repo / sync (push) Has been cancelled
Run tests / tests (3.12) (push) Has been cancelled
Run tests / tests (3.9) (push) Has been cancelled
2025-09-30 21:37:57 +02:00
Abdul-Muqadim-Arbisoft
25fa14e030
Merge pull request #41 from overhangio/muqadim/migrate-ruff
feat: migrate from pylint/black to ruff
2025-09-15 23:50:48 +05:00
Abdul-Muqadim-Arbisoft
8b682f0902 fix: add one line where file ends
according to pep8 principle missed one line empty priciple at end of file, add that in this commit
2025-09-07 19:50:54 +05:00
Abdul-Muqadim-Arbisoft
a539ca2693 feat: migrate from pylint/black to ruff (#64)
* feat: migrate from pylint/black to ruff
Linked Epic: overhangio/tutor#1251

Some new rules that have been added are:

I: sort imports
N: check for pep8-naming standards
W292: check for missing extra line at EOF

Some of our lines, particularly in config break the 88 character line length limit. For that, we add a # noqa: E501 to let ruff know to ignore the rule for that line

* test: python package distribution build when running make test
Pushing to pypi would occasionally fail because of breaking distribution build.
We verify the build in the github CI now so that we can mitigate those errors later on.

* fix: install ruff instead of pylint/black as optional dev dependency
2025-09-07 19:44:37 +05:00
Ahmed Khalid
cfee151f6b
Merge pull request #40 from overhangio/teak 2025-06-27 17:18:30 +05:00
Abdul-Muqadim-Arbisoft
78b29f1ec6 update changelog 2025-06-10 11:00:15 +05:00
Abdul-Muqadim-Arbisoft
7b4af1f15c v20.0.0 2025-04-06 19:16:47 +05:00
Syed Muhammad Dawoud Sheraz Ali
c2ba1b57fd
build: Add hatch_build in sdist to fix installation issues (#39) 2025-03-12 16:06:59 +05:00
Abdul-Muqadim-Arbisoft
243bbeb79a
Merge pull request #38 from overhangio/muqadim/migrate-to-pyproject
feat: migrate from setup.py/setuptools to pyproject.toml/hatch
2025-03-10 13:05:45 +05:00
Abdul-Muqadim-Arbisoft
05fc54b68d feat: migrate from setup.py/setuptools to pyproject.toml/hatch 2025-02-24 08:26:09 +05:00
Syed Muhammad Dawoud Sheraz Ali
8fa95c708f
build: re-add auto-add for PRs with a different target (#37) 2025-01-17 11:28:18 +05:00
Abdul-Muqadim-Arbisoft
46ed8a91cd
Merge pull request #36 from edly-io/muqadim/change-maintainer
Change maintainer in readme.md and setup.py
2025-01-16 13:11:22 +05:00
Abdul-Muqadim-Arbisoft
8d04f8ac02 Change maintainer in readme.md and setup.py 2025-01-16 12:07:28 +05:00
Régis Behmo
ca03a2f844
v19.0.0 Upgrade to sumac 2024-12-16 20:34:06 +01:00
Abdul-Muqadim-Arbisoft
1d87ec5193 chore: removing hard coded platform name value (#31) 2024-12-09 18:19:39 +05:00
Abdul-Muqadim-Arbisoft
5d2e945a15 chore: Replace Hardcoded PLATFORM_NAME with Configuration Variable (#29) 2024-12-09 18:19:39 +05:00
Abdul-Muqadim-Arbisoft
bef534a00d v19.0.0 Upgrade to sumac 2024-12-09 18:19:39 +05:00
Overhang.IO
aa1c67a6a3 Merge remote-tracking branch 'origin/release' 2024-11-28 09:33:35 +00:00
Régis Behmo
b7af7ba707 v18.0.1 2024-11-28 10:32:41 +01:00
Overhang.IO
d43952befb Merge remote-tracking branch 'origin/release' 2024-11-28 09:25:19 +00:00
Abdul-Muqadim-Arbisoft
cb789e8604 feat: ubuntu 24.04 upgrade
Close #34.
2024-11-28 10:21:14 +01:00
Régis Behmo
af56259343 Merge branch 'release' 2024-11-27 18:35:01 +01:00
Syed Muhammad Dawoud Sheraz Ali
519062a168 feat!: Rename branches master->release, nightly->main 2024-11-27 18:33:32 +01:00
Overhang.IO
097ad05609 Merge remote-tracking branch 'origin/master' into nightly 2024-11-14 16:32:58 +00:00
Abdul-Muqadim-Arbisoft
5648bc4829
chore: remove python 3.8 references (#32) 2024-11-14 21:20:40 +05:00
Abdul-Muqadim-Arbisoft
3f19e83300
feat: ubuntu upgrade (#27) 2024-10-28 12:19:26 +05:00
Régis Behmo
96404d74c0 docs: *.local.edly.io -> *.local.openedx.io
The default URL to run a local platform switched from local.edly.io to
local.openedx.io. This changes makes it clearer for everyone that Tutor
is to run Open edX.

See: https://github.com/overhangio/tutor/issues/1120
2024-10-17 08:36:40 +02:00
Régis Behmo
446587b788 ci: upgrade vendor actions 2024-10-03 11:16:24 +02:00
Régis Behmo
b8281e51dc docs: fix author domain name 2024-10-01 09:08:48 +02:00
Muhammad Ali
2dd92f1801
Merge pull request #26 from overhangio/ali/add-maintainer
Add new maintainer in readme.md and setup.py
2024-09-05 12:10:37 +05:00
muhammadali286
dde6ed73dc chore: add Muhammad Ali as maintainer in readme.md and setup.py 2024-09-04 14:33:25 +05:00
Régis Behmo
95d7c74377 build: fix readme content type warning 2024-07-23 10:37:35 +02:00
Régis Behmo
145ac9519a fix: docker build deprecation warnings
With the latest Docker upgrade, we got the following warnings during
build:

	FromAsCasing: 'as' and 'FROM' keywords' casing do not match
	LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format
2024-06-21 17:12:57 +02:00
Régis Behmo
4d4bc48689
Merge pull request #24 from overhangio/redwood
Upgrade to Redwood
2024-06-20 02:50:08 +02:00
Syed Muhammad Dawoud Sheraz Ali
e35b24fd53 v18.0.0 2024-06-20 01:55:21 +02:00
Max Sokolski
13e384484b
feat: apply a new configuration template file (#22)
Source: https://github.com/openedx/openedx-app-android/blob/main/default_config/prod/config.yaml
2024-06-11 12:19:50 +05:00
Hamza Shafique
5f10cfe451
feat: build main branch in nightly 2024-06-11 09:14:33 +02:00
Abdul-Muqadim-Arbisoft
b5d60b812c
Update plugin for compatibility with new openedx mobile repositories and upgrade dependencies (#21) 2024-06-06 16:59:22 +05:00
Régis Behmo
f5f11b8ef6 ci: don't even try to auto-add PRs to github project
Auto-adding PRs to the Github project is not working because the
github-token is not available there.
2024-03-05 12:03:03 +05:00
Régis Behmo
24ed22f36f ci: remove now useless OPENEDX_RELEASE variable 2024-02-20 15:15:41 +01:00
Régis Behmo
ffe3d6bcf9 fix: remove pkg_resources for compatibility with python 3.12
pkg_resources is a package that is unavailable in python 3.12, unless
setuptools is explicitely installed. Turns out, there are replacement
functions coming from importlib_resources, which can be obtained from
the importlib-resources pypi package. This package will be installed
with tutor starting from 17.0.2.
2024-02-12 11:57:51 +01:00
Muhammad Ali
93c9168ff5
ci: support arm64 image building
By removing the IMAGES_BUILD_PLATFORM key from the CI file, the CI script will pick up the default value, which is a cross-platform (linux/amd64,linux/arm64) build.
2024-01-30 09:44:56 +01:00
Régis Behmo
3e697590c3 ci: auto-add issues and items to github project 2024-01-12 12:33:36 +01:00
18 changed files with 306 additions and 139 deletions

View File

@ -0,0 +1,20 @@
name: Auto Add Issues and Pull Requests to Project
on:
issues:
types:
- opened
pull_request_target:
types:
- opened
jobs:
# https://github.com/actions/add-to-project
add-to-project:
name: Add issue and bugs to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v1.0.2
with:
project-url: https://github.com/orgs/overhangio/projects/4
github-token: ${{ secrets.GH_PROJECT_PERSONAL_ACCESS_TOKEN }}

View File

@ -2,13 +2,13 @@ name: Sync with private repo
on:
push:
branches: [ master, main, nightly ]
branches: [ release, main ]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add remote

View File

@ -2,21 +2,24 @@ name: Run tests
on:
pull_request:
branches: [master]
branches: [ release, main ]
push:
branches: [ release, main ]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.12']
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Upgrade pip
run: python -m pip install --upgrade pip setuptools
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install .[dev]
- name: Test lint, types, and format
run: make test
run: make test

View File

@ -2,9 +2,7 @@ variables:
TUTOR_PLUGIN: android
TUTOR_IMAGES: android
TUTOR_PYPI_PACKAGE: tutor-android
OPENEDX_RELEASE: quince
GITHUB_REPO: overhangio/tutor-android
IMAGES_BUILD_PLATFORM: "linux/amd64"
include:
- project: 'community/tutor-ci'

22
.hatch_build.py Normal file
View File

@ -0,0 +1,22 @@
# https://hatch.pypa.io/latest/how-to/config/dynamic-metadata/
import os
import typing as t
from hatchling.metadata.plugin.interface import MetadataHookInterface
HERE = os.path.dirname(__file__)
class MetaDataHook(MetadataHookInterface):
def update(self, metadata: dict[str, t.Any]) -> None:
about = load_about()
metadata["version"] = about["__version__"]
def load_about() -> dict[str, str]:
about: dict[str, str] = {}
with open(
os.path.join(HERE, "tutorandroid", "__about__.py"), "rt", encoding="utf-8"
) as f:
exec(f.read(), about)
return about

View File

@ -19,6 +19,41 @@ instructions, because git commits are used to generate release notes:
<!-- scriv-insert-here -->
<a id='changelog-20.0.0'></a>
## v20.0.0 (2025-06-10)
- [Improvement] Migrate packaging from setup.py/setuptools to pyproject.toml/hatch. (by @Abdul-Muqadim-Arbisoft)
- For more details view tutor core PR: https://github.com/overhangio/tutor/pull/1163
- [Improvement] Add hatch_build.py in sdist target to fix the installation issues (by @dawoudsheraz)
- 💥[Feature] Upgrade to teak. (by @Abdul-Muqadim-Arbisoft)
<a id='changelog-19.0.0'></a>
## v19.0.0 (2024-12-09)
- 💥[Feature] Upgrade to Sumac (by @Abdul-Muqadim-Arbisoft)
<a id='changelog-18.0.1'></a>
## v18.0.1 (2024-11-28)
- [Bugfix] Fix legacy warnings during Docker build. (by @regisb)
- 💥[Feature] Update android image to use Ubuntu `24.04` as base OS. (by @Abdul-Muqadim-Arbisoft)
- 💥 [Deprecation] Drop support for python 3.8 and set Python 3.9 as the minimum supported python version. (by @Abdul-Muqadim-Arbisoft)
- 💥[Improvement] Rename Tutor's two branches (by @DawoudSheraz):
* Rename **master** to **release**, as this branch runs the latest official Open edX release tag.
* Rename **nightly** to **main**, as this branch runs the Open edX master branches, which are the basis for the next Open edX release.
<a id='changelog-18.0.0'></a>
## v18.0.0 (2024-06-20)
- 💥[Feature] Upgrade to redwood (by @dawoudsheraz)
- [Bugfix] Make plugin compatible with Python 3.12 by removing dependency on `pkg_resources`. (by @regisb)
- 💥[Feature] Upgrade the deprecated [edx-app-android](https://github.com/openedx-unsupported/edx-app-android) to [openedx-app-android](https://github.com/openedx/openedx-app-android). (by @hamza-56)
- [Feature] Update the tutor.yaml configuration to align with the new apps default settings. See the default configuration here: [default_config/prod/config.yaml](https://github.com/openedx/openedx-app-android/blob/main/default_config/prod/config.yaml) (by @cmltawt0).
- [Feature] Enhanced `ANDROID_APP_VERSION` logic to dynamically set the version based on `OPENEDX_COMMON_VERSION`: for nightly builds, `ANDROID_APP_VERSION` is set to main. For other builds, `ANDROID_APP_VERSION` is set to the value of `OPENEDX_COMMON_VERSION`. (by @hamza-56)
<a id='changelog-17.0.0'></a>
## v17.0.0 (2023-12-09)

View File

@ -1,2 +0,0 @@
recursive-include tutorandroid/patches *
recursive-include tutorandroid/templates *

View File

@ -1,25 +1,30 @@
.DEFAULT_GOAL := help
.PHONY: docs
SRC_DIRS = ./tutorandroid
BLACK_OPTS = --exclude templates ${SRC_DIRS}
# Warning: These checks are not necessarily run on every PR.
test: test-lint test-types test-format # Run some static checks.
test: test-lint test-types test-format test-pythonpackage # Run some static checks.
test-format: ## Run code formatting tests
black --check --diff $(BLACK_OPTS)
ruff format --check --diff ${SRC_DIRS}
test-lint: ## Run code linting tests
pylint --errors-only --enable=unused-import,unused-argument --ignore=templates --ignore=docs/_ext ${SRC_DIRS}
ruff check ${SRC_DIRS}
test-types: ## Run type checks.
mypy --exclude=templates --ignore-missing-imports --implicit-reexport --strict ${SRC_DIRS}
format: ## Format code automatically
black $(BLACK_OPTS)
build-pythonpackage: ## Build the "tutor-android" python package for upload to pypi
python -m build --sdist
isort: ## Sort imports. This target is not mandatory because the output may be incompatible with black formatting. Provided for convenience purposes.
isort --skip=templates ${SRC_DIRS}
test-pythonpackage: build-pythonpackage ## Test that package can be uploaded to pypi
twine check dist/tutor_android-$(shell make version).tar.gz
format: ## Format code automatically
ruff format ${SRC_DIRS}
fix-lint: ## Fix lint errors automatically
ruff check --fix ${SRC_DIRS}
changelog-entry: ## Create a new changelog entry.
scriv create
@ -27,6 +32,9 @@ changelog-entry: ## Create a new changelog entry.
changelog: ## Collect changelog entries in the CHANGELOG.md file.
scriv collect
version: ## Print the current tutor-android version
@python -c 'import io, os; about = {}; exec(io.open(os.path.join("tutorandroid", "__about__.py"), "rt", encoding="utf-8").read(), about); print(about["__version__"])'
ESCAPE = 
help: ## Print this help
@grep -E '^([a-zA-Z_-]+:.*?## .*|######* .+)$$' Makefile \

View File

@ -18,21 +18,21 @@ Enable the plugin and start the platform::
tutor plugins enable android
tutor local launch
The ``.apk`` file will then be available for download at http(s)://mobile.LMS_HOST/app.apk. When running locally, this will be: http://mobile.local.edly.io/app.apk. You can forward this address to your students for download.
The ``.apk`` file will then be available for download at http(s)://mobile.LMS_HOST/app.apk. When running locally, this will be: http://mobile.local.openedx.io/app.apk. You can forward this address to your students for download.
Building a custom Android app
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Android app is built from the `official edx-app-android repository <https://github.com/edx/edx-app-android/>`__. To change this repository or the app version, you can simply build a different docker image with::
The Android app is built from the `official openedx-app-android repository <https://github.com/openedx/openedx-app-android/>`__. To change this repository or the app version, you can simply build a different docker image with::
tutor images build \
--build-arg ANDROID_APP_REPOSITORY=https://github.com/mycustomfork/edx-app-android \
--build-arg ANDROID_APP_REPOSITORY=https://github.com/mycustomfork/openedx-app-android \
--build-arg ANDROID_APP_VERSION=master \
android
Alternatively, you can build an image from a local checked-out fork of edx-app-android::
Alternatively, you can build an image from a local checked-out fork of openedx-app-android::
tutor mounts add /path/to/edx-app-android
tutor mounts add /path/to/openedx-app-android
tutor local launch
Making courses visible in app
@ -66,9 +66,9 @@ Customising the application, such as the logo or the background image, is curren
Troubleshooting
---------------
This Tutor plugin is maintained by Régis Behmo from `Overhang.IO <https://overhang.io>`__. Community support is available from the official `Open edX forum <https://discuss.openedx.org>`__. Do you need help with this plugin? See the `troubleshooting <https://docs.tutor.edly.io/troubleshooting.html>`__ section from the Tutor documentation.
This Tutor plugin is maintained by Abdul-Muqadim from `Edly <https://edly.io>`__. Community support is available from the official `Open edX forum <https://discuss.openedx.org>`__. Do you need help with this plugin? See the `troubleshooting <https://docs.tutor.edly.io/troubleshooting.html>`__ section from the Tutor documentation.
License
-------
This software is licensed under the terms of the AGPLv3.
This work is licensed under the terms of the `GNU Affero General Public License (AGPL) <https://github.com/overhangio/tutor-android/blob/release/LICENSE.txt>`_.

View File

@ -0,0 +1,2 @@
- [Improvement] Migrate from pylint and black to ruff. (by @Abdul-Muqadim-Arbisoft)
- [Improvement] Test python package distribution build when running make test. (by @Abdul-Muqadim-Arbisoft)

View File

@ -1,2 +1,83 @@
# https://packaging.python.org/en/latest/tutorials/packaging-projects/
# https://hatch.pypa.io/latest/config/build/
[project]
name = "tutor-android"
license = { text = "AGPL-3.0-only" }
authors = [
{ name = "Edly" },
{ email = "hello@edly.io" }
]
maintainers = [
{ name = "Abdul-Muqadim" },
{ email = "abdul.muqadim@arbisoft.com" }
]
description = "Android mobile app plugin for Tutor"
readme = { file = "README.rst", content-type = "text/x-rst" }
requires-python = ">=3.9"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"tutor>=20.0.0,<21.0.0"
]
# Version will be dynamically loaded from __about__.py
dynamic = ["version"]
[project.optional-dependencies]
dev = [
"tutor[dev]>=20.0.0,<21.0.0",
"ruff",
]
[project.entry-points."tutor.plugin.v1"]
android = "tutorandroid.plugin"
# URLs for documentation and issue tracking
[project.urls]
Homepage = "https://github.com/overhangio/tutor-android"
Documentation = "https://github.com/overhangio/tutor-android"
Code = "https://github.com/overhangio/tutor-android"
Issues = "https://github.com/overhangio/tutor-android/issues"
Community = "https://discuss.openedx.org/tag/tutor"
# Hatch-specific configuration
[tool.hatch.metadata.hooks.custom]
path = ".hatch_build.py"
[build-system]
requires = ["setuptools", "wheel"]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.sdist]
# Disable strict naming for twine compatibility
strict-naming = false
include = [ "/tutorandroid", '.hatch_build.py' ]
exclude = [ "tests*" ]
[tool.hatch.build.targets.wheel]
packages = ["tutorandroid"]
[tool.ruff]
exclude = ["templates", "docs/_ext"]
[tool.ruff.lint]
# E: pycodestyle errors
# I: isort
# N: pep8-naming
select = ["E", "I", "N"]
# F401: unused-import
# F841: unused-variable
# W292: missing-newline-at-end-of-file
extend-select = ["F401", "F841", "W292"]
[tool.ruff.format]

View File

@ -1,65 +0,0 @@
import io
import os
from setuptools import setup, find_packages
HERE = os.path.abspath(os.path.dirname(__file__))
def load_readme():
with io.open(os.path.join(HERE, "README.rst"), "rt", encoding="utf8") as f:
return f.read()
def load_about():
about = {}
with io.open(
os.path.join(HERE, "tutorandroid", "__about__.py"),
"rt",
encoding="utf-8",
) as f:
exec(f.read(), about) # pylint: disable=exec-used
return about
ABOUT = load_about()
setup(
name="tutor-android",
version=ABOUT["__version__"],
url="https://github.com/overhangio/tutor-android",
project_urls={
"Code": "https://github.com/overhangio/tutor-android",
"Issue tracker": "https://github.com/overhangio/tutor-android/issues",
"Community": "https://discuss.openedx.org",
},
license="AGPLv3",
author="Overhang.IO",
author_email="contact@overhang.io",
maintainer="Overhang.IO",
maintainer_email="regis@overhang.io",
description="Android mobile app plugin for Tutor",
long_description=load_readme(),
packages=find_packages(exclude=["tests*"]),
include_package_data=True,
python_requires=">=3.8",
install_requires=["tutor>=17.0.0,<18.0.0"],
extras_require={"dev": ["tutor[dev]>=17.0.0,<18.0.0"]},
entry_points={
"tutor.plugin.v1": [
"android = tutorandroid.plugin"
]
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
)

View File

@ -1 +1 @@
__version__ = "17.0.0"
__version__ = "20.0.0"

View File

@ -15,8 +15,8 @@ spec:
app.kubernetes.io/name: android-app
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
runAsUser: {{ APP_USER_ID }}
runAsGroup: {{ APP_USER_ID }}
containers:
- name: android-app
image: {{ ANDROID_APP_DOCKER_IMAGE }}

View File

@ -4,14 +4,14 @@ import os
import typing as t
from glob import glob
import pkg_resources
import importlib_resources
from tutor import hooks as tutor_hooks
from tutor.__about__ import __version_suffix__
from tutor.types import Config, get_typed
from .__about__ import __version__
# Handle version suffix in nightly mode, just like tutor core
# Handle version suffix in main mode, just like tutor core
if __version_suffix__:
__version__ += "-" + __version_suffix__
@ -23,8 +23,8 @@ config: t.Dict[str, t.Dict[str, t.Any]] = {
# Version 4.0.0 is not working:
# https://github.com/overhangio/tutor-android/pull/6#issuecomment-1541510489
"APP_VERSION": "3.1.4",
"DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android:{{ ANDROID_VERSION }}",
"APP_DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android-app:{{ ANDROID_VERSION }}",
"DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android:{{ ANDROID_VERSION }}", # noqa: E501
"APP_DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android-app:{{ ANDROID_VERSION }}", # noqa: E501
"ENABLE_RELEASE_MODE": False,
"RELEASE_STORE_PASSWORD": "android store password",
"RELEASE_KEY_PASSWORD": "android release key password",
@ -37,7 +37,7 @@ config: t.Dict[str, t.Dict[str, t.Any]] = {
with open(
os.path.join(
pkg_resources.resource_filename("tutorandroid", "templates"),
str(importlib_resources.files("tutorandroid") / "templates"),
"android",
"tasks",
"lms",
@ -116,9 +116,9 @@ def _build_custom_android_app(
mounts: list[tuple[str, str]], host_path: str
) -> list[tuple[str, str]]:
path_basename = os.path.basename(host_path)
if path_basename == "edx-app-android":
if path_basename == "openedx-app-android":
# Bind-mount repo at build-time
mounts.append(("android", "edx-app-android"))
mounts.append(("android", "openedx-app-android"))
return mounts
@ -135,7 +135,7 @@ def _print_android_app_public_hosts(
# Add the "templates" folder as a template root
tutor_hooks.Filters.ENV_TEMPLATE_ROOTS.add_item(
pkg_resources.resource_filename("tutorandroid", "templates")
str(importlib_resources.files("tutorandroid") / "templates")
)
# Render the "build" and "apps" folders
tutor_hooks.Filters.ENV_TEMPLATE_TARGETS.add_items(
@ -147,7 +147,7 @@ tutor_hooks.Filters.ENV_TEMPLATE_TARGETS.add_items(
# Load patches from files
for path in glob(
os.path.join(
pkg_resources.resource_filename("tutorandroid", "patches"),
str(importlib_resources.files("tutorandroid") / "patches"),
"*",
)
):

View File

@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM docker.io/ubuntu:23.10 AS base
FROM docker.io/ubuntu:24.04 AS base
LABEL maintainer="Overhang.IO <contact@overhang.io>"
ENV DEBIAN_FRONTEND=noninteractive
@ -16,9 +16,9 @@ FROM base AS sdk
# Install Android SDK
# Inspired from https://github.com/LiveXP/docker-android-sdk/blob/master/Dockerfile
# Get sdk version from here: https://developer.android.com/studio#command-tools
ENV ANDROID_SDK_VERSION 10406996
ENV ANDROID_SDK_PATH /app/android-sdk
ENV ANDROID_HOME /app/android-sdk
ENV ANDROID_SDK_VERSION=11076708
ENV ANDROID_SDK_PATH=/app/android-sdk
ENV ANDROID_HOME=/app/android-sdk
RUN mkdir ${ANDROID_HOME}
WORKDIR /app/android-sdk
RUN wget --quiet https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip && \
@ -28,38 +28,37 @@ RUN wget --quiet https://dl.google.com/android/repository/commandlinetools-linux
# Accept licenses
# https://developer.android.com/studio/command-line/sdkmanager
# Check target version: https://github.com/edx/edx-app-android/blob/master/constants.gradle
ARG ANDROID_API_LEVEL=33
ARG ANDROID_API_LEVEL=34
RUN yes | /app/android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} --install "platforms;android-$ANDROID_API_LEVEL" 1> /dev/null
###### Checkout code
FROM base AS code
# Install android app repo
ARG ANDROID_APP_REPOSITORY=https://github.com/openedx/edx-app-android.git
# Please add ANDROID_APP_VERSION value in tutor config from release version https://github.com/openedx/edx-app-android/tags
ARG ANDROID_APP_VERSION={% if OPENEDX_COMMON_VERSION == "master" %}master{% else %}release/{{ ANDROID_APP_VERSION }}{% endif %}
ADD --keep-git-dir $ANDROID_APP_REPOSITORY#$ANDROID_APP_VERSION /app/edx-app-android
ARG ANDROID_APP_REPOSITORY=https://github.com/openedx/openedx-app-android.git
ARG ANDROID_APP_VERSION={% if OPENEDX_COMMON_VERSION == "master" %}main{% else %}{{ OPENEDX_COMMON_VERSION }}{% endif %}
ADD --keep-git-dir $ANDROID_APP_REPOSITORY#$ANDROID_APP_VERSION /app/openedx-app-android
###### Empty layer to mount custom repo at build time
FROM scratch AS edx-app-android
COPY --from=code /app/edx-app-android /
FROM scratch AS openedx-app-android
COPY --from=code /app/openedx-app-android /
###### Common layer, which will be used to build the user-specific image later
FROM sdk AS common
COPY --from=edx-app-android / /app/edx-app-android
WORKDIR /app/edx-app-android
COPY --from=openedx-app-android / /app/openedx-app-android
WORKDIR /app/openedx-app-android
# Install gradle and all dependencies
RUN ./gradlew -v
RUN ./gradlew tasks
###### Build image with app-specific settings
FROM common as build
FROM common AS build
# User-customized config
COPY ./config/edx.properties ./OpenEdXMobile/default_config/edx.properties
COPY ./config/tutor.yaml ./OpenEdXMobile/default_config/tutor.yaml
COPY ./config/tutor.yaml ./default_config/dev/config.yaml
COPY ./config/tutor.yaml ./default_config/stage/config.yaml
COPY ./config/tutor.yaml ./default_config/prod/config.yaml
{% if ANDROID_ENABLE_RELEASE_MODE %}
# Add release settings
COPY ./config/gradle.properties ./gradle.properties.tutor
@ -68,10 +67,11 @@ RUN cat ./gradle.properties.tutor >> ./gradle.properties
# uncomment this line for for release APK.
# RUN sed -i "s/APPLICATION_ID = .*/APPLICATION_ID = \"{{ LMS_HOST|reverse_host|replace("-", "_") }}\"/g" constants.gradle
RUN ./gradlew assembleProd{{ "Release" if ANDROID_ENABLE_RELEASE_MODE else "Debuggable" }}
RUN ./gradlew assembleProd{{ "Release" if ANDROID_ENABLE_RELEASE_MODE else "Debug" }}
# ./gradlew assembleProdRelease
#### File server to serve apk file
# https://hub.docker.com/_/caddy?tab=tags
FROM docker.io/caddy:2.6.4-alpine as production
COPY --from=build /app/edx-app-android/OpenEdXMobile/build/outputs/apk/prod/{{ "release" if ANDROID_ENABLE_RELEASE_MODE else "debuggable" }}/edx-{{ "release" if ANDROID_ENABLE_RELEASE_MODE else "debuggable" }}-{{ ANDROID_APP_VERSION }}.apk /srv/app.apk
FROM docker.io/caddy:2.6.4-alpine AS production
COPY --from=build /app/openedx-app-android/app/build/outputs/apk/prod/{{ "release" if ANDROID_ENABLE_RELEASE_MODE else "debug" }}/app-prod-{{ "release" if ANDROID_ENABLE_RELEASE_MODE else "debug" }}.apk /srv/app.apk
CMD caddy file-server --listen=:8000 --root=/srv

View File

@ -1,4 +1,4 @@
RELEASE_STORE_FILE=/app/edx-app-android/OpenEdXMobile/app.keystore
RELEASE_STORE_FILE=/app/openedx-app-android/app.keystore
RELEASE_STORE_PASSWORD={{ ANDROID_RELEASE_STORE_PASSWORD }}
RELEASE_KEY_PASSWORD={{ ANDROID_RELEASE_KEY_PASSWORD }}
RELEASE_KEY_ALIAS={{ ANDROID_RELEASE_KEY_ALIAS }}

View File

@ -1,18 +1,83 @@
# See docs: https://openedx.atlassian.net/wiki/spaces/LEARNER/pages/48792067/App+Configuration+Flags
API_HOST_URL: "{{ "https" if ENABLE_HTTPS else "http" }}://{{ LMS_HOST }}"
APPLICATION_ID: 'org.openedx.app'
ENVIRONMENT_DISPLAY_NAME: "tutor"
PLATFORM_NAME: "{{ PLATFORM_NAME }}"
PLATFORM_DESTINATION_NAME: "{{ LMS_HOST }}"
URI_SCHEME: ''
FEEDBACK_EMAIL_ADDRESS: "{{ CONTACT_EMAIL }}"
FAQ_URL: ''
OAUTH_CLIENT_ID: "android"
COURSE_VIDEOS_ENABLED: true
CERTIFICATES_ENABLED: true
DISCUSSIONS_ENABLED: true
# Keep empty to hide setting
AGREEMENT_URLS:
PRIVACY_POLICY_URL: ''
COOKIE_POLICY_URL: ''
DATA_SELL_CONSENT_URL: ''
TOS_URL: ''
EULA_URL: ''
SUPPORTED_LANGUAGES: [ ] #en is default language
DISCOVERY:
COURSE:
TYPE: native
DOWNLOAD_TO_SD_CARD_ENABLED: true
NEW_LOGISTRATION_ENABLED: true
USER_PROFILES_ENABLED : true
VIDEO_TRANSCRIPT_ENABLED: true
TYPE: 'native'
WEBVIEW:
BASE_URL: ''
COURSE_DETAIL_TEMPLATE: ''
PROGRAM_DETAIL_TEMPLATE: ''
PROGRAM:
TYPE: 'native'
WEBVIEW:
PROGRAM_URL: ''
PROGRAM_DETAIL_URL_TEMPLATE: ''
FIREBASE:
ENABLED: false
ANALYTICS_SOURCE: '' # segment | none
CLOUD_MESSAGING_ENABLED: false
PROJECT_NUMBER: ''
PROJECT_ID: ''
APPLICATION_ID: '' #App ID field from the Firebase console or mobilesdk_app_id from the google-services.json file.
API_KEY: ''
SEGMENT_IO:
ENABLED: false
SEGMENT_IO_WRITE_KEY: ''
BRAZE:
ENABLED: false
PUSH_NOTIFICATIONS_ENABLED: false
GOOGLE:
ENABLED: false
CLIENT_ID: ''
MICROSOFT:
ENABLED: false
CLIENT_ID: ''
PACKAGE_SIGNATURE: ''
FACEBOOK:
ENABLED: false
FACEBOOK_APP_ID: ''
CLIENT_TOKEN: ''
BRANCH:
ENABLED: false
KEY: ''
URI_SCHEME: ''
HOST: ''
ALTERNATE_HOST: ''
#Platform names
PLATFORM_NAME: "{{ PLATFORM_NAME }}"
PLATFORM_FULL_NAME: "{{ PLATFORM_NAME }}"
#App sourceSets dir
THEME_DIRECTORY: "openedx"
#tokenType enum accepts JWT and BEARER only
TOKEN_TYPE: "JWT"
#feature flag for activating Whats New feature
WHATS_NEW_ENABLED: false
#feature flag enable Social Login buttons
SOCIAL_AUTH_ENABLED: false
#Course navigation feature flags
COURSE_NESTED_LIST_ENABLED: false
COURSE_UNIT_PROGRESS_ENABLED: false