Skip to content

Commit

Permalink
feat: upgrade to quince
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadali286 authored and regisb committed Dec 11, 2023
1 parent 7726bfb commit 93edbde
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ variables:
TUTOR_PLUGIN: android
TUTOR_IMAGES: android
TUTOR_PYPI_PACKAGE: tutor-android
OPENEDX_RELEASE: palm
OPENEDX_RELEASE: quince
GITHUB_REPO: overhangio/tutor-android
IMAGES_BUILD_PLATFORM: "linux/amd64"

Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ instructions, because git commits are used to generate release notes:

<!-- scriv-insert-here -->

<a id='changelog-17.0.0'></a>
## v17.0.0 (2023-12-09)

- 💥 [Feature] Upgrade to Quince (by @muhammadali286).
- The nightly branch will now build the master branch of the edx-app-android repository. (by @regisb)
- [Improvement] Added Typing to code, Makefile and test action to the repository and formatted code with Black and isort. (by @CodeWithEmad)

<a id='changelog-16.0.0'></a>
## v16.0.0 (2023-06-14)

Expand Down
1 change: 0 additions & 1 deletion changelog.d/20231118_183802_codewithemad.md

This file was deleted.

4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def load_about():
packages=find_packages(exclude=["tests*"]),
include_package_data=True,
python_requires=">=3.8",
install_requires=["tutor>=16.0.0,<17.0.0"],
extras_require={"dev": ["tutor[dev]>=16.0.0,<17.0.0"]},
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"
Expand Down
2 changes: 1 addition & 1 deletion tutorandroid/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "16.0.0"
__version__ = "17.0.0"
26 changes: 15 additions & 11 deletions tutorandroid/templates/android/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM docker.io/ubuntu:22.04 AS base
# syntax=docker/dockerfile:1
FROM docker.io/ubuntu:23.10 AS base
LABEL maintainer="Overhang.IO <[email protected]>"

ENV DEBIAN_FRONTEND=noninteractive
RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked {% endif %}apt update && \
apt upgrade -y && \
apt install -y wget unzip git openjdk-11-jre openjdk-11-jdk
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked apt update && \
apt upgrade -y && \
apt install -y wget unzip git openjdk-17-jre openjdk-17-jdk

RUN mkdir /app

Expand All @@ -15,7 +16,7 @@ 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 9477386
ENV ANDROID_SDK_VERSION 10406996
ENV ANDROID_SDK_PATH /app/android-sdk
ENV ANDROID_HOME /app/android-sdk
RUN mkdir ${ANDROID_HOME}
Expand All @@ -27,15 +28,17 @@ 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=31
ARG ANDROID_API_LEVEL=33
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
ARG ANDROID_APP_VERSION=release/{{ ANDROID_APP_VERSION }}
RUN git clone $ANDROID_APP_REPOSITORY --branch $ANDROID_APP_VERSION /app/edx-app-android
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

###### Empty layer to mount custom repo at build time
FROM scratch AS edx-app-android
Expand Down Expand Up @@ -63,7 +66,8 @@ COPY ./config/gradle.properties ./gradle.properties.tutor
RUN cat ./gradle.properties.tutor >> ./gradle.properties
{% endif %}

RUN sed -i "s/APPLICATION_ID = .*/APPLICATION_ID = \"{{ LMS_HOST|reverse_host|replace("-", "_") }}\"/g" constants.gradle
# 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" }}

#### File server to serve apk file
Expand Down

0 comments on commit 93edbde

Please sign in to comment.