Add config files in any components folder (#1878)

* add config files in any components folder
* all test run option ft and option to skip build and run only test
This commit is contained in:
Eugenio Romano
2017-05-14 10:04:44 +01:00
committed by Eugenio Romano
parent 130c2e4428
commit af82f83669
199 changed files with 8193 additions and 298 deletions

View File

@@ -2,7 +2,9 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
eval RUN_TEST=false
eval EXEC_FAST_TEST=false
eval EXEC_CLEAN=false
eval EXEC_BUILD=true
eval EXEC_GIT_NPM_INSTALL_JSAPI=false
eval GIT_ISH=""
@@ -27,7 +29,9 @@ eval projects=( "ng2-alfresco-core"
show_help() {
echo "Usage: npm-build-all.sh"
echo ""
echo "-e or -exclude exclude initial build"
echo "-t or -test build all your local component and run also the test on them"
echo "-ft or -fast test build all your local component and run also the test in one single karmatestshim (high memory consuming and less details)"
echo "-c or -clean the node_modules folder before to start the build"
echo "-gitjsapi to build all the components against a commit-ish version of the JS-API"
}
@@ -41,6 +45,10 @@ test_project() {
npm run test -- --component $1 || exit 1
}
enable_fast_test() {
EXEC_FAST_TEST=true
}
enable_js_api_git_link() {
GIT_ISH='git://github.com/Alfresco/alfresco-js-api.git#'$1
EXEC_GIT_NPM_INSTALL_JSAPI=true
@@ -50,13 +58,19 @@ clean() {
EXEC_CLEAN=true
}
exclude_build(){
EXEC_BUILD=false
}
while [[ $1 == -* ]]; do
case "$1" in
-h|--help|-\?) show_help; exit 0;;
-t|--test) enable_test; shift;;
-ft|--fasttest) enable_fast_test; shift;;
-gitjsapi) enable_js_api_git_link $2; shift 2;;
-v|--version) install_version_pacakge $2; shift 2;;
-c|--clean) clean; shift;;
-s|--skipbuild) exclude_build; shift;;
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
esac
done
@@ -84,8 +98,15 @@ if $EXEC_GIT_NPM_INSTALL_JSAPI == true; then
cd "$DIR/../ng2-components/"
fi
echo "====== Build ng2-components ====="
npm run build || exit 1
if $EXEC_BUILD == true; then
echo "====== Build ng2-components ====="
npm run build || exit 1
fi
if $EXEC_FAST_TEST == true; then
echo "====== Test all ng2-components (fast option) ====="
npm run test || exit 1
fi
for PACKAGE in ${projects[@]}
do