forked from eclipse-emfcloud/coffee-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·147 lines (127 loc) · 5.23 KB
/
run.sh
File metadata and controls
executable file
·147 lines (127 loc) · 5.23 KB
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
139
140
141
142
143
144
145
146
147
#!/bin/bash
set -e
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/org.eclipse.emfcloud.coffee.parent/
mvn clean install
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..."
# Java Generation
inputCodeGen=backend/releng/org.eclipse.emfcloud.coffee.product/target/products/org.eclipse.emfcloud.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
# C++ Generation
inputCppCodeGen=backend/releng/org.eclipse.emfcloud.coffee.product/target/products/org.eclipse.emfcloud.coffee.product.codegen.cpp/$productPath/x86_64
outputCppCodeGen=web/coffee-cpp-extension/server
echo " $(date +"[%T.%3N]") Copy CPP CodeGen to '$outputCppCodeGen'."
rm -rf $outputCppCodeGen && mkdir -p $outputCppCodeGen && cp -rf $inputCppCodeGen $outputCppCodeGen
inputWorkflowAnalyzer=backend/releng/org.eclipse.emfcloud.coffee.product/target/products/org.eclipse.emfcloud.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/org.eclipse.emfcloud.coffee.product/target/products/org.eclipse.emfcloud.coffee.product.workflow.dsl/$productPath/x86_64
outputWorkflowDSL=web/coffee-server/server/lsp
echo " $(date +"[%T.%3N]") Copy WorkflowDSL to '$outputWorkflowDSL'."
rm -rf $outputWorkflowDSL && mkdir -p $outputWorkflowDSL && cp -rf $inputWorkflowDSL $outputWorkflowDSL
inputWorkflowGLSP=backend/releng/org.eclipse.emfcloud.coffee.product/target/products/org.eclipse.emfcloud.coffee.product.workflow.glsp.server/$productPath/x86_64
outputWorkflowGLSP=web/coffee-server/server/glsp
echo " $(date +"[%T.%3N]") Copy WorkflowGLSPServer to '$outputWorkflowGLSP'."
rm -rf $outputWorkflowGLSP && mkdir -p $outputWorkflowGLSP && cp -rf $inputWorkflowGLSP $outputWorkflowGLSP
inputCoffeeMS=backend/releng/org.eclipse.emfcloud.coffee.product/target/products/org.eclipse.emfcloud.coffee.product.modelserver/$productPath/x86_64
outputCoffeeMS=web/coffee-server/server/model
echo " $(date +"[%T.%3N]") Copy CoffeeModelServer to '$outputCoffeeMS'."
rm -rf $outputCoffeeMS && mkdir -p $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 cache clean
yarn --ignore-engines --unsafe-perm
cd ..
fi
if [ "$runFrontend" == "true" ]; then
workspace=$(pwd)
(sleep 5 && x-www-browser http://127.1:3000/#/${workspace:1}/backend/examples/SuperBrewer3000)&
cd web/
yarn start
fi