mobile_nebula/gen-artifacts.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.3 KiB
Bash
Raw Permalink Normal View History

2020-07-27 20:43:58 +00:00
#!/bin/sh
set -e
. ./env.sh
2020-07-27 20:43:58 +00:00
# Generate gomobile nebula bindings
cd nebula
if [ "$1" = "ios" ]; then
# Build for nebula for iOS
make MobileNebula.xcframework
rm -rf ../ios/MobileNebula.xcframework
cp -r MobileNebula.xcframework ../ios/
2020-07-27 20:43:58 +00:00
elif [ "$1" = "android" ]; then
# Build nebula for android
make mobileNebula.aar
mkdir -p ../android/mobileNebula
rm -rf ../android/mobileNebula/mobileNebula.aar
cp mobileNebula.aar ../android/mobileNebula/mobileNebula.aar
2020-07-27 20:43:58 +00:00
else
echo "Error: unsupported target os $1"
exit 1
fi
cd ..
# Generate version info to display in about
{
# Get the flutter and dart versions
printf "const flutterVersion = <String, String>"
flutter --version --machine
echo ";"
# Get our current git sha
git rev-parse --short HEAD | sed -e "s/\(.*\)/const gitSha = '\1';/"
# Get the nebula version
cd nebula
NEBULA_VERSION="$(go list -m -f "{{.Version}}" github.com/slackhq/nebula | cut -f1 -d'-' | cut -c2-)"
echo "const nebulaVersion = '$NEBULA_VERSION';"
cd ..
# Get our golang version
echo "const goVersion = '$(go version | awk '{print $3}')';"
} > lib/.gen.versions.dart
# Try and avoid issues with building by moving into place after we are complete
#TODO: this might be a parallel build of deps issue in kotlin, might need to solve there
mv lib/.gen.versions.dart lib/gen.versions.dart