forked from eclipse-emfcloud/coffee-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·139 lines (119 loc) · 4.7 KB
/
run.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/bin/bash
echo "$(date +"[%T.%3N]") Evaluate Options... "
buildBackend='false'
copyBackend='false'
buildFrontend='false'
forceFrontend='false'
runFrontend='false'
if [[ "$1" == "" ]]; then
buildBackend='true'
copyBackend='true'
buildFrontend='true'
runFrontend='true'
fi
if [[ ${#1} -gt 2 ]]; then
if [[ "$1" == -*"b"* ]]; then
buildBackend='true'
fi
if [[ "$1" == -*"c"* ]]; then
copyBackend='true'
fi
if [[ "$1" == -*"f"* ]]; then
buildFrontend='true'
fi
if [[ "$1" == -*"r"* ]]; then
runFrontend='true'
fi
if [[ "$1" == -*"ff"* ]]; then
forceFrontend='true'
fi
fi
while [ "$1" != "" ]; do
case $1 in
-b | --backend ) buildBackend='true'
;;
-c | --copy ) copyBackend='true'
;;
-f | --frontend ) buildFrontend='true'
;;
-ff | --forcefrontend ) forceFrontend='true'
;;
-r | --run ) runFrontend='true'
;;
esac
shift
done
[[ "$buildBackend" == "true" ]] && echo " Build Backend (-b)" || echo " Do not build Backend (-b)"
[[ "$copyBackend" == "true" ]] && echo " Copy Backend (-c)" || echo " Do not copy Backend (-c)"
[[ "$forceFrontend" == "true" ]] && echo " Remove yarn.lock (-ff)" || echo " Do not remove yarn.lock (-ff)"
[[ "$buildFrontend" == "true" ]] && echo " Build Frontend (-f)" || echo " Do not build Frontend (-f)"
[[ "$runFrontend" == "true" ]] && echo " Run Frontend (-r)" || echo " Do not run Frontend (-r)"
if [ "$buildBackend" == "true" ]; then
echo "$(date +"[%T.%3N]") Build backend products"
cd backend/releng/com.eclipsesource.coffee.parent/
mvn clean install -Pfatjar -U
cd ../../../
fi
if [ "$copyBackend" == "true" ]; then
productPath=''
if [[ "$OSTYPE" == "linux-gnu" ]]; then
productPath='linux/gtk'
echo "Running on Linux"
elif [[ "$OSTYPE" == "darwin"* ]]; then
# Mac OSX
productPath='macosx\cocoa'
echo "Running on Mac"
elif [[ "$OSTYPE" == "cygwin" ]]; then
# POSIX compatibility layer and Linux environment emulation for Windows
productPath='win32\win32'
echo "Running on Windows with Cygwin"
elif [[ "$OSTYPE" == "msys" ]]; then
# Lightweight shell and GNU utilities compiled for Windows (part of MinGW)
productPath='win32\win32'
echo "Running on Windows with Msys"
fi
echo "$productPath"
echo "$(date +"[%T.%3N]") Copy built products..."
inputCodeGen=backend/releng/com.eclipsesource.coffee.product/target/products/com.eclipsesource.coffee.product.codegen/$productPath/x86_64
outputCodeGen=web/coffee-java-extension/server
echo " $(date +"[%T.%3N]") Copy CodeGen to '$outputCodeGen'."
rm -rf $outputCodeGen && mkdir -p $outputCodeGen && cp -rf $inputCodeGen $outputCodeGen
inputWorkflowAnalyzer=backend/releng/com.eclipsesource.coffee.product/target/products/com.eclipsesource.coffee.product.workflow.analyzer/$productPath/x86_64
outputWorkflowAnalyzer=web/coffee-workflow-analyzer/server
echo " $(date +"[%T.%3N]") Copy WorkflowAnalyzer to '$outputWorkflowAnalyzer'."
rm -rf $outputWorkflowAnalyzer && mkdir -p $outputWorkflowAnalyzer && cp -rf $inputWorkflowAnalyzer $outputWorkflowAnalyzer
inputWorkflowDSL=backend/releng/com.eclipsesource.coffee.product/target/products/com.eclipsesource.coffee.product.workflow.dsl/$productPath/x86_64
outputWorkflowDSL=web/coffee-workflow-analyzer-editors/server
echo " $(date +"[%T.%3N]") Copy WorkflowDSL to '$outputWorkflowDSL'."
rm -rf $outputWorkflowDSL && mkdir -p $outputWorkflowDSL && cp -rf $inputWorkflowDSL $outputWorkflowDSL
inputWorkflowGLSP=backend/plugins/com.eclipsesource.workflow.glsp.server/target/com.eclipsesource.workflow.glsp.server-0.0.1-SNAPSHOT-glsp.jar
outputWorkflowGLSP=web/coffee-server/build
echo " $(date +"[%T.%3N]") Copy WorkflowGLSPServer to '$outputWorkflowGLSP'."
rm -rf $outputWorkflowGLSP && mkdir -p $outputWorkflowGLSP && cp -rf $inputWorkflowGLSP $outputWorkflowGLSP
inputCoffeeMS=backend/plugins/com.eclipsesource.coffee.modelserver/target/com.eclipsesource.coffee.modelserver-0.1.0-SNAPSHOT-standalone.jar
outputCoffeeMS=web/coffee-server/build
echo " $(date +"[%T.%3N]") Copy CoffeeModelServer to '$outputCoffeeMS'."
cp -rf $inputCoffeeMS $outputCoffeeMS
echo "$(date +"[%T.%3N]") Copy finished."
fi
if [ "$downloadServers" == "true" ]; then
cd ./web/coffee-server/scripts/
./download-server.sh
cd ../../../
fi
if [ "$forceFrontend" == "true" ]; then
cd web/
rm -f ./yarn.lock
cd ..
fi
if [ "$buildFrontend" == "true" ]; then
cd web/
yarn
cd ..
fi
if [ "$runFrontend" == "true" ]; then
workspace=$(pwd)
(sleep 5 && firefox 127.1:3000/#/${workspace:1}/backend/examples/SuperBrewer3000)&
cd web/browser-app
yarn start --hostname 0.0.0.0
fi