#!/bin/bash
MY_PATH=`dirname "$0"`
$MY_PATH/buildonly.sh $@
if [ $? -ne 0 ]
then
exit 1;
fi
cd $MY_PATH/..
if [ ! -z "$3" ]
then
PROJECT_PATH="-p $3"
fi
if [ "$1" = "release" ] || [ "$1" = "r" ] || [ "$1" = "" ]
then
if [ "$2" = "test" ]
then
cd build/Release/test/ && ./Sourcetrail_test
else
cd build/Release/app && ./Sourcetrail $PROJECT_PATH
fi
elif [ "$1" = "debug" ] || [ "$1" = "d" ]
then
if [ "$2" = "test" ]
then
cd build/Debug/test && ./Sourcetrail_test
else
cd build/Debug/app && ./Sourcetrail $PROJECT_PATH
fi
else
echo "no arguments: first argument 'release' or 'debug', second argument 'test' for tests"
fi