Skip to content

Commit

Permalink
Merge pull request #42 from teserakt-io/fb/android_bindings_release_i…
Browse files Browse the repository at this point in the history
…mprovments

Minor improvements to android binding generation script
  • Loading branch information
diagprov authored Mar 16, 2020
2 parents 7c04942 + 173b51e commit be48926
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/android_bindings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# export ANDROID_HOME=~/Android/Sdk/
# export ANDROID_NDK_HOME=~/Android/Sdk/ndk/21.0.6113669/
# (These are the default paths where Android Studio is installing the SDK and NDK, the version might need to be adjusted depending on your setup)
# A version string can be appended to the output files by specifying a E4VERSION environment variable:
# E4VERSION=v1.1.0 ./scripts/android_bindings.sh


DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

Expand All @@ -14,3 +17,11 @@ INCLUDE_GO_PACKAGES=""
mkdir -p "${OUTDIR}" 2>/dev/null

gomobile bind -v -target android -o "${OUTDIR}/e4.aar" -javapkg io.teserakt ${DIR}/../ ${DIR}/../crypto

if [ ! -z "${E4VERSION}" ]; then
mv "${OUTDIR}/e4.aar" "${OUTDIR}/e4_${E4VERSION}.aar"
mv "${OUTDIR}/e4-sources.jar" "${OUTDIR}/e4-sources_${E4VERSION}.jar"
fi

# gomobile will mess up the go.mod file when running, tidying restore it to the appropriate state
cd "${DIR}/../" && go mod tidy && cd -

0 comments on commit be48926

Please sign in to comment.