-
Notifications
You must be signed in to change notification settings - Fork 38
/
gen-artifacts.sh
executable file
·52 lines (40 loc) · 1.33 KB
/
gen-artifacts.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
set -e
. ./env.sh
# 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/
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
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