refactoring build script #1533 (#1664)

This commit is contained in:
Eugenio Romano
2017-02-27 09:15:52 +00:00
committed by Denys Vuika
parent 45a37d61f5
commit 571b7f09c3
38 changed files with 137 additions and 391 deletions

View File

@@ -13,7 +13,7 @@ feel for what's available.
* Start the demo and Install all the dependencies (*Note. do it this way only the first time, and be aware, it will take some time*)
```sh
./start.sh -install
./start.sh -install or -i
```
* Start the demo (*the standard way of starting the demo after first initialization*):
@@ -25,20 +25,20 @@ feel for what's available.
* Start the demo, install all the dependencies, and remove the previous version of the npm packages (*Note. do this only after big changes*):
```sh
./start.sh -cleanInstall
./start.sh -cleanInstall or -c
```
* Start the demo and update the dependencies:
```sh
./start.sh -update
./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-linked.sh
./start.sh -link or -l
```
* If you want to build all your local component:
@@ -47,4 +47,10 @@ in the demo shell:
./npm-buid-alll.sh
```
* If you want clean all your local component and the demo shell:
```sh
./npm-clean.sh
```
For development environment configuration please refer to [project docs](../demo-shell-ng2/README.md).

View File

@@ -5,7 +5,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
build_project() {
cd $1
echo "====== build project: $2 ====="
npm run build
npm install
}
for PACKAGE in \

View File

@@ -1,114 +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"
npm link
#LINK FORM
echo "====== linking component: ng2-activiti-form ====="
cd "$DIR/../ng2-components/ng2-activiti-form"
npm link ng2-alfresco-core
npm link
#LINK DATATABLE
echo "====== linking component: ng2-alfresco-datatable ====="
cd "$DIR/../ng2-components/ng2-alfresco-datatable"
npm link ng2-alfresco-core
npm link
#LINK DOCUMENTLIST
echo "====== linking component: ng2-alfresco-documentlist ====="
cd "$DIR/../ng2-components/ng2-alfresco-documentlist"
npm link ng2-alfresco-core
npm link ng2-alfresco-datatable
npm link
#LINK WEBSCRIPT
echo "====== linking component: ng2-alfresco-webscript ====="
cd "$DIR/../ng2-components/ng2-alfresco-webscript"
npm link ng2-alfresco-core
npm link ng2-alfresco-datatable
npm link
#LINK TASKLIST
echo "====== linking component: ng2-activiti-tasklist ====="
cd "$DIR/../ng2-components/ng2-activiti-tasklist"
npm link ng2-alfresco-core
npm link ng2-alfresco-datatable
npm link ng2-activiti-form
npm link
#LINK PROCESSLIST
echo "====== linking component: ng2-activiti-processlist ====="
cd "$DIR/../ng2-components/ng2-activiti-processlist"
npm link ng2-alfresco-core
npm link ng2-alfresco-datatable
npm link ng2-activiti-form
npm link ng2-activiti-tasklist
npm link
#LINK DIAGRAMS
echo "====== linking component: ng2-activiti-diagrams ====="
cd "$DIR/../ng2-components/ng2-activiti-diagrams"
npm link ng2-alfresco-core
npm link
#LINK ANALYTICS
echo "====== linking component: ng2-activiti-analytics ====="
cd "$DIR/../ng2-components/ng2-activiti-analytics"
npm link ng2-alfresco-core
npm link ng2-activiti-diagrams
npm link
#LINK SEARCH
echo "====== linking component: ng2-alfresco-search ====="
cd "$DIR/../ng2-components/ng2-alfresco-search"
npm link ng2-alfresco-core
npm link ng2-alfresco-datatable
npm link ng2-alfresco-documentlist
npm link
#LINK ALL THE OTHERS COMPONENTS
for PACKAGE in \
ng2-alfresco-login \
ng2-alfresco-userinfo \
ng2-alfresco-upload \
ng2-alfresco-tag \
ng2-alfresco-viewer
do
DESTDIR="$DIR/../ng2-components/${PACKAGE}"
echo "====== linking component: ${PACKAGE} ====="
cd "$DESTDIR"
npm link ng2-alfresco-core
npm link
done
#LINK ALL THE COMPONENTS INSIDE THE DEMOSHELL
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-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

@@ -1,39 +0,0 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
npm install -g npm-check
echo 'start' > ../check-dependecies.log
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-upload \
ng2-alfresco-viewer \
ng2-alfresco-webscript \
ng2-alfresco-userinfo
do
echo "====== Check component: ${PACKAGE} ====="
cd "$DIR/../ng2-components/${PACKAGE}"
echo "====== Check component: ${PACKAGE} =====" >> ../../check-dependecies.log
npm-check >> ../../check-dependecies.log
done
cd "$DIR/../demo-shell-ng2"
echo "====== Check component: ${PACKAGE} =====" >> ../check-dependecies.log
npm-check >> ../check-dependecies.log
echo "====== You can find the log in the file check-dependecies.log in the main root====="
cd ${DIR}

View File

@@ -7,91 +7,28 @@ echo "====== linking component: ng2-alfresco-core ====="
cd "$DIR/../ng2-components/ng2-alfresco-core/demo"
npm install
#LINK FORM
echo "====== linking component: ng2-activiti-form ====="
cd "$DIR/../ng2-components/ng2-activiti-form/demo"
npm link ng2-activiti-form
npm link ng2-alfresco-core
npm install
#LINK DATATABLE
echo "====== linking component: ng2-alfresco-datatable ====="
cd "$DIR/../ng2-components/ng2-alfresco-datatable/demo"
npm link ng2-alfresco-datatable
npm link ng2-alfresco-core
npm install
#LINK DOCUMENTLIST
echo "====== linking component: ng2-alfresco-documentlist ====="
cd "$DIR/../ng2-components/ng2-alfresco-documentlist/demo"
npm link ng2-alfresco-documentlist
npm link ng2-alfresco-core
npm link ng2-alfresco-datatable
npm install
#LINK WEBSCRIPT
echo "====== linking component: ng2-alfresco-webscript ====="
cd "$DIR/../ng2-components/ng2-alfresco-webscript/demo"
npm link ng2-alfresco-webscript
npm link ng2-alfresco-core
npm link ng2-alfresco-datatable
npm install
#LINK TASKLIST
echo "====== linking component: ng2-activiti-tasklist ====="
cd "$DIR/../ng2-components/ng2-activiti-tasklist/demo"
npm link ng2-activiti-tasklist
npm link ng2-alfresco-core
npm link ng2-alfresco-datatable
npm link ng2-activiti-form
npm install
#LINK PROCESSLIST
echo "====== linking component: ng2-activiti-processlist ====="
cd "$DIR/../ng2-components/ng2-activiti-processlist/demo"
npm link ng2-activiti-processlist
npm link ng2-alfresco-core
npm link ng2-alfresco-datatable
npm link ng2-activiti-form
npm link ng2-activiti-tasklist
npm install
#LINK DIAGRAMS
echo "====== linking component: ng2-activiti-diagrams ====="
cd "$DIR/../ng2-components/ng2-activiti-diagrams/demo"
npm link ng2-activiti-diagrams
npm link ng2-alfresco-core
npm install
#LINK ANALYTICS
echo "====== linking component: ng2-activiti-analytics ====="
cd "$DIR/../ng2-components/ng2-activiti-analytics/demo"
npm link ng2-activiti-analytics
npm link ng2-alfresco-core
npm link ng2-activiti-diagrams
npm install
#LINK SEARCH
echo "====== linking component: ng2-alfresco-search ====="
cd "$DIR/../ng2-components/ng2-alfresco-search/demo"
npm link ng2-alfresco-core
npm link ng2-alfresco-datatable
npm link ng2-alfresco-documentlist
npm link ng2-alfresco-search
npm link
npm run build
#LINK ALL THE OTHERS 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-userinfo \
ng2-alfresco-upload \
ng2-alfresco-search \
ng2-alfresco-tag \
ng2-alfresco-viewer
ng2-alfresco-upload \
ng2-alfresco-viewer \
ng2-alfresco-webscript \
ng2-alfresco-userinfo
do
DESTDIR="$DIR/../ng2-components/${PACKAGE}"
echo "====== linking component: ${PACKAGE} ====="
cd "$DESTDIR/demo"
npm link ng2-alfresco-core
npm link ${PACKAGE}
npm travis
npm install
done

103
scripts/npm-link-demo-shell.sh Executable file → Normal file
View File

@@ -2,103 +2,32 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#LINK CORE
echo "====== linking component: ng2-alfresco-core ====="
cd "$DIR/../ng2-components/ng2-alfresco-core"
npm link
npm run build
#LINK FORM
echo "====== linking component: ng2-activiti-form ====="
cd "$DIR/../ng2-components/ng2-activiti-form"
npm link ng2-alfresco-core
npm link
npm run build
#LINK DATATABLE
echo "====== linking component: ng2-alfresco-datatable ====="
cd "$DIR/../ng2-components/ng2-alfresco-datatable"
npm link ng2-alfresco-core
npm link
npm run build
#LINK DOCUMENTLIST
echo "====== linking component: ng2-alfresco-documentlist ====="
cd "$DIR/../ng2-components/ng2-alfresco-documentlist"
npm link ng2-alfresco-core
npm link ng2-alfresco-datatable
npm link
npm run build
#LINK WEBSCRIPT
echo "====== linking component: ng2-alfresco-webscript ====="
cd "$DIR/../ng2-components/ng2-alfresco-webscript"
npm link ng2-alfresco-core
npm link ng2-alfresco-datatable
npm link
npm run build
#LINK TASKLIST
echo "====== linking component: ng2-activiti-tasklist ====="
cd "$DIR/../ng2-components/ng2-activiti-tasklist"
npm link ng2-alfresco-core
npm link ng2-alfresco-datatable
npm link ng2-activiti-form
npm link
npm run build
#LINK PROCESSLIST
echo "====== linking component: ng2-activiti-processlist ====="
cd "$DIR/../ng2-components/ng2-activiti-processlist"
npm link ng2-alfresco-core
npm link ng2-alfresco-datatable
npm link ng2-activiti-form
npm link ng2-activiti-tasklist
npm link
npm run build
#LINK DIAGRAMS
echo "====== linking component: ng2-activiti-diagrams ====="
cd "$DIR/../ng2-components/ng2-activiti-diagrams"
npm link ng2-alfresco-core
npm link
npm run build
#LINK ANALYTICS
echo "====== linking component: ng2-activiti-analytics ====="
cd "$DIR/../ng2-components/ng2-activiti-analytics"
npm link ng2-alfresco-core
npm link ng2-activiti-diagrams
npm link
npm run build
#LINK SEARCH
echo "====== linking component: ng2-alfresco-search ====="
cd "$DIR/../ng2-components/ng2-alfresco-search"
npm link ng2-alfresco-core
npm link ng2-alfresco-datatable
npm link ng2-alfresco-documentlist
npm link
npm run build
#LINK ALL THE OTHERS COMPONENTS
#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-userinfo \
ng2-alfresco-upload \
ng2-alfresco-search \
ng2-alfresco-tag \
ng2-alfresco-viewer
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 link ng2-alfresco-core
npm travis
npm link
npm run build
done
#LINK ALL THE COMPONENTS INSIDE THE DEMOSHELL
#LINK ALL THE COMPONENTS INSIDE THE DEMO-SHELL
cd "$DIR/../demo-shell-ng2"
for PACKAGE in \
ng2-activiti-diagrams \

View File

@@ -1,21 +0,0 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
"$DIR/npm-link-demo-shell.sh"
cd "$DIR/../demo-shell-ng2"
if [[ $1 = "-install" ]]; then
npm install
npm run start
elif [[ $1 = "-update " ]]; then
npm run update
npm run start
elif [[ $1 = "-cleanInstall" ]]; then
npm run clean
npm install
npm run start
else
npm run start
fi

View File

@@ -4,16 +4,52 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR/../demo-shell-ng2"
if [[ $1 = "-install" ]]; then
show_help() {
echo "Usage: start.sh"
echo ""
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() {
npm install
npm run start
elif [[ $1 = "-update " ]]; then
}
update() {
echo "update"
npm run update
npm run start
elif [[ $1 = "-cleanInstall" ]]; then
}
cleanInstall() {
npm run clean
npm install
npm run start
else
npm run start
fi
}
link() {
echo "link"
"$DIR/npm-link-demo-shell.sh"
}
eval OPTIONS=$1
while [[ $1 == -* ]]; do
case "$1" in
-l|--link) link; shift;;
-*) shift;;
esac
done
while [[ $OPTIONS == -* ]]; do
case "$OPTIONS" in
-h|--help|-\?) show_help; exit 0;;
-i|--install) install; shift;;
-u|--update) update; shift;;
-c|--cleanInstall) cleanInstall; shift;;
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
esac
done
npm run start

View File

@@ -63,8 +63,6 @@ echo "====== UPDATE VERSION OF DEMO-SHELL to ${VERSION} version ======"
sed -i '' "s/\"version\": \"[0-9]\\.[0-9]\\.[0-9]\"/\"version\": \"${VERSION}\"/g" ${DIR}/../demo-shell-ng2/package.json
for PACKAGE in \
ng2-activiti-diagrams \
ng2-activiti-analytics \