-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sh
executable file
·43 lines (34 loc) · 1023 Bytes
/
build.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
#! /usr/bin/env bash
set -e
# Check for the programs we need to do the build
if ! (which git && which cargo && which dotnet)>/dev/null
then
echo "git, cargo and dotnet are rquired for compilation" 1>&2
exit 1
fi
# Work out the platform we are building on, and the RID which goes
# along with it.
case `uname` in
Darwin) rid="osx"
platform="Darwin"
;;
Linux) rid="linux"
platform="Linux"
;;
*) echo "Unrecognised platform `uname`" 1>&2
exit 1;
;;
esac
# log out the RID decided on
echo "Compiling for $rid on $platform"
# Make sure the source is up to date
git submodule init && git submodule update
# Ask cargo to build us the libary. We only care about the
# regex-capi part of the crate.
(cd rure/regex-capi/ && cargo build --release)
# create a folder for the package to reside in
rm -rf runtimes
mkdir -p runtimes/$rid/native/
cp -r rure/target/release/librure* runtimes/$rid/native/
# Pack it all up
dotnet build -c Release -o PublishOutput IronRure.Batteries-$platform.csproj