SimpleX-Chat/scripts/android/build-android-bundle.sh
Stanislav Dmitrenko 3bd5fc7463
multiplatform: moved to Gradle KTS and common directory structure (#2633)
* multiplatform: moved to Gradle KTS and common directory structure

* renamed for review

* different versions for Android and desktop

* update desktop version_name

* Revert "renamed for review"

This reverts commit 80041efe40.

* EOLs

* change version to 1.0 to appease linter

---------

Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2023-07-01 20:44:36 +01:00

27 lines
1,009 B
Bash
Executable file

#!/usr/bin/env sh
# Safety measures
[ -n "$1" ] || exit 1
set -eu
tmp=$(mktemp -d -t)
libsim=$(cat "$1" | grep libsimplex)
libsup=$(cat "$1" | grep libsupport)
commit="${2:-nix-android}"
# Clone simplex
git clone https://github.com/simplex-chat/simplex-chat "$tmp/simplex-chat"
# Switch to nix-android branch
git -C "$tmp/simplex-chat" checkout "$commit"
# Create missing folders
mkdir -p "$tmp/simplex-chat/apps/multiplatform/common/src/commonMain/cpp/android/libs/arm64-v8a"
curl -sSf "$libsim" -o "$tmp/libsimplex.zip"
unzip -o "$tmp/libsimplex.zip" -d "$tmp/simplex-chat/apps/multiplatform/common/src/commonMain/cpp/android/libs/arm64-v8a"
curl -sSf "$libsup" -o "$tmp/libsupport.zip"
unzip -o "$tmp/libsupport.zip" -d "$tmp/simplex-chat/apps/multiplatform/common/src/commonMain/cpp/android/libs/arm64-v8a"
gradle -p "$tmp/simplex-chat/apps/multiplatform/" clean build
cp "$tmp/simplex-chat/apps/multiplatform/android/build/outputs/apk/release/android-release-unsigned.apk" "$PWD/simplex-chat.apk"