openCom-Companion/Makefile

62 lines
1.9 KiB
Makefile
Raw Permalink Normal View History

2022-07-07 22:16:10 +02:00
devapk:
2022-07-07 22:34:01 +02:00
make -C sbapp devapk
2022-04-07 21:03:53 +02:00
2022-07-07 22:16:10 +02:00
apk:
2022-07-07 22:34:01 +02:00
make -C sbapp apk
2022-07-07 22:38:45 +02:00
mkdir -p ./dist
2022-10-03 14:29:45 +02:00
fetchapk:
2024-09-16 16:41:37 +02:00
cp ./sbapp/bin/occ-*-release-unsigned.apk ./dist/
2022-04-07 21:03:53 +02:00
install:
2022-07-07 22:34:01 +02:00
make -C sbapp install
2022-04-07 21:03:53 +02:00
console:
2022-07-07 22:34:01 +02:00
make -C sbapp console
2022-07-07 22:16:10 +02:00
clean:
2022-07-07 22:34:01 +02:00
@echo Cleaning...
-rm -r ./build
2024-09-12 15:03:25 +02:00
-rm -rf ./dist
2022-07-07 22:34:01 +02:00
cleanbuildozer:
2022-10-03 13:21:33 +02:00
make -C sbapp cleanall
2022-07-07 22:34:01 +02:00
cleanall: clean cleanbuildozer
2022-07-07 22:16:10 +02:00
2022-10-03 12:54:35 +02:00
preparewheel:
pyclean .
$(MAKE) -C sbapp cleanrns
2022-07-07 22:16:10 +02:00
build_wheel:
2024-09-14 10:24:58 +02:00
. sbapp/venv/bin/activate; python3 setup.py sdist bdist_wheel
2022-04-07 21:03:53 +02:00
2022-10-04 00:48:06 +02:00
release: build_wheel apk fetchapk
2022-07-07 22:38:45 +02:00
release_docker:
@echo If you experience errors, please ensure you have docker-buildx installed on your system.
2024-09-12 15:03:25 +02:00
@echo This target uses a custom buildkit image to allow for full viewing of the logs on build, but takes slightly longer as a result.
-mkdir -p ./dist
# Needed for allowing the viewing of the full log
-sudo docker buildx create --bootstrap --use --name buildkit --driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=-1 --driver-opt env.BUILDKIT_STEP_LOG_MAX_SPEED=-1 &> /dev/null
sudo docker buildx build --target=artifact --output type=local,dest=./dist/ .
@echo Build successful. APK copied to ./dist directory.
$(MAKE) sign_release
sign_release:
@echo This stage generates a keystore in the root directory of the repo and signs the APK with it.
@echo If a keystore already exists, it is reused.
@echo Please make sure you have apksigner and zipalign installed on your system before proceeding.
@echo Press enter to continue.
@read VOID
if [ ! -f "./key.keystore" ]; then keytool -genkey -v -keystore key.keystore -keyalg RSA -keysize 4096 -validity 10000 -alias app; fi
VERSION=$(shell ls ./dist/*.apk | cut -d\- -f 2 | head -n 1); \
2024-09-16 16:41:37 +02:00
zipalign -p 4 ./dist/occ-*-release-unsigned.apk ./dist/occ-$$VERSION-release.apk; \
apksigner sign --ks-key-alias app --ks key.keystore ./dist/occ-$$VERSION-release.apk; \
2022-07-07 22:38:45 +02:00
upload:
2022-07-08 00:10:04 +02:00
@echo Ready to publish release, hit enter to continue
2022-07-13 19:16:18 +02:00
@read VOID
2022-07-07 22:38:45 +02:00
@echo Uploading to PyPi...
twine upload dist/sbapp-*