2023-03-09 19:58:08 +01:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
|
|
|
try(){ set +e; "$@" 2>/dev/null; set -e; }
|
|
|
|
|
|
|
|
install(){
|
|
|
|
which haxe || {
|
2023-03-09 21:55:03 +01:00
|
|
|
echo -e "installing haxe..if this fails:\n\n"
|
2023-03-09 19:58:08 +01:00
|
|
|
echo " 1. install haxe from haxe.org"
|
|
|
|
echo "[2.] download neko for cpp output"
|
|
|
|
echo "[3.] install mono openjdk14 for csharp + java output"
|
2023-03-09 21:55:03 +01:00
|
|
|
which apt-get && {
|
2023-03-09 21:56:16 +01:00
|
|
|
sudo apt-get update -y
|
2023-03-09 22:00:32 +01:00
|
|
|
sudo apt-get install neko haxe -y
|
2023-03-09 21:55:03 +01:00
|
|
|
}
|
2023-03-09 19:58:08 +01:00
|
|
|
}
|
2023-03-09 22:11:56 +01:00
|
|
|
mkdir ~/.haxe
|
|
|
|
haxelib setup ~/.haxe
|
2023-03-09 19:58:08 +01:00
|
|
|
haxelib install hxcpp
|
|
|
|
haxelib install hxjava
|
|
|
|
haxelib install hxcs
|
|
|
|
haxelib install hscript
|
|
|
|
}
|
|
|
|
|
|
|
|
runtest(){
|
|
|
|
set -x
|
|
|
|
which python3 && python3 test/generated/test.py | awk '{ print "py: "$0 } END{ print "\n"}'
|
|
|
|
which node && node test/generated/test.js | awk '{ print "js: "$0 } END{ print "\n"}'
|
|
|
|
}
|
|
|
|
|
|
|
|
test -z $1 && { try rm dist/* ; haxe build.hxml; exit $?; }
|
|
|
|
test -z $1 || "$@"
|