forked from orcc/ci-server-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.orcc.sh
executable file
·65 lines (50 loc) · 1.77 KB
/
run.orcc.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
#!/bin/bash
source `dirname $0`/defines.sh
[ ! -d "$2" ] && echo "Second argument must be a directory with Orcc projects as subfolders" && exit 1
[ -z "$3" ] && echo "Third argument must be the backend you want to use" && exit 1
[ -z "$4" ] && echo "Fourth argument must be the project where is located your top network" && exit 1
[ -z "$5" ] && echo "Fifth argument must be the qualified name of the top network" && exit 1
[ -z "$6" ] && echo "Sixth argument must be the directory you want to build sources" && exit 1
APPDIR=$2
BACKEND=$3
PROJECT=$4
NETWORK=$5
OUTPUT=$6
FLAGS=$7
echo "***START*** $0 `date -R`"
[ ! -d "$OUTPUT" ] && mkdir -p $OUTPUT
RUNWORKSPACE=$APPDIR
rm -fr $RUNWORKSPACE/.metadata $RUNWORKSPACE/.JETEmitters
rm -fr $RUNWORKSPACE/**/bin
echo "Register Orcc projects in eclipse workspace"
$ECLIPSERUN/eclipse -nosplash -consoleLog \
-application net.sf.orcc.cal.workspaceSetup \
-data $RUNWORKSPACE \
$APPDIR
[ "$?" != "0" ] && exit 1
# Frontend will generate IR only for used files. But all IR must be generated for jade and java backend
if [ "$BACKEND" != "jade" ] && [ "$BACKEND" != "java" ]; then
FENETWORK=$NETWORK
fi
echo ""
echo "Generate Orcc IR for $PROJECT and projects it depends on"
$ECLIPSERUN/eclipse -nosplash -consoleLog \
-application net.sf.orcc.cal.cli \
-data $RUNWORKSPACE \
$PROJECT \
$FENETWORK \
-vmargs -Xms40m -Xmx768m
[ "$?" != "0" ] && exit 1
rm -fr $OUTPUT/*
echo ""
echo "Build application with $BACKEND backend"
$ECLIPSERUN/eclipse -nosplash -consoleLog \
-application net.sf.orcc.backends.$BACKEND \
-data $RUNWORKSPACE \
-p $PROJECT \
-o $OUTPUT \
$FLAGS \
$NETWORK \
-vmargs -Xms40m -Xmx768m
[ "$?" != "0" ] && exit 1
echo "***END*** $0 `date -R`"