author | erikj |
Fri, 03 Jun 2016 16:30:27 +0200 | |
changeset 38628 | 11af6696675c |
parent 37972 | e1fa5c2e62a0 |
child 39194 | d56b54bc6437 |
permissions | -rw-r--r-- |
34491 | 1 |
/* |
2 |
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
/* |
|
34496 | 27 |
* This file defines build profiles for the JIB tool and others. |
34491 | 28 |
* |
29 |
* A build profile defines a set of configuration options and external |
|
30 |
* dependencies that we for some reason or other care about specifically. |
|
31 |
* Typically, build profiles are defined for the build configurations we |
|
32 |
* build regularly. |
|
33 |
* |
|
34 |
* Contract against this file from the tools that use it, is to provide |
|
35 |
* a function on the form: |
|
36 |
* |
|
34496 | 37 |
* getJibProfiles(input) |
34491 | 38 |
* |
39 |
* which returns an object graph describing the profiles and their |
|
40 |
* dependencies. The name of the function is based on the name of this |
|
41 |
* file, minus the extension and the '-', camel cased and prefixed with |
|
42 |
* 'get'. |
|
43 |
* |
|
44 |
* |
|
45 |
* The parameter 'input' is an object that optionally contains some data. |
|
46 |
* Optionally because a tool may read the configuration for different purposes. |
|
47 |
* To initially get a list of available profiles, the active profile may not |
|
48 |
* yet be known for instance. |
|
49 |
* |
|
50 |
* Data that may be set on the input object: |
|
51 |
* |
|
52 |
* input.profile = <name of active profile> |
|
53 |
* |
|
54 |
* If the active profile is set, the following data from it must also |
|
55 |
* be provided: |
|
56 |
* |
|
57 |
* input.profile |
|
58 |
* input.target_os |
|
59 |
* input.target_cpu |
|
60 |
* input.build_os |
|
61 |
* input.build_cpu |
|
62 |
* input.target_platform |
|
63 |
* input.build_platform |
|
64 |
* // The build_osenv_* variables describe the unix layer on Windows systems, |
|
65 |
* // i.e. Cygwin, which may also be 32 or 64 bit. |
|
66 |
* input.build_osenv |
|
67 |
* input.build_osenv_cpu |
|
68 |
* input.build_osenv_platform |
|
69 |
* |
|
70 |
* For more complex nested attributes, there is a method "get": |
|
71 |
* |
|
72 |
* input.get("<dependency>", "<attribute>") |
|
73 |
* |
|
74 |
* Valid attributes are: |
|
75 |
* install_path |
|
76 |
* download_path |
|
77 |
* download_dir |
|
78 |
* |
|
79 |
* |
|
80 |
* The output data generated by this configuration file has the following |
|
81 |
* format: |
|
82 |
* |
|
83 |
* data: { |
|
84 |
* // Identifies the version of this format to the tool reading it |
|
85 |
* format_version: "1.0", |
|
86 |
* |
|
34496 | 87 |
* // Name of base outputdir. JIB assumes the actual output dir is formed |
34491 | 88 |
* // by adding the configuration name: <output_basedir>/<config-name> |
89 |
* output_basedir: "build", |
|
90 |
* // Configure argument to use to specify configuration name |
|
91 |
* configuration_configure_arg: |
|
92 |
* // Make argument to use to specify configuration name |
|
93 |
* configuration_make_arg: |
|
94 |
* |
|
95 |
* profiles: { |
|
96 |
* <profile-name>: { |
|
97 |
* // Name of os the profile is built to run on |
|
98 |
* target_os; <string> |
|
99 |
* // Name of cpu the profile is built to run on |
|
100 |
* target_cpu; <string> |
|
101 |
* // Combination of target_os and target_cpu for convenience |
|
102 |
* target_platform; <string> |
|
103 |
* // Name of os the profile is built on |
|
104 |
* build_os; <string> |
|
105 |
* // Name of cpu the profile is built on |
|
106 |
* build_cpu; <string> |
|
107 |
* // Combination of build_os and build_cpu for convenience |
|
108 |
* build_platform; <string> |
|
109 |
* |
|
110 |
* // List of dependencies needed to build this profile |
|
111 |
* dependencies: <Array of strings> |
|
112 |
* |
|
113 |
* // List of configure args to use for this profile |
|
114 |
* configure_args: <Array of strings> |
|
115 |
* |
|
116 |
* // List of free form labels describing aspects of this profile |
|
117 |
* labels: <Array of strings> |
|
118 |
* } |
|
119 |
* } |
|
120 |
* |
|
121 |
* // Dependencies use a Maven like deployment structure |
|
122 |
* dependencies: { |
|
123 |
* <dependency-name>: { |
|
124 |
* // Organization part of path defining this dependency |
|
125 |
* organization: <string> |
|
126 |
* // File extension for this dependency |
|
127 |
* ext: <string> |
|
128 |
* // Module part of path for defining this dependency, |
|
129 |
* // defaults to <dependency-name> |
|
130 |
* module: <string> |
|
131 |
* // Revision part of path for defining this dependency |
|
132 |
* revision: <string> |
|
133 |
* |
|
134 |
* // List of configure args to add when using this dependency, |
|
135 |
* // defaults to |
|
136 |
* // "--with-<dependency-name>=input.get("<dependency-name", "install_path")" |
|
137 |
* configure_args: <array of strings> |
|
138 |
* |
|
139 |
* // Name of environment variable to set when using this dependency |
|
140 |
* // when running make |
|
141 |
* environment_name: <string> |
|
142 |
* // Value of environment variable to set when using this dependency |
|
143 |
* // when running make |
|
144 |
* environment_value: <string> |
|
145 |
* |
|
146 |
* // Value to add to the PATH variable when using this dependency, |
|
147 |
* // applies to both make and configure |
|
148 |
* environment_path: <string> |
|
149 |
* } |
|
150 |
* |
|
151 |
* <dependency-name>: { |
|
152 |
* // For certain dependencies where a legacy distribution mechanism is |
|
153 |
* // already in place, the "javare" server layout is also supported |
|
154 |
* // Indicate that an alternate server source and layout should be used |
|
155 |
* server: "javare" |
|
156 |
* |
|
157 |
* // For "javare", a combination of module, revision, |
|
158 |
* // build number (optional), files and checksum file is possible for |
|
159 |
* // artifacts following the standard layout. |
|
160 |
* module: <string> |
|
161 |
* revision: <string> |
|
162 |
* build_number: <string> |
|
163 |
* checksum_file: <string> |
|
164 |
* file: <string> |
|
165 |
* |
|
166 |
* // For other files, use checksum path and path instead |
|
167 |
* checksum_path: <string> |
|
168 |
* path: <string> |
|
169 |
* } |
|
170 |
* } |
|
171 |
* } |
|
172 |
*/ |
|
173 |
||
174 |
/** |
|
175 |
* Main entry to generate the profile configuration |
|
176 |
* |
|
177 |
* @param input External data to use for generating the configuration |
|
178 |
* @returns {{}} Profile configuration |
|
179 |
*/ |
|
34496 | 180 |
var getJibProfiles = function (input) { |
34491 | 181 |
|
182 |
var data = {}; |
|
183 |
||
184 |
// Identifies the version of this format to the tool reading it |
|
185 |
data.format_version = "1.0"; |
|
186 |
||
187 |
// Organization is used when uploading/publishing build results |
|
188 |
data.organization = "com.oracle.jpg.jdk"; |
|
189 |
||
34496 | 190 |
// The base directory for the build output. JIB will assume that the |
34491 | 191 |
// actual build directory will be <output_basedir>/<configuration> |
192 |
data.output_basedir = "build"; |
|
193 |
// The configure argument to use to specify the name of the configuration |
|
194 |
data.configuration_configure_arg = "--with-conf-name="; |
|
195 |
// The make argument to use to specify the name of the configuration |
|
196 |
data.configuration_make_arg = "CONF_NAME="; |
|
197 |
||
198 |
// Define some common values |
|
34496 | 199 |
var common = getJibProfilesCommon(input); |
34491 | 200 |
// Generate the profiles part of the configuration |
34496 | 201 |
data.profiles = getJibProfilesProfiles(input, common); |
34491 | 202 |
// Generate the dependencies part of the configuration |
34496 | 203 |
data.dependencies = getJibProfilesDependencies(input, common); |
34491 | 204 |
|
205 |
return data; |
|
206 |
}; |
|
207 |
||
208 |
/** |
|
209 |
* Generates some common values |
|
210 |
* |
|
211 |
* @param input External data to use for generating the configuration |
|
212 |
* @returns Common values |
|
213 |
*/ |
|
34496 | 214 |
var getJibProfilesCommon = function (input) { |
37649
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
215 |
var common = {}; |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
216 |
|
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
217 |
common.dependencies = ["boot_jdk", "gnumake", "jtreg"], |
37972 | 218 |
common.default_make_targets = ["product-bundles", "test-bundles"], |
37649
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
219 |
common.default_make_targets_debug = common.default_make_targets; |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
220 |
common.default_make_targets_slowdebug = common.default_make_targets; |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
221 |
common.configure_args = ["--enable-jtreg-failure-handler"], |
37964
cd007c0a0cb5
8155950: Add minimal VM in JIB profile on linux-x86
lmesnik
parents:
37649
diff
changeset
|
222 |
common.configure_args_32bit = ["--with-target-bits=32"], |
37649
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
223 |
common.configure_args_debug = ["--enable-debug"], |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
224 |
common.configure_args_slowdebug = ["--with-debug-level=slowdebug"], |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
225 |
common.organization = "jpg.infra.builddeps" |
34491 | 226 |
|
227 |
return common; |
|
228 |
}; |
|
229 |
||
230 |
/** |
|
231 |
* Generates the profiles part of the configuration. |
|
232 |
* |
|
233 |
* @param input External data to use for generating the configuration |
|
234 |
* @param common The common values |
|
235 |
* @returns {{}} Profiles part of the configuration |
|
236 |
*/ |
|
34496 | 237 |
var getJibProfilesProfiles = function (input, common) { |
34491 | 238 |
var profiles = {}; |
239 |
||
240 |
// Main SE profiles |
|
241 |
var mainProfiles = { |
|
242 |
||
243 |
"linux-x64": { |
|
244 |
target_os: "linux", |
|
245 |
target_cpu: "x64", |
|
246 |
dependencies: concat(common.dependencies, "devkit"), |
|
37649
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
247 |
configure_args: concat(common.configure_args, "--with-zlib=system"), |
37972 | 248 |
default_make_targets: concat(common.default_make_targets, "docs-bundles") |
34491 | 249 |
}, |
250 |
||
251 |
"linux-x86": { |
|
252 |
target_os: "linux", |
|
253 |
target_cpu: "x86", |
|
254 |
build_cpu: "x64", |
|
255 |
dependencies: concat(common.dependencies, "devkit"), |
|
36727
a86a1a1cae13
8153303: Jib profiles config broken after JDK-8153257 after JDK-8031767
tbell
parents:
36724
diff
changeset
|
256 |
configure_args: concat(common.configure_args, common.configure_args_32bit, |
37964
cd007c0a0cb5
8155950: Add minimal VM in JIB profile on linux-x86
lmesnik
parents:
37649
diff
changeset
|
257 |
"--with-jvm-variants=minimal,client,server", "--with-zlib=system"), |
37649
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
258 |
default_make_targets: common.default_make_targets |
34491 | 259 |
}, |
260 |
||
261 |
"macosx-x64": { |
|
262 |
target_os: "macosx", |
|
263 |
target_cpu: "x64", |
|
264 |
dependencies: concat(common.dependencies, "devkit"), |
|
37649
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
265 |
configure_args: concat(common.configure_args, "--with-zlib=system"), |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
266 |
default_make_targets: common.default_make_targets |
34491 | 267 |
}, |
268 |
||
269 |
"solaris-x64": { |
|
270 |
target_os: "solaris", |
|
271 |
target_cpu: "x64", |
|
272 |
dependencies: concat(common.dependencies, "devkit", "cups"), |
|
37649
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
273 |
configure_args: concat(common.configure_args, "--with-zlib=system"), |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
274 |
default_make_targets: common.default_make_targets |
34491 | 275 |
}, |
276 |
||
277 |
"solaris-sparcv9": { |
|
278 |
target_os: "solaris", |
|
279 |
target_cpu: "sparcv9", |
|
280 |
dependencies: concat(common.dependencies, "devkit", "cups"), |
|
37649
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
281 |
configure_args: concat(common.configure_args, "--with-zlib=system"), |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
282 |
default_make_targets: common.default_make_targets |
34491 | 283 |
}, |
284 |
||
285 |
"windows-x64": { |
|
286 |
target_os: "windows", |
|
287 |
target_cpu: "x64", |
|
288 |
dependencies: concat(common.dependencies, "devkit", "freetype"), |
|
37649
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
289 |
configure_args: concat(common.configure_args), |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
290 |
default_make_targets: common.default_make_targets |
34491 | 291 |
}, |
292 |
||
293 |
"windows-x86": { |
|
294 |
target_os: "windows", |
|
295 |
target_cpu: "x86", |
|
296 |
build_cpu: "x64", |
|
297 |
dependencies: concat(common.dependencies, "devkit", "freetype"), |
|
37964
cd007c0a0cb5
8155950: Add minimal VM in JIB profile on linux-x86
lmesnik
parents:
37649
diff
changeset
|
298 |
configure_args: concat(common.configure_args, |
cd007c0a0cb5
8155950: Add minimal VM in JIB profile on linux-x86
lmesnik
parents:
37649
diff
changeset
|
299 |
"--with-jvm-variants=client,server", common.configure_args_32bit), |
37649
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
300 |
default_make_targets: common.default_make_targets |
34491 | 301 |
} |
302 |
}; |
|
303 |
profiles = concatObjects(profiles, mainProfiles); |
|
304 |
// Generate debug versions of all the main profiles |
|
305 |
profiles = concatObjects(profiles, generateDebugProfiles(common, mainProfiles)); |
|
36532 | 306 |
// Generate slowdebug versions of all the main profiles |
307 |
profiles = concatObjects(profiles, generateSlowdebugProfiles(common, mainProfiles)); |
|
34491 | 308 |
|
36532 | 309 |
// Generate open only profiles for all the main profiles for JPRT and reference |
310 |
// implementation builds. |
|
36534
b74ff34537ac
8151800: Jib profile for open linux should produce compact profiles images by default
erikj
parents:
36532
diff
changeset
|
311 |
var openOnlyProfiles = generateOpenOnlyProfiles(common, mainProfiles); |
b74ff34537ac
8151800: Jib profile for open linux should produce compact profiles images by default
erikj
parents:
36532
diff
changeset
|
312 |
// The open only profiles on linux are used for reference builds and should |
37649
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
313 |
// produce the compact profile images by default. This adds "profiles" as an |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
314 |
// extra default target. |
36534
b74ff34537ac
8151800: Jib profile for open linux should produce compact profiles images by default
erikj
parents:
36532
diff
changeset
|
315 |
var openOnlyProfilesExtra = { |
34491 | 316 |
"linux-x64-open": { |
37649
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
317 |
default_make_targets: "profiles" |
34491 | 318 |
}, |
319 |
||
36170
d493c08255eb
8150504: JIB profiles for reference implementation builds
erikj
parents:
35036
diff
changeset
|
320 |
"linux-x86-open": { |
38628
11af6696675c
8158540: Open only linux-x86 builds using Jib fails when building "minimal" jvm
erikj
parents:
37972
diff
changeset
|
321 |
default_make_targets: "profiles", |
11af6696675c
8158540: Open only linux-x86 builds using Jib fails when building "minimal" jvm
erikj
parents:
37972
diff
changeset
|
322 |
configure_args: "--with-jvm-variants=client,server" |
34491 | 323 |
} |
324 |
}; |
|
36534
b74ff34537ac
8151800: Jib profile for open linux should produce compact profiles images by default
erikj
parents:
36532
diff
changeset
|
325 |
var openOnlyProfiles = concatObjects(openOnlyProfiles, openOnlyProfilesExtra); |
b74ff34537ac
8151800: Jib profile for open linux should produce compact profiles images by default
erikj
parents:
36532
diff
changeset
|
326 |
|
b74ff34537ac
8151800: Jib profile for open linux should produce compact profiles images by default
erikj
parents:
36532
diff
changeset
|
327 |
profiles = concatObjects(profiles, openOnlyProfiles); |
34491 | 328 |
// Generate debug profiles for the open jprt profiles |
36534
b74ff34537ac
8151800: Jib profile for open linux should produce compact profiles images by default
erikj
parents:
36532
diff
changeset
|
329 |
profiles = concatObjects(profiles, generateDebugProfiles(common, openOnlyProfiles)); |
34491 | 330 |
|
331 |
// Profiles used to run tests. Used in JPRT. |
|
332 |
var testOnlyProfiles = { |
|
333 |
||
334 |
"run-test": { |
|
335 |
target_os: input.build_os, |
|
336 |
target_cpu: input.build_cpu, |
|
337 |
dependencies: [ "jtreg", "gnumake" ], |
|
338 |
labels: "test" |
|
339 |
} |
|
340 |
}; |
|
341 |
profiles = concatObjects(profiles, testOnlyProfiles); |
|
342 |
||
343 |
// Generate the missing platform attributes |
|
344 |
profiles = generatePlatformAttributes(profiles); |
|
37649
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
345 |
profiles = generateDefaultMakeTargetsConfigureArg(common, profiles); |
34491 | 346 |
return profiles; |
347 |
}; |
|
348 |
||
349 |
/** |
|
350 |
* Generate the dependencies part of the configuration |
|
351 |
* |
|
352 |
* @param input External data to use for generating the configuration |
|
353 |
* @param common The common values |
|
354 |
* @returns {{}} Dependencies part of configuration |
|
355 |
*/ |
|
34496 | 356 |
var getJibProfilesDependencies = function (input, common) { |
34491 | 357 |
|
358 |
var boot_jdk_platform = input.build_os + "-" |
|
359 |
+ (input.build_cpu == "x86" ? "i586" : input.build_cpu); |
|
360 |
||
361 |
var devkit_platform_revisions = { |
|
362 |
linux_x64: "gcc4.9.2-OEL6.4+1.0", |
|
363 |
macosx_x64: "Xcode6.3-MacOSX10.9+1.0", |
|
34595
09596fe63e2d
8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
34496
diff
changeset
|
364 |
solaris_x64: "SS12u4-Solaris11u1+1.0", |
09596fe63e2d
8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
34496
diff
changeset
|
365 |
solaris_sparcv9: "SS12u4-Solaris11u1+1.0", |
34491 | 366 |
windows_x64: "VS2013SP4+1.0" |
367 |
}; |
|
368 |
||
369 |
var devkit_platform = (input.target_cpu == "x86" |
|
370 |
? input.target_os + "_x64" |
|
371 |
: input.target_platform); |
|
372 |
||
373 |
var dependencies = { |
|
374 |
||
375 |
boot_jdk: { |
|
376 |
server: "javare", |
|
377 |
module: "jdk", |
|
378 |
revision: "8", |
|
379 |
checksum_file: boot_jdk_platform + "/MD5_VALUES", |
|
380 |
file: boot_jdk_platform + "/jdk-8-" + boot_jdk_platform + ".tar.gz", |
|
381 |
configure_args: (input.build_os == "macosx" |
|
382 |
? "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk1.8.0.jdk/Contents/Home" |
|
383 |
: "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk1.8.0") |
|
384 |
}, |
|
385 |
||
386 |
devkit: { |
|
387 |
organization: common.organization, |
|
388 |
ext: "tar.gz", |
|
389 |
module: "devkit-" + devkit_platform, |
|
390 |
revision: devkit_platform_revisions[devkit_platform] |
|
391 |
}, |
|
392 |
||
393 |
build_devkit: { |
|
394 |
organization: common.organization, |
|
395 |
ext: "tar.gz", |
|
396 |
module: "devkit-" + input.build_platform, |
|
397 |
revision: devkit_platform_revisions[input.build_platform] |
|
398 |
}, |
|
399 |
||
400 |
cups: { |
|
401 |
organization: common.organization, |
|
402 |
ext: "tar.gz", |
|
403 |
revision: "1.0118+1.0" |
|
404 |
}, |
|
405 |
||
406 |
jtreg: { |
|
407 |
server: "javare", |
|
36506 | 408 |
revision: "4.2", |
37764
63e0379dd186
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37407
diff
changeset
|
409 |
build_number: "b02", |
34491 | 410 |
checksum_file: "MD5_VALUES", |
36506 | 411 |
file: "jtreg_bin-4.2.zip", |
34491 | 412 |
environment_name: "JT_HOME" |
413 |
}, |
|
414 |
||
415 |
gnumake: { |
|
416 |
organization: common.organization, |
|
417 |
ext: "tar.gz", |
|
418 |
revision: "4.0+1.0", |
|
419 |
||
420 |
module: (input.build_os == "windows" |
|
421 |
? "gnumake-" + input.build_osenv_platform |
|
422 |
: "gnumake-" + input.build_platform), |
|
423 |
||
424 |
configure_args: (input.build_os == "windows" |
|
425 |
? "MAKE=" + input.get("gnumake", "install_path") + "/cygwin/bin/make" |
|
426 |
: "MAKE=" + input.get("gnumake", "install_path") + "/bin/make"), |
|
427 |
||
428 |
environment_path: (input.build_os == "windows" |
|
429 |
? input.get("gnumake", "install_path") + "/cygwin/bin" |
|
430 |
: input.get("gnumake", "install_path") + "/bin") |
|
431 |
}, |
|
432 |
||
433 |
freetype: { |
|
434 |
organization: common.organization, |
|
435 |
ext: "tar.gz", |
|
436 |
revision: "2.3.4+1.0", |
|
437 |
module: "freetype-" + input.target_platform |
|
438 |
} |
|
439 |
}; |
|
440 |
||
441 |
return dependencies; |
|
442 |
}; |
|
443 |
||
444 |
/** |
|
445 |
* Generate the missing platform attributes for profiles |
|
446 |
* |
|
447 |
* @param profiles Profiles map to generate attributes on |
|
448 |
* @returns {{}} New profiles map with platform attributes fully filled in |
|
449 |
*/ |
|
450 |
var generatePlatformAttributes = function (profiles) { |
|
451 |
var ret = concatObjects(profiles, {}); |
|
452 |
for (var profile in profiles) { |
|
453 |
if (ret[profile].build_os == null) { |
|
454 |
ret[profile].build_os = ret[profile].target_os; |
|
455 |
} |
|
456 |
if (ret[profile].build_cpu == null) { |
|
457 |
ret[profile].build_cpu = ret[profile].target_cpu; |
|
458 |
} |
|
459 |
ret[profile].target_platform = ret[profile].target_os + "_" + ret[profile].target_cpu; |
|
460 |
ret[profile].build_platform = ret[profile].build_os + "_" + ret[profile].build_cpu; |
|
461 |
} |
|
462 |
return ret; |
|
463 |
}; |
|
464 |
||
465 |
/** |
|
466 |
* Generates debug versions of profiles. Clones the given profiles and adds |
|
467 |
* debug metadata. |
|
468 |
* |
|
469 |
* @param common Common values |
|
470 |
* @param profiles Profiles map to generate debug profiles for |
|
471 |
* @returns {{}} New map of profiles containing debug profiles |
|
472 |
*/ |
|
473 |
var generateDebugProfiles = function (common, profiles) { |
|
474 |
var newProfiles = {}; |
|
475 |
for (var profile in profiles) { |
|
476 |
var debugProfile = profile + "-debug"; |
|
477 |
newProfiles[debugProfile] = clone(profiles[profile]); |
|
478 |
newProfiles[debugProfile].debug_level = "fastdebug"; |
|
37649
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
479 |
newProfiles[debugProfile].default_make_targets |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
480 |
= common.default_make_targets_debug; |
34491 | 481 |
newProfiles[debugProfile].labels |
482 |
= concat(newProfiles[debugProfile].labels || [], "debug"), |
|
483 |
newProfiles[debugProfile].configure_args |
|
484 |
= concat(newProfiles[debugProfile].configure_args, |
|
485 |
common.configure_args_debug); |
|
486 |
} |
|
487 |
return newProfiles; |
|
488 |
}; |
|
489 |
||
490 |
/** |
|
36532 | 491 |
* Generates slowdebug versions of profiles. Clones the given profiles and adds |
492 |
* debug metadata. |
|
493 |
* |
|
494 |
* @param common Common values |
|
495 |
* @param profiles Profiles map to generate debug profiles for |
|
496 |
* @returns {{}} New map of profiles containing debug profiles |
|
497 |
*/ |
|
498 |
var generateSlowdebugProfiles = function (common, profiles) { |
|
499 |
var newProfiles = {}; |
|
500 |
for (var profile in profiles) { |
|
501 |
var debugProfile = profile + "-slowdebug"; |
|
502 |
newProfiles[debugProfile] = clone(profiles[profile]); |
|
503 |
newProfiles[debugProfile].debug_level = "slowdebug"; |
|
37649
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
504 |
newProfiles[debugProfile].default_make_targets |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
505 |
= common.default_make_targets_slowdebug; |
36532 | 506 |
newProfiles[debugProfile].labels |
507 |
= concat(newProfiles[debugProfile].labels || [], "slowdebug"), |
|
508 |
newProfiles[debugProfile].configure_args |
|
509 |
= concat(newProfiles[debugProfile].configure_args, |
|
510 |
common.configure_args_slowdebug); |
|
511 |
} |
|
512 |
return newProfiles; |
|
513 |
}; |
|
514 |
||
515 |
/** |
|
516 |
* Generates open only versions of profiles. Clones the given profiles and adds |
|
517 |
* open metadata. |
|
518 |
* |
|
519 |
* @param common Common values |
|
520 |
* @param profiles Profiles map to generate open only profiles for |
|
521 |
* @returns {{}} New map of profiles containing open only profiles |
|
522 |
*/ |
|
523 |
var generateOpenOnlyProfiles = function (common, profiles) { |
|
524 |
var newProfiles = {}; |
|
525 |
for (var profile in profiles) { |
|
526 |
var openProfile = profile + "-open"; |
|
527 |
newProfiles[openProfile] = clone(profiles[profile]); |
|
528 |
newProfiles[openProfile].labels |
|
529 |
= concat(newProfiles[openProfile].labels || [], "open"), |
|
530 |
newProfiles[openProfile].configure_args |
|
531 |
= concat(newProfiles[openProfile].configure_args, |
|
532 |
"--enable-openjdk-only"); |
|
533 |
} |
|
534 |
return newProfiles; |
|
535 |
}; |
|
536 |
||
537 |
/** |
|
37649
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
538 |
* The default_make_targets attribute on a profile is not a real Jib attribute. |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
539 |
* This function rewrites that attribute into the corresponding configure arg. |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
540 |
* Calling this function multiple times on the same profiles object is safe. |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
541 |
* |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
542 |
* @param common Common values |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
543 |
* @param profiles Profiles map to rewrite profiles for |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
544 |
* @returns {{}} New map of profiles with the make targets converted |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
545 |
*/ |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
546 |
var generateDefaultMakeTargetsConfigureArg = function (common, profiles) { |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
547 |
var ret = concatObjects(profiles, {}); |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
548 |
for (var profile in ret) { |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
549 |
if (ret[profile]["default_make_targets"] != null) { |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
550 |
var targetsString = concat(ret[profile].default_make_targets).join(" "); |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
551 |
// Iterate over all configure args and see if --with-default-make-target |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
552 |
// is already there and change it, otherwise add it. |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
553 |
var found = false; |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
554 |
for (var arg in ret[profile].configure_args) { |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
555 |
if (arg.startsWith("--with-default-make-target")) { |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
556 |
found = true; |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
557 |
arg.replace(/=.*/, "=" + targetsString); |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
558 |
} |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
559 |
} |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
560 |
if (!found) { |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
561 |
ret[profile].configure_args = concat( |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
562 |
ret[profile].configure_args, |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
563 |
"--with-default-make-target=" + targetsString); |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
564 |
} |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
565 |
} |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
566 |
} |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
567 |
return ret; |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
568 |
} |
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
569 |
|
3809534d4531
8154841: Let different Jib profiles have different default make targets
erikj
parents:
37407
diff
changeset
|
570 |
/** |
34491 | 571 |
* Deep clones an object tree. |
572 |
* |
|
573 |
* @param o Object to clone |
|
574 |
* @returns {{}} Clone of o |
|
575 |
*/ |
|
576 |
var clone = function (o) { |
|
577 |
return JSON.parse(JSON.stringify(o)); |
|
578 |
}; |
|
579 |
||
580 |
/** |
|
581 |
* Concatenates all arguments into a new array |
|
582 |
* |
|
583 |
* @returns {Array.<T>} New array containing all arguments |
|
584 |
*/ |
|
585 |
var concat = function () { |
|
586 |
return Array.prototype.concat.apply([], arguments); |
|
587 |
}; |
|
588 |
||
589 |
/** |
|
590 |
* Copies all elements in an array into a new array but replacing all |
|
591 |
* occurrences of original with replacement. |
|
592 |
* |
|
593 |
* @param original Element to look for |
|
594 |
* @param replacement Element to replace with |
|
595 |
* @param a Array to copy |
|
596 |
* @returns {Array} New array with all occurrences of original replaced |
|
597 |
* with replacement |
|
598 |
*/ |
|
599 |
var replace = function (original, replacement, a) { |
|
600 |
var newA = []; |
|
601 |
for (var i in a) { |
|
602 |
if (original == a[i]) { |
|
603 |
newA.push(replacement); |
|
604 |
} else { |
|
605 |
newA.push(a[i]); |
|
606 |
} |
|
607 |
} |
|
608 |
return newA; |
|
609 |
}; |
|
610 |
||
611 |
/** |
|
612 |
* Deep concatenation of two objects. For each node encountered, merge |
|
613 |
* the contents with the corresponding node in the other object tree, |
|
614 |
* treating all strings as array elements. |
|
615 |
* |
|
616 |
* @param o1 Object to concatenate |
|
617 |
* @param o2 Object to concatenate |
|
618 |
* @returns {{}} New object tree containing the concatenation of o1 and o2 |
|
619 |
*/ |
|
620 |
var concatObjects = function (o1, o2) { |
|
621 |
var ret = {}; |
|
622 |
for (var a in o1) { |
|
623 |
if (o2[a] == null) { |
|
624 |
ret[a] = o1[a]; |
|
625 |
} |
|
626 |
} |
|
627 |
for (var a in o2) { |
|
628 |
if (o1[a] == null) { |
|
629 |
ret[a] = o2[a]; |
|
630 |
} else { |
|
631 |
if (typeof o1[a] == 'string') { |
|
632 |
ret[a] = [o1[a]].concat(o2[a]); |
|
633 |
} else if (Array.isArray(o1[a])) { |
|
634 |
ret[a] = o1[a].concat(o2[a]); |
|
635 |
} else if (typeof o1[a] == 'object') { |
|
636 |
ret[a] = concatObjects(o1[a], o2[a]); |
|
637 |
} |
|
638 |
} |
|
639 |
} |
|
640 |
return ret; |
|
641 |
}; |