#!/usr/bin/env bash set -e dir=$(cd "$(dirname "$0")"; pwd) rootdir="$dir/../.." dotnet_configuration=DebugOpt make_configuration=debug platform=x64 jsinterp=$(which node) usage() { cat <&2 usage ;; esac done if [ "$CI" = "true" ]; then red="" green="" reset="" else red=`tput setaf 1` green=`tput setaf 2` reset=`tput sgr0` fi # 1) Generate generate=true if [ $generate = true ]; then echo "${green}Generating bindings with .NET configuration $dotnet_configuration${reset}" dotnet "$rootdir/bin/${dotnet_configuration}/CppSharp.CLI.dll" --property=keywords \ "$dir/bindings.lua" fi # 2) Build echo "${green}Building generated binding files (make config: $make_configuration)${reset}" premake="$rootdir/build/premake.sh" "$premake" --file=$dir/premake5.lua gmake2 config=$make_configuration emmake make -C "$dir/gen" # 3) Test echo echo "${green}Executing JS tests with Node${reset}" "$jsinterp" "$dir/test.mjs"