geo-therminator-android/run_mix
2021-11-11 17:43:02 +01:00

32 lines
899 B
Bash
Executable file

#!/bin/bash
set -e
BASE=`pwd`
# Here activate your Erlang/Elixir version, in my case this is using kerl.
# To have the embedded Erlang match the one you use for compilation you can install
# the same version as the embedded:
# mkdir -p ~/projects/
# kerl build git https://github.com/diodechain/otp.git diode/beta 24.beta
# kerl install 24.beta ~/projects/24.beta
. ~/projects/24.beta/activate
export MIX_ENV=prod
export MIX_TARGET=android
if [ ! -d "elixir-app" ]; then
git clone https://github.com/elixir-desktop/desktop-example-app.git elixir-app
cd elixir-app
mix deps.get
else
cd elixir-app
fi
if [ ! -d "assets/node_modules" ]; then
cd assets && npm i && cd ..
fi
mix assets.deploy && \
mix release --overwrite && \
cd _build/android_prod/rel/todo_app && \
zip -0r $BASE/src/main/assets/app.zip lib/ releases/ --exclude "*.so" && \
xz -9ef $BASE/src/main/assets/app.zip