forked from orcc/ci-server-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.orcc.sh
executable file
·149 lines (123 loc) · 5.2 KB
/
build.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
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
148
149
#!/bin/bash
source `dirname $0`/defines.sh
echo "***START*** $0 `date -R`"
echo "Start building Orcc plugins ($BUILDTYPE)"
echo ""
echo "****************************************************************"
echo "* Generate Cal Xtext arcitecture *"
echo "****************************************************************"
echo ""
cd $PLUGINSDIR/net.sf.orcc.cal
java -cp $MWECP org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher src/net/sf/orcc/cal/GenerateCal.mwe2
[ "$?" != "0" ] && exit 1
echo ""
echo "****************************************************************"
echo "* Generate Java sources from Xtend [net.sf.orcc.backends] *"
echo "****************************************************************"
echo ""
cd $PLUGINSDIR/net.sf.orcc.backends
rm -fr xtend-gen/*
java -cp $XTENDCP org.eclipse.xtend.core.compiler.batch.Main -cp $XTENDCP -d xtend-gen src
[ "$?" != "0" ] && exit 1
echo ""
echo "****************************************************************"
echo "* Generate Java sources from Xtend [net.sf.orcc.models] *"
echo "****************************************************************"
echo ""
cd $PLUGINSDIR/net.sf.orcc.models
rm -fr xtend-gen/*
java -cp $XTENDCP org.eclipse.xtend.core.compiler.batch.Main -cp $XTENDCP -d xtend-gen src
[ "$?" != "0" ] && exit 1
echo ""
echo "****************************************************************"
echo "* Generate Java sources from Xtend [net.sf.orcc.core] *"
echo "****************************************************************"
echo ""
cd $PLUGINSDIR/net.sf.orcc.core
rm -fr xtend-gen/*
java -cp $XTENDCP org.eclipse.xtend.core.compiler.batch.Main -cp $XTENDCP -d xtend-gen src
[ "$?" != "0" ] && exit 1
echo ""
echo "****************************************************************"
echo "* Generate Java sources from Xtend [net.sf.orcc.simulators] *"
echo "****************************************************************"
echo ""
cd $PLUGINSDIR/net.sf.orcc.simulators
rm -fr xtend-gen/*
java -cp $XTENDCP org.eclipse.xtend.core.compiler.batch.Main -cp $XTENDCP -d xtend-gen ../net.sf.orcc.core/xtend-gen:src
[ "$?" != "0" ] && exit 1
echo ""
echo "****************************************************************"
echo "* Generate Java sources from Xtend [net.sf.orcc.ui] *"
echo "****************************************************************"
echo ""
cd $PLUGINSDIR/net.sf.orcc.ui
rm -fr xtend-gen/*
java -cp $XTENDCP org.eclipse.xtend.core.compiler.batch.Main -cp $XTENDCP -d xtend-gen src
[ "$?" != "0" ] && exit 1
echo ""
echo "****************************************************************"
echo "* Generate Java sources from Xtend [org.xronos.orcc] *"
echo "****************************************************************"
echo ""
cd $PLUGINSDIR/org.xronos.orcc
rm -fr xtend-gen/*
java -cp $XTENDCP org.eclipse.xtend.core.compiler.batch.Main -cp $XTENDCP -d xtend-gen ../net.sf.orcc.backends/xtend-gen:src
[ "$?" != "0" ] && exit 1
echo ""
echo "****************************************************************"
echo "* Launch PDE Build *"
echo "****************************************************************"
echo ""
# Define PDE build specific variables
LAUNCHERJAR=`echo $ECLIPSEBUILD/plugins/org.eclipse.equinox.launcher_*.jar`
BUILDFILE=`echo $ECLIPSEBUILD/plugins/org.eclipse.pde.build_*`/scripts/build.xml
CONFIGDIR=$ORCCWORK/pde-config/
KEEPONLYLATESTVERSIONS=true # Set to false when a Release build will be defined
LOCALREPO=$ORCCWORK/repository.$BUILDTYPE
if [ "$BUILDTYPE" == "tests" ]
then
PDEBUILDTYPE=I
elif [ "$BUILDTYPE" == "nightly" ]
then
PDEBUILDTYPE=N
else
PDEBUILDTYPE=R
fi
mkdir -p $LOCALREPO
mkdir -p $BUILDDIR
$ECLIPSEBUILD/eclipse -nosplash -consoleLog \
-application org.eclipse.ant.core.antRunner \
-buildfile $BUILDFILE \
-Dbuilder=$CONFIGDIR \
-DbaseLocation=$ECLIPSEBUILD \
-DpluginPath=$ECLIPSEBUILD:$BUILDDIR \
-DbuildType=$PDEBUILDTYPE \
-DtopLevelElementId=net.sf.orcc \
-DbuildDirectory=$BUILDDIR \
-Dbase=$BUILDDIR \
-Dp2.mirror.slicing.latestVersionOnly=$KEEPONLYLATESTVERSIONS \
-Dp2.build.repo=file:$LOCALREPO
[ "$?" != "0" ] && exit 1
echo ""
echo "****************************************************************"
echo "* Installing Orcc plugins on eclipse runtime *"
echo "****************************************************************"
echo ""
echo "Uninstall old Orcc feature"
$ECLIPSEBUILD/eclipse -nosplash -consoleLog \
-application org.eclipse.equinox.p2.director \
-destination $ECLIPSERUN \
-uninstallIU net.sf.orcc.feature.group \
|| echo -e "\n*** There is no existing Orcc feature to uninstall. This is probably the first time this script is \
launched since last eclipse reinstall. Please ignore the previous error message. ***"
echo "Install new Orcc feature"
$ECLIPSEBUILD/eclipse -nosplash -consoleLog \
-application org.eclipse.equinox.p2.director \
-destination $ECLIPSERUN \
-artifactRepository file:$LOCALREPO \
-metadataRepository file:$LOCALREPO \
-repository $ECLIPSEREPOSITORY \
-installIU net.sf.orcc.feature.group
[ "$?" != "0" ] && exit 1
echo "***END*** $0 `date -R`"