build: revised build scripts

This commit is contained in:
Eberhard Graether
2019-11-05 17:00:39 +01:00
parent 8264b8cae3
commit c34b17418d
11 changed files with 33 additions and 141 deletions
-28
View File
@@ -1,28 +0,0 @@
#!/bin/sh
OUTPUT="csv.txt"
touch $OUTPUT
echo "NAME\tMAIL\tDATE" > $OUTPUT
for FILE in ./*.eml
do
TEST=$(grep -E -o "test license" $FILE)
INVITE=$(grep -E -o "invited" $FILE)
UPGRADE=$(grep -E -o "Upgrade" $FILE)
MAIL=$(grep -E -o "^To: [A-Za-z0-9._%+-]*@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}" $FILE | sed 's .\{4\} ')
NAME=$(grep -E -o "<p>Hello .*,</p>" $FILE | sed 's .\{9\} ' | sed 's .\{5\}$ ' | sed 's/=/\\x/g')
DATE=$(grep -E -o "Delivery-date: .*" $FILE | sed 's .\{20\} ' | sed 's .\{15\}$ ')
RECORD="$NAME\t$MAIL"
# if [[ ! -z "$INVITE" ]]
# if [[ ! -z "$UPGRADE" ]]
if [[ ! -z "$TEST" ]]
then
RECORD="$RECORD\t$DATE"
echo $RECORD
echo $RECORD >> $OUTPUT
fi
done
-71
View File
@@ -1,71 +0,0 @@
#!/bin/bash
set -e
ABORT="\033[31mAbort:\033[00m"
SUCCESS="\033[32mSuccess:\033[00m"
INFO="\033[33mInfo:\033[00m"
# Determine current platform
PLATFORM='unknown'
if [ "$(uname)" == "Darwin" ]; then
PLATFORM='MacOS'
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
PLATFORM='Linux'
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
PLATFORM='Windows'
fi
if [ $PLATFORM == "Windows" ]; then
ORIGINAL_PATH_TO_SCRIPT="${0}"
CLEANED_PATH_TO_SCRIPT="${ORIGINAL_PATH_TO_SCRIPT//\\//}"
ROOT_DIR=`dirname "$CLEANED_PATH_TO_SCRIPT"`
else
ROOT_DIR="$( cd "$( dirname "$0" )" && pwd )"
fi
ROOT_DIR=$ROOT_DIR/..
# Enter masterproject directory
cd $ROOT_DIR
# git settings
echo -e $INFO "install git settings"
git config commit.template setup/git/git_commit_template.txt
git config color.ui true
if [ -d ".git/hooks" ]; then
cp setup/git/git_pre_commit_hook.sh .git/hooks/pre-commit
cp setup/git/git_pre_push_hook.sh .git/hooks/pre-push
fi
# Create Debug and Release folders
echo -e $INFO "create build folders"
if [ $PLATFORM == "Windows" ]; then
else
mkdir -p build/Debug/app
mkdir -p build/Debug/test
mkdir -p build/Release/app
mkdir -p build/Release/test
fi
if [ $PLATFORM == "Windows" ]; then
else
MY_PATH=`dirname "$0"`
$MY_PATH/download_python_indexer.sh
fi
# Setup both Debug and Release configuration
if [ $PLATFORM == "Linux" ] || [ $PLATFORM == "MacOS" ]; then
mkdir -p build/Debug
mkdir -p build/Release
echo -e $INFO "run cmake with Debug configuration"
cd build/Debug && cmake -G Ninja -DCMAKE_BUILD_TYPE="Debug" ../..
echo -e $INFO "run cmake with Release configuration"
cd ../Release && cmake -G Ninja -DCMAKE_BUILD_TYPE="Release" ../..
fi
echo -e $SUCCESS "setup complete"
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
# get absolute path to parent directory of script
MY_PATH=`dirname "$0"`
if [[ "${MY_PATH}" != *\\* ]]
then
cd $MY_PATH
MY_PATH=`pwd`
fi
MY_PATH="${MY_PATH//\\//}"
cd ${MY_PATH}/..
git config commit.template setup/git/git_commit_template.txt
git config color.ui true
if [ -d ".git/hooks" ]; then
cp setup/git/git_pre_commit_hook.sh .git/hooks/pre-commit
cp setup/git/git_pre_push_hook.sh .git/hooks/pre-push
fi
+1 -1
View File
@@ -29,7 +29,7 @@ cd $ROOT_DIR/
cd java_indexer
echo "cleaning and building java_indexer.jar"
echo -e $INFO "cleaning and building java_indexer.jar"
mvn clean package
cd ../
-9
View File
@@ -1,9 +0,0 @@
#!/bin/bash
# Determine path to script
MY_PATH=`dirname "$0"`
cd $MY_PATH/..
# Build and run target
ninja -C build/Debug "$1" && cd bin && valgrind --tool=memcheck --leak-check=yes --log-file=../build/Debug/"$1".leaklog Debug/"$1"
-9
View File
@@ -1,9 +0,0 @@
#!/bin/bash
# Determine path to script
MY_PATH=`dirname "$0"`
cd $MY_PATH/..
# Build and run target
ninja -C build/Release "$1" && cd bin && valgrind --tool=memcheck --leak-check=yes --log-file=../build/Release/"$1".leaklog Release/"$1"