-
Notifications
You must be signed in to change notification settings - Fork 0
/
generateCI.sh
executable file
·85 lines (77 loc) · 2.19 KB
/
generateCI.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
#!/bin/bash
#
# Script for CI generation
#
# Searches for all necessary jars from selected Wollok installation (first argument)
# and puts it into jars folder
#
# Author: Dodain
#
if [ -z $1 ]
then
echo -e "Usage: generateCI Wollok_dev_root_installation_folder"
echo -e "Remember you must have Wollok Development environment installed. Follow the instructions in"
echo -e "https://github.com/uqbar-project/wollok/wiki/Development---Environment-Setup"
echo -e "and make sure you run 'mvn clean install' first."
echo -e "Example: if you have a sibling folder wollok-dev and inside you have a wollok directory, call it"
echo -e "$ generateCI.sh ../wollok-dev/wollok"
echo -e "(without the trailing /)"
exit 1
fi
# Folders initialization
CLI_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
JARS_FOLDER=$CLI_DIR/jars/
mkdir -p $JARS_FOLDER
LAUNCH_FOLDER="$1/org.uqbar.project.wollok.launch"
LIB="$LAUNCH_FOLDER/lib"
SRC="$LAUNCH_FOLDER/target"
LIB_GAME="$1/org.uqbar.project.wollok.game/lib"
# List of .jar dependencies
JARS=(
"com.google.inject"
"com.google.guava"
"javax.inject"
"org.apache.commons"
"org.apache.log4j"
"org.antlr.runtime"
"org.eclipse.jface"
"org.eclipse.ui-"
"org.eclipse.xtext"
"org.eclipse.equinox"
"org.eclipse.emf"
"org.eclipse.core"
"org.eclipse.debug.core"
"org.eclipse.debug.ui"
"org.eclipse.jdt.debug"
"org.eclipse.jdt.core"
"org.eclipse.jdt.launching"
"org.eclipse.osgi"
"org.eclipse.ui.workbench.texteditor"
"org.eclipse.ui.ide"
"org.eclipse.xtend.lib"
"org.eclipse.xtext.ui"
"org.eclipse.xtext.ui.shared"
"org.uqbar.project.xinterpreter"
"org.uqbar.project.wollok-"
"org.uqbar.project.wollok.lib"
"org.uqbar.project.wollok.launch"
"org.uqbar.project.wollok.game"
)
echo "Removing wollok jars"
rm $JARS_FOLDER/*wollok*
rm $JARS_FOLDER/*xinterpreter*
# Copying all .jars into wollok-cli jars folder
# Step 1 => from target folder
for i in "${JARS[@]}"
do
echo "Copying $i*.jar"
find $SRC -name "$i*.jar" | xargs cp -t $JARS_FOLDER
done
echo "Copying game lib jars"
cp $LIB_GAME/*.jar $JARS_FOLDER
# Step 2 => from lib folder
for i in `find $LIB -type f -name "*.jar"`
do
echo "Copying $i"
cp $i $JARS_FOLDER
done