Speed up build (#1852)

* single build webpack

* fix demo shell test
This commit is contained in:
Eugenio Romano
2017-05-03 13:01:00 +02:00
committed by Eugenio Romano
parent 8959476941
commit 0b246b8211
362 changed files with 2684 additions and 13104 deletions

View File

@@ -34,25 +34,12 @@ feel for what's available.
./start.sh -update or -u
```
* If you want to use your local components use the following script with any of the previous option. It will npm link all the components
in the demo shell:
```sh
./start.sh -link or -l
```
* If you want to build all your local component:
```sh
./npm-buid-all.sh
```
* If you want to build all your local component and link it together and in the demo shell:
```sh
./npm-buid-all.sh -l or -link
```
* If you want to build all your local component and run the test:
```sh

View File

@@ -2,7 +2,6 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
eval RUN_TEST=false
eval RUN_LINK=false
eval projects=( "ng2-alfresco-core"
"ng2-alfresco-datatable"
@@ -14,6 +13,7 @@ eval projects=( "ng2-alfresco-core"
"ng2-alfresco-documentlist"
"ng2-alfresco-login"
"ng2-alfresco-search"
"ng2-alfresco-social"
"ng2-alfresco-tag"
"ng2-alfresco-social"
"ng2-alfresco-upload"
@@ -25,64 +25,40 @@ show_help() {
echo "Usage: npm-build-all.sh"
echo ""
echo "-t or -test build all your local component and run also the test on them"
echo "-l or -link link together the local component and link it also in the demo shell"
}
enable_test(){
RUN_TEST=true
}
enable_link(){
RUN_LINK=true
}
build_project() {
cd $1
echo "====== build project: $2 ====="
npm install
if $RUN_TEST == true; then
npm run test
fi
if $RUN_LINK == true; then
npm run travis
fi
npm run tsc
npm run build.umd
if $RUN_LINK == true; then
npm link
fi
test_project() {
echo "====== test project: $1 ====="
npm run test || exit 1
}
while [[ $1 == -* ]]; do
case "$1" in
-h|--help|-\?) show_help; exit 0;;
-l|--link) enable_link; shift;;
-t|--test) enable_test; shift;;
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
esac
done
cd "$DIR/../ng2-components/"
npm install package-json-merge -g
npm install rimraf -g
npm install license-check -g
npm run pkg-build
npm install && npm run build || exit 1
for PACKAGE in ${projects[@]}
do
DESTDIR="$DIR/../ng2-components/${PACKAGE}"
build_project $DESTDIR $PACKAGE
cd $DESTDIR
npm run license-check || exit 1
if $RUN_TEST == true; then
test_project $PACKAGE
fi
done
#Install demo
cd "$DIR/../demo-shell-ng2"
npm install
if $RUN_LINK == true; then
#LINK ALL THE COMPONENTS INSIDE THE DEMO-SHELL
for PACKAGE in ${projects[@]}
do
DESTDIR="$DIR/../ng2-components/${PACKAGE}"
echo "====== demo shell linking: ${PACKAGE} ====="
npm link ${PACKAGE}
done
fi

View File

@@ -12,6 +12,7 @@ eval projects=( "ng2-activiti-diagrams"
"ng2-alfresco-documentlist"
"ng2-alfresco-login"
"ng2-alfresco-search"
"ng2-alfresco-social"
"ng2-alfresco-tag"
"ng2-alfresco-social"
"ng2-alfresco-upload"
@@ -19,6 +20,8 @@ eval projects=( "ng2-activiti-diagrams"
"ng2-alfresco-webscript"
"ng2-alfresco-userinfo" )
npm install rimraf -g
for PACKAGE in ${projects[@]}
do
echo "====== clean component: ${PACKAGE} ====="
@@ -35,4 +38,7 @@ done
cd "$DIR/../demo-shell-ng2"
npm run clean
cd "$DIR/../ng2-components"
npm run clean
cd ${DIR}

View File

@@ -1,33 +0,0 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#LINK CORE
echo "====== linking component: ng2-alfresco-core ====="
cd "$DIR/../ng2-components/ng2-alfresco-core/demo"
npm install
#LINK ALL THE OTHERS COMPONENTS
for PACKAGE in \
ng2-alfresco-datatable \
ng2-activiti-diagrams \
ng2-activiti-analytics \
ng2-activiti-form \
ng2-activiti-tasklist \
ng2-activiti-processlist \
ng2-alfresco-documentlist \
ng2-alfresco-login \
ng2-alfresco-search \
ng2-alfresco-tag \
ng2-alfresco-upload \
ng2-alfresco-viewer \
ng2-alfresco-social \
ng2-alfresco-webscript \
ng2-alfresco-userinfo
do
DESTDIR="$DIR/../ng2-components/${PACKAGE}"
echo "====== linking component: ${PACKAGE} ====="
cd "$DESTDIR/demo"
npm link ${PACKAGE}
npm travis
done

View File

@@ -1,56 +0,0 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#LINK ALL THE COMPONENTS
for PACKAGE in \
ng2-alfresco-core \
ng2-alfresco-datatable \
ng2-activiti-diagrams \
ng2-activiti-analytics \
ng2-activiti-form \
ng2-activiti-tasklist \
ng2-activiti-processlist \
ng2-alfresco-documentlist \
ng2-alfresco-login \
ng2-alfresco-search \
ng2-alfresco-tag \
ng2-alfresco-social \
ng2-alfresco-upload \
ng2-alfresco-viewer \
ng2-alfresco-webscript \
ng2-alfresco-userinfo
do
DESTDIR="$DIR/../ng2-components/${PACKAGE}"
echo "====== linking component: ${PACKAGE} ====="
cd "$DESTDIR"
npm run travis
npm link
done
#LINK ALL THE COMPONENTS INSIDE THE DEMO-SHELL
cd "$DIR/../demo-shell-ng2"
for PACKAGE in \
ng2-activiti-diagrams \
ng2-activiti-analytics \
ng2-activiti-form \
ng2-activiti-processlist \
ng2-activiti-tasklist \
ng2-alfresco-core \
ng2-alfresco-datatable \
ng2-alfresco-documentlist \
ng2-alfresco-login \
ng2-alfresco-search \
ng2-alfresco-tag \
ng2-alfresco-social \
ng2-alfresco-upload \
ng2-alfresco-viewer \
ng2-alfresco-webscript \
ng2-alfresco-userinfo
do
DESTDIR="$DIR/../ng2-components/${PACKAGE}"
echo "====== demo shell linking: ${PACKAGE} ====="
npm link ${PACKAGE}
done
npm install

View File

@@ -10,7 +10,6 @@ show_help() {
echo "-i or -install start the demo shell and install the dependencies"
echo "-u or -update start the demo shell and update the dependencies"
echo "-c or -cleanInstall clean the demo shell install the dependencies and start the the demo shell"
echo "-l or -link all the ng2-components in the demo shell and start the the demo shell"
}
install() {
@@ -27,22 +26,6 @@ cleanInstall() {
npm install
}
link() {
echo "link"
"$DIR/npm-link-demo-shell.sh"
}
eval args=("$@");
while [[ $1 == -* ]]; do
case "$1" in
-l|--link) link; shift;;
-*) shift;;
esac
done
set -- "${args[@]}";
while [[ $1 == -* ]]; do
case "$1" in
-h|--help|-\?) show_help; exit 0;;