Skip to main content
summaryrefslogtreecommitdiffstats
blob: 8cf4760eb3de31e34b91fdd3c811c96ab93d29e3 (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
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
#! /bin/sh
# Copyright (c) 2010 Stephan Herrmann.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
#     Stephan Herrmann - initial API and implementation
###############################################################################

# =============================================================================
# MAIN BUILD AND TEST SCRIPT FOR THE OBJECT TEAMS DEVELOPMENT TOOLING (OTDT)
# =============================================================================
# INPUT: Variables from otdt_prerequisites:
# -----------------------------------------------------------------------------
# TMPDIR                for log output
# TEST_TMPDIR           for temp test files
# OT_TESTSUITE_DIR      root directory for building and testing
# METADATA				directory for metadata from previous builds
# SDK_QUALIFIER			build qualifier of the base eclipse SDK
# ECLIPSE_SDK_TGZ       archive file of the base eclipse SDK build (full path)
# ECLIPSE_TESTLIB_ZIP   archive file of the eclipse test framework (full path)
# PUBLISHED_UPDATES 	directory of previously published plugins&features
# FETCH_CACHE_LOCATION	git working area holding caches for fetch
# MAP_FILE_PATH			path to the otdt.map file (original location of otdt.map.in)
# ANT_PROFILE           configure the ant process
# NICE                  niceness value for nice -n ${NICE}
# =============================================================================
# OUTPUT: Variables passed to the toplevel ant script
# -----------------------------------------------------------------------------
## As Environment Variables:
##      ANT_OPTS                configure Ant
## As Ant Arguments (from ANT_PROFILE):
##      -verbose                configure Ant
## As Java Properties:
##      -Declipse-app.tgz       path of eclipse SDK
##      -Declipse.tests.zip     path of eclipse test framework
##		-Dpublished.updates		path to previously published things
##      -Ddo.build.all          true|false: should OTDT and tests be built?
##      -Ddo.run.tests          true|false: should test be run?
##    	-DfetchCacheLocation    git working area holding caches for fetch
##		-Dmap.file.path			path to the otdt.map file (original location of otdt.map.in)
##		-D_hasSaxon.jar			to prevent copying of saxon8.jar (was needed on build.eclipse.org)
# =============================================================================

usage()
{
	echo "Usage:"
	echo "$0 [-b|-nobuild]"
        echo "  -b:         build OTDT only, no testing."
        echo "  -nobuild:   don't build OTDT, directly invoke testing."
}

cleanup()
{
	echo "cleanup(): Currently no cleanup is configured"
}

_prefix=`dirname $0`
_prefix=`readlink -f $_prefix`
. "${_prefix}/otdt_prerequisites-hipp.sh"

echo "=== Sourced otdt_prerequisites-hipp.sh ==="
env
echo "====================================="

#LOCAL: log file:
OT_SUITE_LOG=$TMPDIR/ot-testsuite.log

# LOCAL: the initial ant build file:
BUILDFILE="${_prefix}/run.xml"

#LOCAL: main ant target:
MAIN_TARGET=${MAIN_TARGET:="ot-junit-all"}

#LOCAL: should OTDT and tests be built?
DO_BUILD="true"

#LOCAL: should the tests be run?
DO_RUN="true"

case ${MAIN_TARGET} in
	"ot-junit-run")
		DO_BUILD="false"
		;;
	"ot-compiler-build")
		;&
	"ot-junit-build")
		DO_RUN="false"
		;;
esac

# start working:

test -d "$TMPDIR" || mkdir -p "$TMPDIR"
test -d "$OT_TESTSUITE_DIR" || mkdir -p "$OT_TESTSUITE_DIR"
cd "$OT_TESTSUITE_DIR"

# cleanup previous:
if [ "$DO_BUILD" == "true" ]
then
	rm -rf build-root
	rm -rf test-root
	rm -rf updateSite
    rm -rf updateSiteTests
    rm -rf updateSiteCompiler
	rm -rf metadata
	rm -rf ecj
else
	rm -f test-root/eclipse/results/*
fi

# preload metadata for appending:
if [ -f "${METADATA}/content.xml" ]
then
    mkdir -p metadata
    cp ${METADATA}/*.xml metadata
fi

trap "echo Aborting by SIGTERM; cleanup; exit 130" INT

# Assemble the Ant call:
ANT_OPTIONS="${ANT_PROFILE} \
    -Declipse-app.tgz=${ECLIPSE_SDK_TGZ} \
    -Declipse.tests.zip=${ECLIPSE_TESTLIB_ZIP} \
    -Declipse.sdk.qualifier=${SDK_QUALIFIER} \
    -Dpublished.updates=${PUBLISHED_UPDATES} \
    -Ddo.run.tests=${DO_RUN} \
    -Ddo.build.all=${DO_BUILD} \
    -Dtest.tmpDir=${TEST_TMPDIR} \
    -DfetchCacheLocation=${FETCH_CACHE_LOCATION} \
    -Dmap.file.path=${MAP_FILE_PATH} \
    -D_hasSaxon.jar=true"

ANT_OPTS="-Xmx1024m"
export ANT_OPTS

CMD="nice -n ${NICE} ant -f ${BUILDFILE} ${ANT_OPTIONS} ${MAIN_TARGET}"

echo "Running $CMD"
eval "$CMD" < /dev/null

trap - INT


Back to the top