forked from apache/netbeans
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sh
189 lines (159 loc) · 5.1 KB
/
init.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
set -x
#Initialize all the environment
#Create test result xml file - call:
#create_test_result( testname, message, failures=0 )
create_test_result() {
if [ -z "$3" ]; then
FAILURES="0"
else
FAILURES="$3"
fi
mkdir -p $WORKSPACE/results
FILE="$WORKSPACE/results/TEST-$1.xml"
echo '<?xml version="1.0" encoding="UTF-8" ?>' >$FILE
echo '<testsuite errors="0" failures="'$FAILURES'" name="'$1'" tests="1" time="1">' >>$FILE
echo ' <properties>' >>$FILE
echo ' </properties>' >>$FILE
echo ' <testcase classname="'$1'" name="'$1'" time="1">' >>$FILE
if [ "$FAILURES" -gt "0" ]; then
echo ' <failure message="Failed"/>' >>$FILE
fi
echo ' </testcase>' >>$FILE
echo ' <system-out><![CDATA[' >>$FILE
echo "$2" >>$FILE
echo ']]></system-out>' >>$FILE
echo ' <system-err></system-err>' >>$FILE
echo '</testsuite>' >>$FILE
}
#NB_BRANCH default
if [ -z ${NB_BRANCH} ]; then
export NB_BRANCH=default
fi
#L10N_BRANCH default
if [ -z ${L10N_BRANCH} ]; then
export L10N_BRANCH=default
fi
#OTHER_LICENCES_BRANCH default
if [ -z ${OTHER_LICENCES_BRANCH} ]; then
export OTHER_LICENCES_BRANCH=default
fi
#JAVAFX build 1/0
if [ -z ${RUNJAVAFX} ]; then
export RUNJAVAFX=0
fi
#ML_BUILD yes/no 1/0
if [ -z ${ML_BUILD} ]; then
export ML_BUILD=0
fi
#EN_BUILD yes/no 1/0
if [ -z ${EN_BUILD} ]; then
export EN_BUILD=1
fi
if [ -z ${LOCALES} ]; then
export LOCALES=ja,zh_CN,pt_BR,ru
fi
if [ -z ${NB_VER_NUMBER} ]; then
export NB_VER_NUMBER=11
fi
if [ -z ${UPLOAD_ML} ]; then
export UPLOAD_ML=0
fi
#GLASSFISH_BUILDS_HOST=http://jre.us.oracle.com
if [ -z ${GLASSFISH_BUILDS_HOST} ]; then
GLASSFISH_BUILDS_HOST=http://jre.us.oracle.com
export GLASSFISH_BUILDS_HOST
fi
#JRE_BUILDS_HOST=http://jre.us.oracle.com
if [ -z ${JRE_BUILDS_HOST} ]; then
JRE_BUILDS_HOST=http://jre.us.oracle.com
export JRE_BUILDS_HOST
fi
#JRE_BUILDS_PATH=http://jre.us.oracle.com
if [ -z ${JRE_BUILDS_PATH} ]; then
JRE_BUILDS_PATH=java/re/jdk/8u101/promoted/
export JRE_BUILDS_PATH
fi
#JDK_BUILDS_HOST=http://jre.us.oracle.com
if [ -z ${JDK_BUILDS_HOST} ]; then
JDK_BUILDS_HOST=https://java.se.oracle.com/
export JDK_BUILDS_HOST
fi
#JDK7_BUILDS_PATH=http://jre.us.oracle.com/java/re/jdk/7u75/promoted/all
if [ -z ${JDK7_BUILDS_PATH} ]; then
JDK7_BUILDS_PATH=java/re/jdk/7u75/promoted/
export JDK7_BUILDS_PATH
fi
#JDK8_BUILDS_PATH=http://jre.us.oracle.com/java/re/jdk/8u141/promoted/all/
if [ -z ${JDK8_BUILDS_PATH} ]; then
# JDK8_BUILDS_PATH=java/re/jdk/8u141/promoted/ #for builds before 8u141
JDK8_BUILDS_PATH=artifactory/re-release-local/jdk/8u171/b11/bundles/
export JDK8_BUILDS_PATH
fi
if [ -z ${JDK11_BUILDS_PATH} ]; then
JDK11_BUILDS_PATH=artifactory/re-release-local/jdk/11.0.1/13/bundles/
export JDK11_BUILDS_PATH
fi
if [ -z ${DEBUGLEVEL} ]; then
DEBUGLEVEL=source,lines,vars
export DEBUGLEVEL
fi
if [ -z ${DONT_PACK_LOCALIZATION_JARS_ON_MAC} ]; then
DONT_PACK_LOCALIZATION_JARS_ON_MAC=y
export DONT_PACK_LOCALIZATION_JARS_ON_MAC
fi
export ANT_OPTS=$ANT_OPTS" -Xmx2G"
if [ -n ${JDK_HOME} ] && [ -z ${JAVA_HOME} ] ; then
export JAVA_HOME=$JDK_HOME
elif [ -n ${JAVA_HOME} ] && [ -z ${JDK_HOME} ]; then
export JDK_HOME=$JAVA_HOME
fi
if [ -z ${DATESTAMP} ]; then
if [ -z ${BUILD_ID} ]; then
export DATESTAMP=`date -u +%Y%m%d%H%M`
else
#Use BUILD_ID from hudson, remove all "-" and "_" and cut it to 12 chars
export DATESTAMP=`echo ${BUILD_ID} | sed -e "s/[-_]//g" | cut -c 1-12`
fi
fi
BUILDNUM=$BUILD_DESC
BUILDNUMBER=$DATESTAMP
if [ -z $BASE_DIR ]; then
echo BASE_DIR variable not defined, using the default one: /space/NB-IDE
echo if you want to use another base dir for the whole build feel free
echo to define a BASE_DIR variable in your environment
export BASE_DIR=/space/NB-IDE
fi
if [ -z $NB_ALL ]; then
NB_ALL=$BASE_DIR/main
fi
DIST=$BASE_DIR/dist
LOGS=$DIST/logs
BASENAME=$BUILDNUM
export BASENAME_PREFIX=$BUILD_DESC
mkdir -p $DIST/zip
mkdir -p $LOGS
#LOGS
IDE_BUILD_LOG=$LOGS/$BASENAME-build-ide.log
MOBILITY_BUILD_LOG=$LOGS/$BASENAME-build-mobility.log
NBMS_BUILD_LOC=$LOGS/$BASENAME-build-nbms.log
SCP_LOG=$LOGS/$BASENAME-scp.log
MAC_LOG=$LOGS/$BASENAME-native_mac.log
MAC_LOG_NEW=$LOGS/$BASENAME-native_mac_new.log
INSTALLER_LOG=$LOGS/$BASENAME-installers.log