-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathgradle.sh
executable file
·40 lines (31 loc) · 1 KB
/
gradle.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
#!/bin/bash
task="${1}"
run_class="${2}"
continuous='--continuous'
echo "Class: ${run_class}"
echo "Class: ${run_class}" 2>&1
# Test file
echo "INFO: Finding run class..."
file=`find . -name ${run_class}.groovy -or -name ${run_class}.java | head -n 1 | sed -E 's#^\./##'`
echo "Found file: ${file}"
if [ "${3}" == "debug" ]; then
debug="-Dtest.debug=true"
fi
if [[ $file =~ ^src/(test|main)/(groovy|java).* ]]; then
echo "INFO: Project is not a multi-project run."
else
# Project
project_folder=`echo ${file} |sed -e 's#/src/main/.*##' |sed -e 's#/src/test/.*##'`
project=`echo ${project_folder} |sed -e 's#/#:#g' -e 's/^/:/'`
echo "project_folder: ${project_folder}"
echo "project: ${project}"
if [ "${project}" != "" ]; then
echo "INFO: Test lives in project: ${project}"
task="${project}:${task}"
else
echo "INFO: Test lives in root project."
task=${task}
fi
fi
echo "gradle ${continuous} ${task} ${debug}"
gradle ${continuous} ${task} ${debug}