prepare Makefie and stuff for apk/{webview,native}
This commit is contained in:
parent
3a9ac9f73f
commit
6327c380ba
3 changed files with 44 additions and 21 deletions
|
@ -1,7 +1,7 @@
|
||||||
FROM archlinux:latest
|
FROM archlinux:latest
|
||||||
|
|
||||||
RUN pacman -Syu --noconfirm
|
RUN pacman -Syu --noconfirm
|
||||||
RUN pacman -S --noconfirm coreutils bash shadow make unzip jdk11-openjdk wget
|
RUN pacman -S --noconfirm coreutils bash shadow make unzip zip jdk11-openjdk wget
|
||||||
ENV ANDROID_SDK_ROOT="/opt/android"
|
ENV ANDROID_SDK_ROOT="/opt/android"
|
||||||
ENV BUILD_TOOLS_LATEST="$ANDROID_SDK_ROOT/cmdline-tools/latest"
|
ENV BUILD_TOOLS_LATEST="$ANDROID_SDK_ROOT/cmdline-tools/latest"
|
||||||
RUN BUILD_TOOLS="$(realpath -m "$BUILD_TOOLS_LATEST/..")";\
|
RUN BUILD_TOOLS="$(realpath -m "$BUILD_TOOLS_LATEST/..")";\
|
||||||
|
@ -19,9 +19,11 @@ ENV JAVA_HOME="/usr/lib/jvm/java-11-openjdk/"
|
||||||
#ENTRYPOINT bash -c 'sleep 10000'
|
#ENTRYPOINT bash -c 'sleep 10000'
|
||||||
ENV LIBRARY_PATH="$LIBRARY_PATH:$BUILD_TOOLS_LATEST/lib"
|
ENV LIBRARY_PATH="$LIBRARY_PATH:$BUILD_TOOLS_LATEST/lib"
|
||||||
ARG YESACCEPT=n
|
ARG YESACCEPT=n
|
||||||
|
RUN test "$YESACCEPT" = "y" || { printf "\033[31;1;4m%s\n%s\033[0m " "FAILED TO BUILD CONTAINER: You did not ACCEPT THE UPSTREAM LICENSE" " -> export YESACCEPT=y" >&2; exit 1; }
|
||||||
RUN echo you selected to accept the licenses/TOS
|
RUN echo you selected to accept the licenses/TOS
|
||||||
RUN echo "$YESACCEPT" | sdkmanager --install "build-tools;33.0.2"
|
RUN echo "$YESACCEPT" | sdkmanager --install "build-tools;33.0.2"
|
||||||
RUN echo "$YESACCEPT" | sdkmanager --install "platforms;android-33"
|
RUN echo "$YESACCEPT" | sdkmanager --install "platforms;android-33"
|
||||||
|
RUN echo "$YESACCEPT" | sdkmanager --install "ndk;28.0.12433566"
|
||||||
#RUN apk add setpriv
|
#RUN apk add setpriv
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
RUN chown 0:0 /entrypoint.sh
|
RUN chown 0:0 /entrypoint.sh
|
||||||
|
|
41
Makefile
41
Makefile
|
@ -1,36 +1,47 @@
|
||||||
|
|
||||||
|
|
||||||
all: build install
|
all: docker-compose-build.log build-all install-all
|
||||||
|
|
||||||
build:
|
.PHONY: build-all
|
||||||
docker-compose run compile
|
build-all: build-webview build-native
|
||||||
|
|
||||||
install:
|
|
||||||
adb install -r ./apk/example.app.apk
|
.PHONY: build-webview
|
||||||
|
build-webview:
|
||||||
|
docker-compose run --rm compile webview
|
||||||
|
ln -sf apk/webview/result/example.app.apk ./; test -e ./example.app.apk || rm ./example.app.apk
|
||||||
|
|
||||||
|
.PHONY: build-native
|
||||||
|
build-native:
|
||||||
|
docker-compose run --rm compile native
|
||||||
|
#ln -sf apk/native/result/example.app.apk ./; test -e ./example.app.apk || rm ./example.app.apk
|
||||||
|
|
||||||
|
.PHONY: install-all
|
||||||
|
install-all: install-webview install-native
|
||||||
|
|
||||||
|
.PHONY: install-webview
|
||||||
|
install-webview:
|
||||||
|
adb install -r ./example.app.apk
|
||||||
|
|
||||||
|
.PHONY: install-native
|
||||||
|
install-native:
|
||||||
|
true
|
||||||
|
#adb install -r ./example.app.apk
|
||||||
|
|
||||||
.PHONY: clean-all
|
.PHONY: clean-all
|
||||||
clean-all: clean-docker clean-apk
|
clean-all: clean-docker clean-apk
|
||||||
|
|
||||||
|
|
||||||
.PHONY: clean-docker
|
.PHONY: clean-docker
|
||||||
clean-docker:
|
clean-docker:
|
||||||
rm docker-compose-build.log || true
|
rm docker-compose-build.log || true
|
||||||
docker-compose down --remove-orphans --rmi all
|
docker-compose down --remove-orphans --rmi all
|
||||||
|
|
||||||
|
|
||||||
.PHONY: clean-apk
|
.PHONY: clean-apk
|
||||||
clean-apk:
|
clean-apk:
|
||||||
cd apk && $(MAKE) clean
|
cd apk && $(MAKE) clean
|
||||||
|
|
||||||
|
|
||||||
|
docker-compose-build.log: Dockerfile compose.yml
|
||||||
apk: apk/app.apk
|
|
||||||
true
|
|
||||||
|
|
||||||
apk/app.apk: docker-compose-build.log
|
|
||||||
docker-compose run --rm compile
|
|
||||||
|
|
||||||
docker-compose-build.log: Dockerfile docker-compose.yml
|
|
||||||
docker-compose down --remove-orphans --rmi all
|
docker-compose down --remove-orphans --rmi all
|
||||||
BUILDKIT_PROGRESS=plain docker-compose build | tee docker-compose-build.log
|
BUILDKIT_PROGRESS=plain docker-compose build | tee docker-compose-build.log
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,18 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
cd /apk;
|
set -x
|
||||||
VOLUID="$(stat -c "%u" /apk)";
|
|
||||||
VOLGID="$(stat -c "%g" /apk)";
|
|
||||||
CMD="${*:-"make"}"
|
APKDIR="/apk/$1"
|
||||||
setpriv --reuid $VOLUID --regid $VOLGID --clear-groups sh -c "$CMD"
|
shift
|
||||||
|
#test -d "$1" ==
|
||||||
|
#APKDIR=
|
||||||
|
#cd /apk/$1;
|
||||||
|
#shift
|
||||||
|
VOLUID="$(stat -c "%u" "$APKDIR")";
|
||||||
|
VOLGID="$(stat -c "%g" "$APKDIR")";
|
||||||
|
#CMD="${*:-"make"}"
|
||||||
|
cd "$APKDIR"
|
||||||
|
test -z "$*" && set -- make
|
||||||
|
setpriv --reuid $VOLUID --regid $VOLGID --clear-groups sh -c "$*"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue