Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: d2841592f5031b1f248e475e2370ac0169f72fee (plain) (blame)
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
#!/usr/bin/env bash

# Utility to invoke eclipse antrunner
#    the build file, if not build.xml, must be first argument
#    that can be followed be target or other arguments


BUILD_HOME=${BUILD_HOME:-/shared/eclipse/eclipse3I}


if [ ! -d "${BUILD_HOME}" ]
then
  echo "ERROR: BUILD_HOME was not an existing directory as expected: ${BUILD_HOME}"
  exit 1
fi

# For most uses, this directory does not HAVE to literally be
# the eclipseBuider. It is in production, but for testing, it can
# be any directory where ${ECLIPSEBUILDER_DIR}/scripts are located.
ECLIPSEBUILDER_DIR=${ECLIPSEBUILDER_DIR:-${BUILD_HOME}/build/supportDir/org.eclipse.releng.eclipsebuilder}

if [ ! -d "${ECLIPSEBUILDER_DIR}/scripts" ]
then
  echo "ERROR: builder scripts was not an existing directory as expected: ${ECLIPSEBUILDER_DIR}/scripts}"
  exit 1
fi

# specify devworkspace and JRE to use to runEclipse.
# Historically, we wanted to use Java 5 for processing artifacts.
# Ideally same one used to pre-condition (normalize, -repack)
# the jars in the first place since only version that is fully forward 
# compatible. 
JAVA_5_HOME=${JAVA_5_HOME:-/shared/common/jdk1.5.0-latest}
JAVA_6_HOME=${JAVA_6_HOME:-/shared/common/jdk1.6.0-latest}
JAVA_7_HOME=${JAVA_7_HOME:-/shared/common/jdk1.7.0-latest}
JAVA_8_HOME=${JAVA_8_HOME:-/shared/common/jdk1.8.0_x64-latest}

export JAVA_HOME=${JAVA_HOME:-${JAVA_7_HOME}}

devJRE=$JAVA_HOME/jre/bin/java

if [ ! -n ${devJRE} -a -x ${devJRE} ]
then
  echo "ERROR: could not find (or execute) JRE were expected: ${devJRE}"
  exit 1
else
  # display version, just to be able to log it.
  echo "JRE Location and Version: ${devJRE}"
  echo $( $devJRE -version )
fi

# remember, the eclispe install must match the VM used (e.g. both 64 bit, both 32 bit, etc).
ECLIPSE_EXE=${ECLIPSE_EXE:-/shared/eclipse/eclipse3I/build/supportDir/org.eclipse.releng.basebuilder/eclipse}

if [ ! -n ${ECLIPSE_EXE} -a -x ${ECLIPSE_EXE} ]
then
  echo "ERROR: ECLIPSE_EXE is not defined or not executable: ${ECLIPSE_EXE}"
  exit 1001
fi



buildId=$1
shift
if [[ -z "${buildId}" ]]
then
  echo "need buildId as first argument"
fi

BUILDFILE=$1
shift
if [ -e $BUILDFILE ]
then
  BUILDFILESTR=" -file $BUILDFILE"
  shift
else
  BUILDFILESTR=" -file build.xml"
fi

# use special $@ to keep all arguments quoted (instead of one big string)
extraArgs="$@"

echo
echo " BUILDFILESTR: $BUILDFILESTR"
if [ -n "${extraArgs}" ]
then
  echo "   extraArgs: ${extraArgs}"
  echo "      as it is right now, target name must be first \"extraArg\" if specifying one."
fi
echo


devworkspace="${BUILD_HOME}"/workspace-antRunner
devArgs="-Xmx512m -DbuildId=${buildId}"

echo
echo "   dev script:   $0"
echo "   devworkspace: $devworkspace"
echo "   devArgs:      $devArgs"
echo

if [ -n ${ECLIPSE_EXE} -a -x ${ECLIPSE_EXE} ]
then

  ${ECLIPSE_EXE}  -Dhuson=true --launcher.suppressErrors  -nosplash -console -data $devworkspace -application org.eclipse.ant.core.antRunner $BUILDFILESTR ${extraArgs} -vm $devJRE -vmargs $devArgs
  RC=$?
else
  echo "ERROR: ECLIPSE_EXE is not defined to executable eclipse"
  RC=1
fi
exit $RC

Back to the top