make/conf/jib-profiles.js
author alanb
Mon, 11 Feb 2019 19:16:13 +0000
branchniosocketimpl-branch
changeset 57177 0b5ebb227a8d
parent 53692 314075ea3fcb
child 53711 8041cefba76b
permissions -rw-r--r--
-Djdk.net.usePlainSocketImpl without value should use PlainSocketImpl
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
     1
/*
53423
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
     2
 * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
     4
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    10
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    15
 * accompanied this code).
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    16
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    20
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    23
 * questions.
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    24
 */
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    25
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    26
/*
34496
b05757ebc035 8145185: Rename JAB the build tool to JIB
erikj
parents: 34491
diff changeset
    27
 * This file defines build profiles for the JIB tool and others.
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    28
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    29
 * A build profile defines a set of configuration options and external
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    30
 * dependencies that we for some reason or other care about specifically.
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    31
 * Typically, build profiles are defined for the build configurations we
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    32
 * build regularly.
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    33
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    34
 * Contract against this file from the tools that use it, is to provide
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    35
 * a function on the form:
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    36
 *
34496
b05757ebc035 8145185: Rename JAB the build tool to JIB
erikj
parents: 34491
diff changeset
    37
 * getJibProfiles(input)
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    38
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    39
 * which returns an object graph describing the profiles and their
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    40
 * dependencies. The name of the function is based on the name of this
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    41
 * file, minus the extension and the '-', camel cased and prefixed with
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    42
 * 'get'.
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    43
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    44
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    45
 * The parameter 'input' is an object that optionally contains  some data.
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    46
 * Optionally because a tool may read the configuration for different purposes.
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    47
 * To initially get a list of available profiles, the active profile may not
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    48
 * yet be known for instance.
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    49
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    50
 * Data that may be set on the input object:
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    51
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    52
 * input.profile = <name of active profile>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    53
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    54
 * If the active profile is set, the following data from it must also
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    55
 * be provided:
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    56
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    57
 * input.profile
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
    58
 * input.build_id
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    59
 * input.target_os
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    60
 * input.target_cpu
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    61
 * input.build_os
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    62
 * input.build_cpu
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    63
 * input.target_platform
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    64
 * input.build_platform
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    65
 * // The build_osenv_* variables describe the unix layer on Windows systems,
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    66
 * // i.e. Cygwin, which may also be 32 or 64 bit.
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    67
 * input.build_osenv
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    68
 * input.build_osenv_cpu
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    69
 * input.build_osenv_platform
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    70
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    71
 * For more complex nested attributes, there is a method "get":
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    72
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    73
 * input.get("<dependency>", "<attribute>")
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    74
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    75
 * Valid attributes are:
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    76
 * install_path
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    77
 * download_path
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    78
 * download_dir
53642
2336cd378e7f 8218177: Bump jib format_version to support new devkit archive layout
erikj
parents: 53607
diff changeset
    79
 * home_path
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    80
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    81
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    82
 * The output data generated by this configuration file has the following
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    83
 * format:
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    84
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    85
 * data: {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    86
 *   // Identifies the version of this format to the tool reading it
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    87
 *   format_version: "1.0",
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    88
 *
34496
b05757ebc035 8145185: Rename JAB the build tool to JIB
erikj
parents: 34491
diff changeset
    89
 *   // Name of base outputdir. JIB assumes the actual output dir is formed
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    90
 *   // by adding the configuration name: <output_basedir>/<config-name>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    91
 *   output_basedir: "build",
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    92
 *   // Configure argument to use to specify configuration name
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    93
 *   configuration_configure_arg:
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    94
 *   // Make argument to use to specify configuration name
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    95
 *   configuration_make_arg:
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    96
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    97
 *   profiles: {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    98
 *     <profile-name>: {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
    99
 *       // Name of os the profile is built to run on
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   100
 *       target_os; <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   101
 *       // Name of cpu the profile is built to run on
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   102
 *       target_cpu; <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   103
 *       // Combination of target_os and target_cpu for convenience
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   104
 *       target_platform; <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   105
 *       // Name of os the profile is built on
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   106
 *       build_os; <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   107
 *       // Name of cpu the profile is built on
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   108
 *       build_cpu; <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   109
 *       // Combination of build_os and build_cpu for convenience
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   110
 *       build_platform; <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   111
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   112
 *       // List of dependencies needed to build this profile
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   113
 *       dependencies: <Array of strings>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   114
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   115
 *       // List of configure args to use for this profile
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   116
 *       configure_args: <Array of strings>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   117
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   118
 *       // List of free form labels describing aspects of this profile
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   119
 *       labels: <Array of strings>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   120
 *     }
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   121
 *   }
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   122
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   123
 *   // Dependencies use a Maven like deployment structure
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   124
 *   dependencies: {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   125
 *     <dependency-name>: {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   126
 *       // Organization part of path defining this dependency
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   127
 *       organization: <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   128
 *       // File extension for this dependency
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   129
 *       ext: <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   130
 *       // Module part of path for defining this dependency,
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   131
 *       // defaults to <dependency-name>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   132
 *       module: <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   133
 *       // Revision part of path for defining this dependency
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   134
 *       revision: <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   135
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   136
 *       // List of configure args to add when using this dependency,
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   137
 *       // defaults to
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   138
 *       // "--with-<dependency-name>=input.get("<dependency-name", "install_path")"
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   139
 *       configure_args: <array of strings>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   140
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   141
 *       // Name of environment variable to set when using this dependency
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   142
 *       // when running make
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   143
 *       environment_name: <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   144
 *       // Value of environment variable to set when using this dependency
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   145
 *       // when running make
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   146
 *       environment_value: <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   147
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   148
 *       // Value to add to the PATH variable when using this dependency,
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   149
 *       // applies to both make and configure
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   150
 *       environment_path: <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   151
 *     }
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   152
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   153
 *     <dependency-name>: {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   154
 *       // For certain dependencies where a legacy distribution mechanism is
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   155
 *       // already in place, the "javare" server layout is also supported
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   156
 *       // Indicate that an alternate server source and layout should be used
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   157
 *       server: "javare"
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   158
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   159
 *       // For "javare", a combination of module, revision,
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   160
 *       // build number (optional), files and checksum file is possible for
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   161
 *       // artifacts following the standard layout.
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   162
 *       module: <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   163
 *       revision: <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   164
 *       build_number: <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   165
 *       checksum_file: <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   166
 *       file: <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   167
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   168
 *       // For other files, use checksum path and path instead
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   169
 *       checksum_path: <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   170
 *       path: <string>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   171
 *     }
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   172
 *   }
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   173
 * }
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   174
 */
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   175
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   176
/**
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   177
 * Main entry to generate the profile configuration
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   178
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   179
 * @param input External data to use for generating the configuration
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   180
 * @returns {{}} Profile configuration
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   181
 */
34496
b05757ebc035 8145185: Rename JAB the build tool to JIB
erikj
parents: 34491
diff changeset
   182
var getJibProfiles = function (input) {
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   183
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   184
    var data = {};
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   185
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   186
    // Identifies the version of this format to the tool reading it.
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   187
    // 1.1 signifies that the publish, publish-src and get-src features are usable.
50239
a28085b5830e 8203497: Bump Jib format version to 1.2
erikj
parents: 49976
diff changeset
   188
    // 1.2 signifies that artifact uploads should fail on missing artifacts by default.
53642
2336cd378e7f 8218177: Bump jib format_version to support new devkit archive layout
erikj
parents: 53607
diff changeset
   189
    // 1.3 input.get(<dep>, "home_path") automatically goes down into a single top
2336cd378e7f 8218177: Bump jib format_version to support new devkit archive layout
erikj
parents: 53607
diff changeset
   190
    //     dir just like default configure_args and environment_path variables.
2336cd378e7f 8218177: Bump jib format_version to support new devkit archive layout
erikj
parents: 53607
diff changeset
   191
    data.format_version = "1.3";
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   192
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   193
    // Organization, product and version are used when uploading/publishing build results
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   194
    data.organization = "";
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   195
    data.product = "jdk";
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   196
    data.version = getVersion();
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   197
34496
b05757ebc035 8145185: Rename JAB the build tool to JIB
erikj
parents: 34491
diff changeset
   198
    // The base directory for the build output. JIB will assume that the
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   199
    // actual build directory will be <output_basedir>/<configuration>
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   200
    data.output_basedir = "build";
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   201
    // The configure argument to use to specify the name of the configuration
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   202
    data.configuration_configure_arg = "--with-conf-name=";
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   203
    // The make argument to use to specify the name of the configuration
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   204
    data.configuration_make_arg = "CONF_NAME=";
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   205
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   206
    // Exclude list to use when Jib creates a source bundle
52415
bc4246eb76c4 8213227: Update jib src excludes to filter webrev and Jreg directories
erikj
parents: 52393
diff changeset
   207
    data.src_bundle_excludes = [
bc4246eb76c4 8213227: Update jib src excludes to filter webrev and Jreg directories
erikj
parents: 52393
diff changeset
   208
        "build", "{,**/}webrev*", "{,**/}.hg", "{,**/}JTwork", "{,**/}JTreport",
bc4246eb76c4 8213227: Update jib src excludes to filter webrev and Jreg directories
erikj
parents: 52393
diff changeset
   209
        "{,**/}.git"
bc4246eb76c4 8213227: Update jib src excludes to filter webrev and Jreg directories
erikj
parents: 52393
diff changeset
   210
    ];
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   211
    // Include list to use when creating a minimal jib source bundle which
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   212
    // contains just the jib configuration files.
52415
bc4246eb76c4 8213227: Update jib src excludes to filter webrev and Jreg directories
erikj
parents: 52393
diff changeset
   213
    data.conf_bundle_includes = [
bc4246eb76c4 8213227: Update jib src excludes to filter webrev and Jreg directories
erikj
parents: 52393
diff changeset
   214
        "make/autoconf/version-numbers",
bc4246eb76c4 8213227: Update jib src excludes to filter webrev and Jreg directories
erikj
parents: 52393
diff changeset
   215
    ];
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   216
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   217
    // Define some common values
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   218
    var common = getJibProfilesCommon(input, data);
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   219
    // Generate the profiles part of the configuration
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   220
    data.profiles = getJibProfilesProfiles(input, common, data);
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   221
    // Generate the dependencies part of the configuration
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   222
    data.dependencies = getJibProfilesDependencies(input, common, data);
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   223
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   224
    return data;
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   225
};
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   226
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   227
/**
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   228
 * Generates some common values
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   229
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   230
 * @param input External data to use for generating the configuration
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   231
 * @returns Common values
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   232
 */
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   233
var getJibProfilesCommon = function (input, data) {
37649
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
   234
    var common = {};
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
   235
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   236
    common.organization = "jpg.infra.builddeps";
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   237
    common.build_id = getBuildId(input);
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   238
    common.build_number = input.build_number != null ? input.build_number : "0";
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   239
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   240
    // List of the main profile names used for iteration
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   241
    common.main_profile_names = [
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   242
        "linux-x64", "linux-x86", "macosx-x64", "solaris-x64",
44625
cf100f579077 8177822: Move closed jib configuration for arm platforms to open
erikj
parents: 44513
diff changeset
   243
        "solaris-sparcv9", "windows-x64", "windows-x86",
53579
b5f05fe4a6f8 8218084: Revert JDK-8218057
erikj
parents: 53569
diff changeset
   244
        "linux-aarch64", "linux-arm32"
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   245
    ];
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   246
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   247
    // These are the base setttings for all the main build profiles.
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   248
    common.main_profile_base = {
52774
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52714
diff changeset
   249
        dependencies: ["boot_jdk", "gnumake", "jtreg", "jib", "autoconf", "jmh", "jcov"],
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   250
        default_make_targets: ["product-bundles", "test-bundles"],
45048
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
   251
        configure_args: concat(["--enable-jtreg-failure-handler"],
51207
fc24da4898f1 8207243: Fix translation filtering to also support zh_HK and zh_TW
erikj
parents: 51013
diff changeset
   252
            "--with-exclude-translations=de,es,fr,it,ko,pt_BR,sv,ca,tr,cs,sk,ja_JP_A,ja_JP_HA,ja_JP_HI,ja_JP_I,zh_TW,zh_HK",
51215
936823fcf202 8207365: Make man pages optional
erikj
parents: 51207
diff changeset
   253
            "--disable-manpages",
52930
df629b081ff6 8215030: Disable shenandoah in Oracle builds
erikj
parents: 52917
diff changeset
   254
            "--with-jvm-features=-shenandoahgc",
50590
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 50543
diff changeset
   255
            versionArgs(input, common))
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   256
    };
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   257
    // Extra settings for debug profiles
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   258
    common.debug_suffix = "-debug";
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   259
    common.debug_profile_base = {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   260
        configure_args: ["--enable-debug"],
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   261
        labels: "debug"
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   262
    };
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   263
    // Extra settings for slowdebug profiles
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   264
    common.slowdebug_suffix = "-slowdebug";
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   265
    common.slowdebug_profile_base = {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   266
        configure_args: ["--with-debug-level=slowdebug"],
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   267
        labels: "slowdebug"
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   268
    };
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   269
    // Extra settings for openjdk only profiles
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   270
    common.open_suffix = "-open";
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   271
    common.open_profile_base = {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   272
        configure_args: ["--enable-openjdk-only"],
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   273
        labels: "open"
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   274
    };
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   275
42980
4ab3d4b67cc0 8171500: Explicitly set --with-target-bits=64 in 64bit jib profiles
erikj
parents: 42848
diff changeset
   276
    common.configure_args_64bit = ["--with-target-bits=64"];
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   277
    common.configure_args_32bit = ["--with-target-bits=32"];
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   278
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   279
    /**
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   280
     * Define common artifacts template for all main profiles
45048
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
   281
     * @param o - Object containing data for artifacts
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   282
     */
45048
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
   283
    common.main_profile_artifacts = function (o) {
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
   284
        var jdk_subdir = (o.jdk_subdir != null ? o.jdk_subdir : "jdk-" + data.version);
50511
075e9982b409 8204127: Change bundle format on Windows to zip
erikj
parents: 50494
diff changeset
   285
        var jdk_suffix = (o.jdk_suffix != null ? o.jdk_suffix : "tar.gz");
45048
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
   286
        var pf = o.platform
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   287
        return {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   288
            artifacts: {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   289
                jdk: {
50511
075e9982b409 8204127: Change bundle format on Windows to zip
erikj
parents: 50494
diff changeset
   290
                    local: "bundles/\\(jdk.*bin." + jdk_suffix + "\\)",
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   291
                    remote: [
50511
075e9982b409 8204127: Change bundle format on Windows to zip
erikj
parents: 50494
diff changeset
   292
                        "bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin." + jdk_suffix,
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   293
                        "bundles/" + pf + "/\\1"
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   294
                    ],
45048
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
   295
                    subdir: jdk_subdir,
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   296
                    exploded: "images/jdk"
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   297
                },
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   298
                test: {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   299
                    local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   300
                    remote: [
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   301
                        "bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-tests.tar.gz",
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   302
                        "bundles/" + pf + "/\\1"
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   303
                    ],
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   304
                    exploded: "images/test"
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   305
                },
47440
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47433
diff changeset
   306
                test_demos: {
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47433
diff changeset
   307
                    local: "bundles/\\(jdk.*bin-tests-demos.tar.gz\\)",
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47433
diff changeset
   308
                    remote: [
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47433
diff changeset
   309
                        "bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-tests-demos.tar.gz",
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47433
diff changeset
   310
                        "bundles/" + pf + "/\\1"
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47433
diff changeset
   311
                    ],
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47433
diff changeset
   312
                    exploded: "images/test"
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47433
diff changeset
   313
                },
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   314
                jdk_symbols: {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   315
                    local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   316
                    remote: [
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   317
                        "bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-symbols.tar.gz",
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   318
                        "bundles/" + pf + "/\\1"
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   319
                    ],
45048
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
   320
                    subdir: jdk_subdir,
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   321
                    exploded: "images/jdk"
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   322
                },
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   323
            }
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   324
        };
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   325
    };
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   326
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   327
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   328
    /**
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   329
     * Define common artifacts template for all debug profiles
45048
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
   330
     * @param o - Object containing data for artifacts
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   331
     */
45048
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
   332
    common.debug_profile_artifacts = function (o) {
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
   333
        var jdk_subdir = "jdk-" + data.version + "/fastdebug";
50511
075e9982b409 8204127: Change bundle format on Windows to zip
erikj
parents: 50494
diff changeset
   334
        var jdk_suffix = (o.jdk_suffix != null ? o.jdk_suffix : "tar.gz");
45048
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
   335
        var pf = o.platform
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   336
        return {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   337
            artifacts: {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   338
                jdk: {
50511
075e9982b409 8204127: Change bundle format on Windows to zip
erikj
parents: 50494
diff changeset
   339
                    local: "bundles/\\(jdk.*bin-debug." + jdk_suffix + "\\)",
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   340
                    remote: [
50511
075e9982b409 8204127: Change bundle format on Windows to zip
erikj
parents: 50494
diff changeset
   341
                        "bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-debug." + jdk_suffix,
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   342
                        "bundles/" + pf + "/\\1"
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   343
                    ],
45048
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
   344
                    subdir: jdk_subdir,
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   345
                    exploded: "images/jdk"
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   346
                },
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   347
                test: {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   348
                    local: "bundles/\\(jdk.*bin-tests-debug.tar.gz\\)",
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   349
                    remote: [
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   350
                        "bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-tests-debug.tar.gz",
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   351
                        "bundles/" + pf + "/\\1"
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   352
                    ],
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   353
                    exploded: "images/test"
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   354
                },
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   355
                jdk_symbols: {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   356
                    local: "bundles/\\(jdk.*bin-debug-symbols.tar.gz\\)",
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   357
                    remote: [
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   358
                        "bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-debug-symbols.tar.gz",
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   359
                        "bundles/" + pf + "/\\1"
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   360
                    ],
45048
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
   361
                    subdir: jdk_subdir,
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   362
                    exploded: "images/jdk"
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   363
                },
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   364
            }
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   365
        };
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   366
    };
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   367
52509
b091b768fea4 8213569: Bump minimum boot jdk to JDK 11
mikael
parents: 52443
diff changeset
   368
    common.boot_jdk_version = "11";
53642
2336cd378e7f 8218177: Bump jib format_version to support new devkit archive layout
erikj
parents: 53607
diff changeset
   369
    common.boot_jdk_home = input.get("boot_jdk", "install_path") + "/jdk-"
47365
92f08900cb3c 8189679: JDK-8189094 broke testing in Mach 5
erikj
parents: 47364
diff changeset
   370
        + common.boot_jdk_version
41047
de6f69208f82 8164301: jib should provide a JDK for running jtreg with
erikj
parents: 40241
diff changeset
   371
        + (input.build_os == "macosx" ? ".jdk/Contents/Home" : "");
de6f69208f82 8164301: jib should provide a JDK for running jtreg with
erikj
parents: 40241
diff changeset
   372
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   373
    return common;
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   374
};
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   375
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   376
/**
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   377
 * Generates the profiles part of the configuration.
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   378
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   379
 * @param input External data to use for generating the configuration
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   380
 * @param common The common values
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   381
 * @returns {{}} Profiles part of the configuration
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   382
 */
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   383
var getJibProfilesProfiles = function (input, common, data) {
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   384
    // Main SE profiles
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   385
    var profiles = {
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   386
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   387
        "linux-x64": {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   388
            target_os: "linux",
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   389
            target_cpu: "x64",
51013
6e760728afaa 8206433: Several jib profiles missing autoconf dependency
erikj
parents: 50908
diff changeset
   390
            dependencies: ["devkit", "graphviz", "pandoc", "graalunit_lib"],
44727
ca162fc20601 8178965: Second part of JDK-8176785
ihse
parents: 44626
diff changeset
   391
            configure_args: concat(common.configure_args_64bit,
53240
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
   392
                "--enable-full-docs", "--with-zlib=system",
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
   393
                (isWsl(input) ? [ "--host=x86_64-unknown-linux-gnu",
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
   394
                    "--build=x86_64-unknown-linux-gnu" ] : [])),
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   395
            default_make_targets: ["docs-bundles"],
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   396
        },
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   397
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   398
        "linux-x86": {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   399
            target_os: "linux",
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   400
            target_cpu: "x86",
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   401
            build_cpu: "x64",
51013
6e760728afaa 8206433: Several jib profiles missing autoconf dependency
erikj
parents: 50908
diff changeset
   402
            dependencies: ["devkit"],
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   403
            configure_args: concat(common.configure_args_32bit,
39190
a6b5b18fd06c 8154209: Remove client VM from default JIB profile on windows-x86 and linux-x86
lmesnik
parents: 37972
diff changeset
   404
                "--with-jvm-variants=minimal,server", "--with-zlib=system"),
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   405
        },
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   406
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   407
        "macosx-x64": {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   408
            target_os: "macosx",
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   409
            target_cpu: "x64",
52714
2e52aa822c57 8178317: Create man pages using pandoc from markdown sources
ihse
parents: 52595
diff changeset
   410
            dependencies: ["devkit", "pandoc", "graalunit_lib"],
45875
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 45824
diff changeset
   411
            configure_args: concat(common.configure_args_64bit, "--with-zlib=system",
49523
69c6eb97297f 8196724: Change macosx deployment target to 10.9
erikj
parents: 49516
diff changeset
   412
                "--with-macosx-version-max=10.9.0"),
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   413
        },
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   414
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   415
        "solaris-x64": {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   416
            target_os: "solaris",
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   417
            target_cpu: "x64",
51013
6e760728afaa 8206433: Several jib profiles missing autoconf dependency
erikj
parents: 50908
diff changeset
   418
            dependencies: ["devkit", "cups"],
42980
4ab3d4b67cc0 8171500: Explicitly set --with-target-bits=64 in 64bit jib profiles
erikj
parents: 42848
diff changeset
   419
            configure_args: concat(common.configure_args_64bit,
4ab3d4b67cc0 8171500: Explicitly set --with-target-bits=64 in 64bit jib profiles
erikj
parents: 42848
diff changeset
   420
                "--with-zlib=system", "--enable-dtrace"),
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   421
        },
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   422
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   423
        "solaris-sparcv9": {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   424
            target_os: "solaris",
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   425
            target_cpu: "sparcv9",
51013
6e760728afaa 8206433: Several jib profiles missing autoconf dependency
erikj
parents: 50908
diff changeset
   426
            dependencies: ["devkit", "cups"],
42980
4ab3d4b67cc0 8171500: Explicitly set --with-target-bits=64 in 64bit jib profiles
erikj
parents: 42848
diff changeset
   427
            configure_args: concat(common.configure_args_64bit,
4ab3d4b67cc0 8171500: Explicitly set --with-target-bits=64 in 64bit jib profiles
erikj
parents: 42848
diff changeset
   428
                "--with-zlib=system", "--enable-dtrace"),
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   429
        },
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   430
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   431
        "windows-x64": {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   432
            target_os: "windows",
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   433
            target_cpu: "x64",
52917
0c637249d934 8214780: Create pandoc package for Windows
ihse
parents: 52798
diff changeset
   434
            dependencies: ["devkit", "pandoc", "graalunit_lib"],
42980
4ab3d4b67cc0 8171500: Explicitly set --with-target-bits=64 in 64bit jib profiles
erikj
parents: 42848
diff changeset
   435
            configure_args: concat(common.configure_args_64bit),
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   436
        },
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   437
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   438
        "windows-x86": {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   439
            target_os: "windows",
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   440
            target_cpu: "x86",
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   441
            build_cpu: "x64",
51013
6e760728afaa 8206433: Several jib profiles missing autoconf dependency
erikj
parents: 50908
diff changeset
   442
            dependencies: ["devkit"],
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   443
            configure_args: concat(common.configure_args_32bit),
44625
cf100f579077 8177822: Move closed jib configuration for arm platforms to open
erikj
parents: 44513
diff changeset
   444
        },
cf100f579077 8177822: Move closed jib configuration for arm platforms to open
erikj
parents: 44513
diff changeset
   445
49204
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 49147
diff changeset
   446
        "linux-aarch64": {
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 49147
diff changeset
   447
            target_os: "linux",
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 49147
diff changeset
   448
            target_cpu: "aarch64",
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 49147
diff changeset
   449
            build_cpu: "x64",
51013
6e760728afaa 8206433: Several jib profiles missing autoconf dependency
erikj
parents: 50908
diff changeset
   450
            dependencies: ["devkit", "build_devkit", "cups"],
49204
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 49147
diff changeset
   451
            configure_args: [
49525
4d98473ed33e 8200727: linux-aarch64 profile should use bundled freetype
ihse
parents: 49523
diff changeset
   452
                "--openjdk-target=aarch64-linux-gnu", "--with-freetype=bundled",
52351
0ecb4e520110 8209093: JEP 340: One AArch64 Port, Not Two
bobv
parents: 52275
diff changeset
   453
                "--disable-warnings-as-errors"
44625
cf100f579077 8177822: Move closed jib configuration for arm platforms to open
erikj
parents: 44513
diff changeset
   454
            ],
cf100f579077 8177822: Move closed jib configuration for arm platforms to open
erikj
parents: 44513
diff changeset
   455
        },
cf100f579077 8177822: Move closed jib configuration for arm platforms to open
erikj
parents: 44513
diff changeset
   456
50472
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 50273
diff changeset
   457
        "linux-arm32": {
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 50273
diff changeset
   458
            target_os: "linux",
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 50273
diff changeset
   459
            target_cpu: "arm",
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 50273
diff changeset
   460
            build_cpu: "x64",
51013
6e760728afaa 8206433: Several jib profiles missing autoconf dependency
erikj
parents: 50908
diff changeset
   461
            dependencies: ["devkit", "build_devkit", "cups"],
50472
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 50273
diff changeset
   462
            configure_args: [
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 50273
diff changeset
   463
                "--openjdk-target=arm-linux-gnueabihf", "--with-freetype=bundled",
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 50273
diff changeset
   464
                "--with-abi-profile=arm-vfp-hflt", "--disable-warnings-as-errors"
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 50273
diff changeset
   465
            ],
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 50273
diff changeset
   466
        },
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   467
    };
44625
cf100f579077 8177822: Move closed jib configuration for arm platforms to open
erikj
parents: 44513
diff changeset
   468
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   469
    // Add the base settings to all the main profiles
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   470
    common.main_profile_names.forEach(function (name) {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   471
        profiles[name] = concatObjects(common.main_profile_base, profiles[name]);
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   472
    });
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   473
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   474
    // Generate debug versions of all the main profiles
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   475
    common.main_profile_names.forEach(function (name) {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   476
        var debugName = name + common.debug_suffix;
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   477
        profiles[debugName] = concatObjects(profiles[name],
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   478
                                            common.debug_profile_base);
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   479
    });
36532
2f10ab82d0a8 8151726: Introduce a JPRT testset buildinfra
erikj
parents: 36170
diff changeset
   480
    // Generate slowdebug versions of all the main profiles
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   481
    common.main_profile_names.forEach(function (name) {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   482
        var debugName = name + common.slowdebug_suffix;
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   483
        profiles[debugName] = concatObjects(profiles[name],
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   484
                                            common.slowdebug_profile_base);
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   485
    });
49243
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
   486
    // Generate testmake profiles for the main profile of each build host
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
   487
    // platform. This profile only runs the makefile tests.
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
   488
    // Ant is needed to run the idea project generator test.
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
   489
    var testmakeBase = {
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
   490
        dependencies: [ "ant" ],
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
   491
        environment: {
53642
2336cd378e7f 8218177: Bump jib format_version to support new devkit archive layout
erikj
parents: 53607
diff changeset
   492
            "ANT_HOME": input.get("ant", "home_path")
49243
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
   493
        }
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
   494
    };
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
   495
    [ "linux-x64", "macosx-x64", "solaris-sparcv9", "solaris-x64", "windows-x64"]
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
   496
        .forEach(function (name) {
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
   497
            var maketestName = name + "-testmake";
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
   498
            profiles[maketestName] = concatObjects(profiles[name], testmakeBase);
52368
ecef74be8e25 8213237: Remove test-compile-commands from jib-profiles.js
ihse
parents: 52357
diff changeset
   499
            profiles[maketestName].default_make_targets = [ "test-make" ];
49243
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
   500
        });
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   501
51994
7577686cc9bd 8211350: Remove jprt support
mikael
parents: 51899
diff changeset
   502
    // Profiles for building the zero jvm variant. These are used for verification.
42425
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 42289
diff changeset
   503
    var zeroProfiles = {
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 42289
diff changeset
   504
        "linux-x64-zero": {
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 42289
diff changeset
   505
            target_os: "linux",
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 42289
diff changeset
   506
            target_cpu: "x64",
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   507
            dependencies: ["devkit"],
42980
4ab3d4b67cc0 8171500: Explicitly set --with-target-bits=64 in 64bit jib profiles
erikj
parents: 42848
diff changeset
   508
            configure_args: concat(common.configure_args_64bit, [
42425
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 42289
diff changeset
   509
                "--with-zlib=system",
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 42289
diff changeset
   510
                "--with-jvm-variants=zero",
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   511
                "--enable-libffi-bundling"
42980
4ab3d4b67cc0 8171500: Explicitly set --with-target-bits=64 in 64bit jib profiles
erikj
parents: 42848
diff changeset
   512
            ])
42425
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 42289
diff changeset
   513
        },
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 42289
diff changeset
   514
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 42289
diff changeset
   515
        "linux-x86-zero": {
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 42289
diff changeset
   516
            target_os: "linux",
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 42289
diff changeset
   517
            target_cpu: "x86",
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 42289
diff changeset
   518
            build_cpu: "x64",
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   519
            dependencies: ["devkit"],
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   520
            configure_args:  concat(common.configure_args_32bit, [
42425
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 42289
diff changeset
   521
                "--with-zlib=system",
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 42289
diff changeset
   522
                "--with-jvm-variants=zero",
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   523
                "--enable-libffi-bundling"
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   524
            ])
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   525
        }
42425
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 42289
diff changeset
   526
    }
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 42289
diff changeset
   527
    profiles = concatObjects(profiles, zeroProfiles);
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   528
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   529
    // Add the base settings to the zero profiles and generate debug profiles
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   530
    Object.keys(zeroProfiles).forEach(function (name) {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   531
        var debugName = name + common.debug_suffix;
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   532
        profiles[name] = concatObjects(common.main_profile_base, profiles[name]);
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   533
        profiles[debugName] = concatObjects(profiles[name], common.debug_profile_base);
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   534
    });
42425
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 42289
diff changeset
   535
52443
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   536
    // Define a profile with precompiled headers disabled. This is just used for
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   537
    // verfication of this build configuration.
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   538
    var noPchProfiles = {
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   539
        "linux-x64-debug-nopch": {
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   540
            target_os: "linux",
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   541
            target_cpu: "x64",
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   542
            dependencies: ["devkit"],
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   543
            configure_args: concat(common.configure_args_64bit,
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   544
                "--with-zlib=system", "--disable-precompiled-headers"),
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   545
        },
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   546
    };
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   547
    profiles = concatObjects(profiles, noPchProfiles);
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   548
    // Add base settings to noPch profiles
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   549
    Object.keys(noPchProfiles).forEach(function (name) {
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   550
        profiles[name] = concatObjects(common.main_profile_base, profiles[name]);
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   551
        profiles[name] = concatObjects(common.debug_profile_base, profiles[name]);
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   552
        // Override default make target with hotspot as that's the only part of
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   553
        // the build using precompiled headers.
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   554
        profiles[name].default_make_targets = ["hotspot"];
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   555
    });
bec2391579f8 8213428: Add a no precompiled header Linux build to builds-tier1 and jdk-submit
erikj
parents: 52415
diff changeset
   556
50543
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   557
    // Bootcycle profiles runs the build with itself as the boot jdk. This can
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   558
    // be done in two ways. Either using the builtin bootcycle target in the
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   559
    // build system. Or by supplying the main jdk build as bootjdk to configure.
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   560
    [ "linux-x64", "macosx-x64", "solaris-sparcv9", "windows-x64"]
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   561
        .forEach(function (name) {
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   562
            var bootcycleName = name + "-bootcycle";
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   563
            var bootcyclePrebuiltName = name + "-bootcycle-prebuilt";
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   564
            // The base bootcycle profile just changes the default target
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   565
            // compared to the base profile
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   566
            profiles[bootcycleName] = clone(profiles[name]);
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   567
            profiles[bootcycleName].default_make_targets = [ "bootcycle-images" ];
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   568
            // The prebuilt bootcycle variant modifies the boot jdk argument
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   569
            var bootcyclePrebuiltBase = {
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   570
                dependencies: [ name + ".jdk" ],
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   571
                configure_args: "--with-boot-jdk=" + input.get(name + ".jdk", "home_path"),
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   572
            }
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   573
            profiles[bootcyclePrebuiltName] = concatObjects(profiles[name],
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   574
                bootcyclePrebuiltBase);
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   575
            var bootJdkIndex = profiles[bootcyclePrebuiltName].dependencies.indexOf("boot_jdk");
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   576
            delete profiles[bootcyclePrebuiltName].dependencies[bootJdkIndex];
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   577
            profiles[bootcyclePrebuiltName].default_make_targets = [ "product-images" ];
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   578
        });
ad42438983ee 8204922: Create bootcycle jib profiles
erikj
parents: 50525
diff changeset
   579
53423
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   580
    // JCov profiles build JCov-instrumented JDK image based on images provided through dependencies.
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   581
    [ "linux-x64", "macosx-x64", "solaris-sparcv9", "windows-x64"]
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   582
        .forEach(function (name) {
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   583
            var jcovName = name + "-jcov";
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   584
            profiles[jcovName] = clone(common.main_profile_base);
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   585
            profiles[jcovName].target_os = profiles[name].target_os
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   586
            profiles[jcovName].target_cpu = profiles[name].target_cpu
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   587
            profiles[jcovName].default_make_targets = [ "jcov-bundles" ];
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   588
            profiles[jcovName].dependencies = concat(profiles[jcovName].dependencies,
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   589
                [ name + ".jdk", "devkit" ]);
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   590
            profiles[jcovName].configure_args = concat(profiles[jcovName].configure_args,
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   591
                ["--with-jcov-input-jdk=" + input.get(name + ".jdk", "home_path")]);
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   592
        });
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   593
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   594
    //
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   595
    // Define artifacts for profiles
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   596
    //
45048
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
   597
    // Macosx bundles are named osx
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   598
    // tar.gz.
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   599
    var artifactData = {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   600
        "linux-x64": {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   601
            platform: "linux-x64",
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   602
        },
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   603
        "linux-x86": {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   604
            platform: "linux-x86",
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   605
        },
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   606
        "macosx-x64": {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   607
            platform: "osx-x64",
45048
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
   608
            jdk_subdir: "jdk-" + data.version +  ".jdk/Contents/Home",
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   609
        },
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   610
        "solaris-x64": {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   611
            platform: "solaris-x64",
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   612
        },
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   613
        "solaris-sparcv9": {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   614
            platform: "solaris-sparcv9",
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   615
        },
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   616
        "windows-x64": {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   617
            platform: "windows-x64",
50511
075e9982b409 8204127: Change bundle format on Windows to zip
erikj
parents: 50494
diff changeset
   618
            jdk_suffix: "zip",
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   619
        },
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   620
        "windows-x86": {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   621
            platform: "windows-x86",
50511
075e9982b409 8204127: Change bundle format on Windows to zip
erikj
parents: 50494
diff changeset
   622
            jdk_suffix: "zip",
44625
cf100f579077 8177822: Move closed jib configuration for arm platforms to open
erikj
parents: 44513
diff changeset
   623
        },
49204
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 49147
diff changeset
   624
       "linux-aarch64": {
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 49147
diff changeset
   625
            platform: "linux-aarch64",
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 49147
diff changeset
   626
        },
50472
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 50273
diff changeset
   627
       "linux-arm32": {
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 50273
diff changeset
   628
            platform: "linux-arm32",
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   629
        }
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   630
    }
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   631
    // Generate common artifacts for all main profiles
44625
cf100f579077 8177822: Move closed jib configuration for arm platforms to open
erikj
parents: 44513
diff changeset
   632
    Object.keys(artifactData).forEach(function (name) {
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   633
        profiles[name] = concatObjects(profiles[name],
45048
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
   634
            common.main_profile_artifacts(artifactData[name]));
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   635
    });
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   636
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   637
    // Generate common artifacts for all debug profiles
44625
cf100f579077 8177822: Move closed jib configuration for arm platforms to open
erikj
parents: 44513
diff changeset
   638
    Object.keys(artifactData).forEach(function (name) {
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   639
        var debugName = name + common.debug_suffix;
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   640
        profiles[debugName] = concatObjects(profiles[debugName],
45048
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
   641
            common.debug_profile_artifacts(artifactData[name]));
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   642
    });
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   643
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   644
    profilesArtifacts = {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   645
        "linux-x64": {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   646
            artifacts: {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   647
                doc_api_spec: {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   648
                    local: "bundles/\\(jdk.*doc-api-spec.tar.gz\\)",
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   649
                    remote: [
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   650
                        "bundles/common/jdk-" + data.version + "_doc-api-spec.tar.gz",
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   651
                        "bundles/linux-x64/\\1"
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   652
                    ],
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   653
                },
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   654
            }
47721
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   655
        }
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   656
    };
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   657
    profiles = concatObjects(profiles, profilesArtifacts);
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   658
47721
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   659
    // Generate open only profiles for all the main and debug profiles.
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   660
    // Rewrite artifact remote paths by adding "openjdk/GPL".
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   661
    common.main_profile_names.forEach(function (name) {
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   662
        var openName = name + common.open_suffix;
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   663
        profiles[openName] = concatObjects(profiles[name],
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   664
            common.open_profile_base);
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   665
        for (artifactName in profiles[openName].artifacts) {
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   666
            var artifact = profiles[openName].artifacts[artifactName];
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   667
            artifact.remote = replaceAll(
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   668
                "bundles\/", "bundles/openjdk/GPL/",
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   669
                (artifact.remote != null ? artifact.remote : artifact.local));
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   670
        }
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   671
        var debugName = name + common.debug_suffix;
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   672
        var openDebugName = name + common.open_suffix + common.debug_suffix;
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   673
        profiles[openDebugName] = concatObjects(profiles[debugName],
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   674
            common.open_profile_base);
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   675
        for (artifactName in profiles[openDebugName].artifacts) {
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   676
            var artifact = profiles[openDebugName].artifacts[artifactName];
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   677
            artifact.remote = replaceAll(
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   678
                "bundles\/", "bundles/openjdk/GPL/",
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   679
                (artifact.remote != null ? artifact.remote : artifact.local));
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   680
        }
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   681
    });
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   682
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   683
    // Define the reference implementation profiles. These are basically the same
47721
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   684
    // as the open profiles, but upload artifacts to a different location.
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   685
    common.main_profile_names.forEach(function (name) {
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   686
        var riName = name + "-ri";
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   687
        var riDebugName = riName + common.debug_suffix;
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   688
        var openName = name + common.open_suffix;
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   689
        var openDebugName = openName + common.debug_suffix;
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   690
        profiles[riName] = clone(profiles[openName]);
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   691
        profiles[riDebugName] = clone(profiles[openDebugName]);
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   692
        // Rewrite all remote dirs to "bundles/openjdk/BCL/..."
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   693
        for (artifactName in profiles[riName].artifacts) {
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   694
            var artifact = profiles[riName].artifacts[artifactName];
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   695
            artifact.remote = replaceAll(
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   696
                "\/GPL\/", "/BCL/",
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   697
                (artifact.remote != null ? artifact.remote : artifact.local));
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   698
        }
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   699
    });
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
   700
48212
6a8ab8d1fb8b 8188789: Update JDK 9.0.1 and Future OpenJDK bundle names
erikj
parents: 48079
diff changeset
   701
    // For open profiles, the non-debug jdk bundles, need an "open" prefix on the
6a8ab8d1fb8b 8188789: Update JDK 9.0.1 and Future OpenJDK bundle names
erikj
parents: 48079
diff changeset
   702
    // remote bundle names, forming the word "openjdk". See JDK-8188789.
6a8ab8d1fb8b 8188789: Update JDK 9.0.1 and Future OpenJDK bundle names
erikj
parents: 48079
diff changeset
   703
    common.main_profile_names.forEach(function (name) {
6a8ab8d1fb8b 8188789: Update JDK 9.0.1 and Future OpenJDK bundle names
erikj
parents: 48079
diff changeset
   704
        var openName = name + common.open_suffix;
6a8ab8d1fb8b 8188789: Update JDK 9.0.1 and Future OpenJDK bundle names
erikj
parents: 48079
diff changeset
   705
        profiles[openName].artifacts["jdk"].remote = replaceAll(
6a8ab8d1fb8b 8188789: Update JDK 9.0.1 and Future OpenJDK bundle names
erikj
parents: 48079
diff changeset
   706
            "\/jdk-", "/openjdk-",
6a8ab8d1fb8b 8188789: Update JDK 9.0.1 and Future OpenJDK bundle names
erikj
parents: 48079
diff changeset
   707
            replaceAll("\/\\1", "/open\\1",
6a8ab8d1fb8b 8188789: Update JDK 9.0.1 and Future OpenJDK bundle names
erikj
parents: 48079
diff changeset
   708
                       profiles[openName].artifacts["jdk"].remote));
6a8ab8d1fb8b 8188789: Update JDK 9.0.1 and Future OpenJDK bundle names
erikj
parents: 48079
diff changeset
   709
    });
6a8ab8d1fb8b 8188789: Update JDK 9.0.1 and Future OpenJDK bundle names
erikj
parents: 48079
diff changeset
   710
50807
57d1175e2c7b 8205625: linux-aarch64-cmp-baseline fails builds-tier5
erikj
parents: 50702
diff changeset
   711
    // Generate cmp-baseline profiles for each main profile and their
57d1175e2c7b 8205625: linux-aarch64-cmp-baseline fails builds-tier5
erikj
parents: 50702
diff changeset
   712
    // corresponding debug profile. This profile does a compare build run with no
57d1175e2c7b 8205625: linux-aarch64-cmp-baseline fails builds-tier5
erikj
parents: 50702
diff changeset
   713
    // changes to verify that the compare script has a clean baseline
57d1175e2c7b 8205625: linux-aarch64-cmp-baseline fails builds-tier5
erikj
parents: 50702
diff changeset
   714
    common.main_profile_names.forEach(function (name) {
57d1175e2c7b 8205625: linux-aarch64-cmp-baseline fails builds-tier5
erikj
parents: 50702
diff changeset
   715
        [ "", common.open_suffix ].forEach(function (suffix) {
57d1175e2c7b 8205625: linux-aarch64-cmp-baseline fails builds-tier5
erikj
parents: 50702
diff changeset
   716
            var cmpBaselineName = name + suffix + "-cmp-baseline";
57d1175e2c7b 8205625: linux-aarch64-cmp-baseline fails builds-tier5
erikj
parents: 50702
diff changeset
   717
            profiles[cmpBaselineName] = clone(profiles[name + suffix]);
57d1175e2c7b 8205625: linux-aarch64-cmp-baseline fails builds-tier5
erikj
parents: 50702
diff changeset
   718
            // Only compare the images target. This should pressumably be expanded
57d1175e2c7b 8205625: linux-aarch64-cmp-baseline fails builds-tier5
erikj
parents: 50702
diff changeset
   719
            // to include more build targets when possible.
57d1175e2c7b 8205625: linux-aarch64-cmp-baseline fails builds-tier5
erikj
parents: 50702
diff changeset
   720
            profiles[cmpBaselineName].default_make_targets = [ "images" ];
57d1175e2c7b 8205625: linux-aarch64-cmp-baseline fails builds-tier5
erikj
parents: 50702
diff changeset
   721
            profiles[cmpBaselineName].make_args = [ "COMPARE_BUILD=CONF=" ];
57d1175e2c7b 8205625: linux-aarch64-cmp-baseline fails builds-tier5
erikj
parents: 50702
diff changeset
   722
            // Do not inherit artifact definitions from base profile
57d1175e2c7b 8205625: linux-aarch64-cmp-baseline fails builds-tier5
erikj
parents: 50702
diff changeset
   723
            delete profiles[cmpBaselineName].artifacts;
57d1175e2c7b 8205625: linux-aarch64-cmp-baseline fails builds-tier5
erikj
parents: 50702
diff changeset
   724
        });
57d1175e2c7b 8205625: linux-aarch64-cmp-baseline fails builds-tier5
erikj
parents: 50702
diff changeset
   725
    });
57d1175e2c7b 8205625: linux-aarch64-cmp-baseline fails builds-tier5
erikj
parents: 50702
diff changeset
   726
53423
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   727
    // Artifacts of JCov profiles
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   728
    [ "linux-x64", "macosx-x64", "solaris-sparcv9", "windows-x64"]
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   729
        .forEach(function (name) {
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   730
            var o = artifactData[name]
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   731
            var jdk_subdir = (o.jdk_subdir != null ? o.jdk_subdir : "jdk-" + data.version);
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   732
            var jdk_suffix = (o.jdk_suffix != null ? o.jdk_suffix : "tar.gz");
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   733
            var pf = o.platform
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   734
            var jcovName = name + "-jcov";
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   735
            profiles[jcovName].artifacts = {
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   736
                jdk: {
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   737
                    local: "bundles/\\(jdk-jcov.*bin." + jdk_suffix + "\\)",
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   738
                    remote: [
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   739
                        "bundles/" + pf + "/jdk-jcov-" + data.version + "_" + pf + "_bin." + jdk_suffix
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   740
                    ],
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   741
                    subdir: jdk_subdir,
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   742
                    exploded: "images/jdk-jcov"
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   743
                }
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   744
            };
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   745
        });
1ae823617395 8217357: Implement JCov jib profiles
shurailine
parents: 53240
diff changeset
   746
51994
7577686cc9bd 8211350: Remove jprt support
mikael
parents: 51899
diff changeset
   747
    // Profiles used to run tests.
47721
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   748
    var testOnlyProfiles = {
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   749
        "run-test": {
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   750
            target_os: input.build_os,
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   751
            target_cpu: input.build_cpu,
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   752
            dependencies: [ "jtreg", "gnumake", "boot_jdk", "devkit", "jib" ],
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   753
            labels: "test",
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   754
            environment: {
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   755
                "JT_JAVA": common.boot_jdk_home
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   756
            }
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   757
        }
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   758
    };
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   759
    profiles = concatObjects(profiles, testOnlyProfiles);
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   760
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   761
    // Profiles used to run tests using Jib for internal dependencies.
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   762
    var testedProfile = input.testedProfile;
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   763
    if (testedProfile == null) {
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   764
        testedProfile = input.build_os + "-" + input.build_cpu;
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   765
    }
53526
688ce88f89cd 8217761: Enhance run-test-prebuilt jib profile to support running tests with JCov
shurailine
parents: 53423
diff changeset
   766
    var testedProfileJDK = testedProfile + ".jdk";
688ce88f89cd 8217761: Enhance run-test-prebuilt jib profile to support running tests with JCov
shurailine
parents: 53423
diff changeset
   767
    var testedProfileTest = ""
688ce88f89cd 8217761: Enhance run-test-prebuilt jib profile to support running tests with JCov
shurailine
parents: 53423
diff changeset
   768
    if (testedProfile.endsWith("-jcov")) {
688ce88f89cd 8217761: Enhance run-test-prebuilt jib profile to support running tests with JCov
shurailine
parents: 53423
diff changeset
   769
        testedProfileTest = testedProfile.substring(0, testedProfile.length - "-jcov".length) + ".test";
688ce88f89cd 8217761: Enhance run-test-prebuilt jib profile to support running tests with JCov
shurailine
parents: 53423
diff changeset
   770
    } else {
688ce88f89cd 8217761: Enhance run-test-prebuilt jib profile to support running tests with JCov
shurailine
parents: 53423
diff changeset
   771
        testedProfileTest = testedProfile + ".test";
688ce88f89cd 8217761: Enhance run-test-prebuilt jib profile to support running tests with JCov
shurailine
parents: 53423
diff changeset
   772
    }
47721
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   773
    var testOnlyProfilesPrebuilt = {
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   774
        "run-test-prebuilt": {
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   775
            target_os: input.build_os,
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   776
            target_cpu: input.build_cpu,
52393
ff10f8f3a583 8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents: 52368
diff changeset
   777
            dependencies: [
53526
688ce88f89cd 8217761: Enhance run-test-prebuilt jib profile to support running tests with JCov
shurailine
parents: 53423
diff changeset
   778
                "jtreg", "gnumake", "boot_jdk", "devkit", "jib", "jcov", testedProfileJDK,
688ce88f89cd 8217761: Enhance run-test-prebuilt jib profile to support running tests with JCov
shurailine
parents: 53423
diff changeset
   779
                testedProfileTest
47721
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   780
            ],
52125
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   781
            src: "src.conf",
52343
b66b51c4e405 8213184: Revert change in jib-profiles.js from run-test-prebuilt to test-prebuilt
ihse
parents: 52342
diff changeset
   782
            make_args: [ "run-test-prebuilt", "LOG_CMDLINES=true", "JTREG_VERBOSE=fail,error,time" ],
47721
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   783
            environment: {
52125
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   784
                "BOOT_JDK": common.boot_jdk_home,
53526
688ce88f89cd 8217761: Enhance run-test-prebuilt jib profile to support running tests with JCov
shurailine
parents: 53423
diff changeset
   785
                "JDK_IMAGE_DIR": input.get(testedProfileJDK, "home_path"),
688ce88f89cd 8217761: Enhance run-test-prebuilt jib profile to support running tests with JCov
shurailine
parents: 53423
diff changeset
   786
                "TEST_IMAGE_DIR": input.get(testedProfileTest, "home_path")
47721
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   787
            },
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   788
            labels: "test"
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   789
        }
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   790
    };
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   791
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   792
    // If actually running the run-test-prebuilt profile, verify that the input
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   793
    // variable is valid and if so, add the appropriate target_* values from
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   794
    // the tested profile.
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   795
    if (input.profile == "run-test-prebuilt") {
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   796
        if (profiles[testedProfile] == null) {
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   797
            error("testedProfile is not defined: " + testedProfile);
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   798
        }
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   799
    }
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   800
    if (profiles[testedProfile] != null) {
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   801
        testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_os"]
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   802
            = profiles[testedProfile]["target_os"];
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   803
        testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_cpu"]
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   804
            = profiles[testedProfile]["target_cpu"];
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   805
    }
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   806
    profiles = concatObjects(profiles, testOnlyProfilesPrebuilt);
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   807
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   808
    // On macosx add the devkit bin dir to the path in all the run-test profiles.
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   809
    // This gives us a guaranteed working version of lldb for the jtreg failure handler.
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   810
    if (input.build_os == "macosx") {
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   811
        macosxRunTestExtra = {
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   812
            environment_path: input.get("devkit", "install_path")
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   813
                + "/Xcode.app/Contents/Developer/usr/bin"
49147
af37d9997bd6 8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents: 48924
diff changeset
   814
        };
47721
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   815
        profiles["run-test"] = concatObjects(profiles["run-test"], macosxRunTestExtra);
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   816
        profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"], macosxRunTestExtra);
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   817
    }
49147
af37d9997bd6 8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents: 48924
diff changeset
   818
    // On windows we want the debug symbols available at test time
af37d9997bd6 8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents: 48924
diff changeset
   819
    if (input.build_os == "windows") {
af37d9997bd6 8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents: 48924
diff changeset
   820
        windowsRunTestPrebuiltExtra = {
af37d9997bd6 8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents: 48924
diff changeset
   821
            dependencies: [ testedProfile + ".jdk_symbols" ],
af37d9997bd6 8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents: 48924
diff changeset
   822
            environment: {
52125
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   823
                "SYMBOLS_IMAGE_DIR": input.get(testedProfile + ".jdk_symbols", "home_path"),
49147
af37d9997bd6 8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents: 48924
diff changeset
   824
            }
af37d9997bd6 8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents: 48924
diff changeset
   825
        };
af37d9997bd6 8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents: 48924
diff changeset
   826
        profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"],
af37d9997bd6 8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents: 48924
diff changeset
   827
            windowsRunTestPrebuiltExtra);
af37d9997bd6 8199197: Set _NT_SYMBOL_PATH when running tests on windows
erikj
parents: 48924
diff changeset
   828
    }
47721
d2b306a70bf1 8190735: Define all base artifacts for all open/open-debug profiles
erikj
parents: 47701
diff changeset
   829
52125
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   830
    // The profile run-test-prebuilt defines src.conf as the src bundle. When
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   831
    // running in Mach 5, this reduces the time it takes to populate the
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   832
    // considerably. But with just src.conf, we cannot actually run any tests,
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   833
    // so if running from a workspace with just src.conf in it, we need to also
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   834
    // get src.full as a dependency, and define the work_dir (where make gets
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   835
    // run) to be in the src.full install path. By running in the install path,
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   836
    // the same cached installation of the full src can be reused for multiple
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   837
    // test tasks. Care must however be taken not to polute that work dir by
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   838
    // setting the appropriate make variables to control output directories.
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   839
    //
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   840
    // Use the existance of the top level README as indication of if this is
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   841
    // the full source or just src.conf.
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   842
    if (!new java.io.File(__DIR__, "../../README").exists()) {
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   843
        var runTestPrebuiltSrcFullExtra = {
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   844
            dependencies: "src.full",
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   845
            work_dir: input.get("src.full", "install_path"),
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   846
        }
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   847
        profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"],
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   848
            runTestPrebuiltSrcFullExtra);
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   849
    }
28375a1de254 8212028: Use run-test makefile framework for testing in Oracle's Mach5
erikj
parents: 52022
diff changeset
   850
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   851
    // Generate the missing platform attributes
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   852
    profiles = generatePlatformAttributes(profiles);
37649
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
   853
    profiles = generateDefaultMakeTargetsConfigureArg(common, profiles);
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   854
    return profiles;
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   855
};
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   856
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   857
/**
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   858
 * Generate the dependencies part of the configuration
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   859
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   860
 * @param input External data to use for generating the configuration
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   861
 * @param common The common values
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   862
 * @returns {{}} Dependencies part of configuration
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   863
 */
34496
b05757ebc035 8145185: Rename JAB the build tool to JIB
erikj
parents: 34491
diff changeset
   864
var getJibProfilesDependencies = function (input, common) {
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   865
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   866
    var devkit_platform_revisions = {
53642
2336cd378e7f 8218177: Bump jib format_version to support new devkit archive layout
erikj
parents: 53607
diff changeset
   867
        linux_x64: "gcc7.3.0-OEL6.4+1.2",
50702
2c9e2ec54a11 8205424: Change to Xcode 9.4 for building on Macosx at Oracle
erikj
parents: 50590
diff changeset
   868
        macosx_x64: "Xcode9.4-MacOSX10.13+1.0",
34595
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents: 34496
diff changeset
   869
        solaris_x64: "SS12u4-Solaris11u1+1.0",
51899
11fd6c8188d9 8211130: Change to Oracle Developer Studio 12.6 for building on Solaris at Oracle
erikj
parents: 51856
diff changeset
   870
        solaris_sparcv9: "SS12u6-Solaris11u3+1.0",
50273
737a17045ffe 8203795: Change default compiler on Windows to VS2017
erikj
parents: 50239
diff changeset
   871
        windows_x64: "VS2017-15.5.5+1.0",
53556
f3546d51ce9c 8217910: Slow linking with devkit on Linux
erikj
parents: 53526
diff changeset
   872
        linux_aarch64: "gcc7.3.0-Fedora27+1.2",
53579
b5f05fe4a6f8 8218084: Revert JDK-8218057
erikj
parents: 53569
diff changeset
   873
        linux_arm: "gcc7.3.0-Fedora27+1.2"
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   874
    };
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   875
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   876
    var devkit_platform = (input.target_cpu == "x86"
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   877
        ? input.target_os + "_x64"
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   878
        : input.target_platform);
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   879
47364
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47292
diff changeset
   880
    var boot_jdk_platform = (input.build_os == "macosx" ? "osx" : input.build_os)
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47292
diff changeset
   881
        + "-" + input.build_cpu;
53240
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
   882
    var boot_jdk_ext = (input.build_os == "windows" ? ".zip" : ".tar.gz")
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
   883
    // If running in WSL and building for Windows, it will look like Linux,
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
   884
    // but we need a Windows boot JDK.
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
   885
    if (isWsl(input) && input.target_os == "windows") {
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
   886
        boot_jdk_platform = "windows-" + input.build_cpu;
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
   887
        boot_jdk_ext = ".zip";
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
   888
    }
47364
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47292
diff changeset
   889
48079
eaa406097d93 8193060: Set MAKE env variable in jib profile for gnumake
ihse
parents: 48035
diff changeset
   890
    var makeBinDir = (input.build_os == "windows"
eaa406097d93 8193060: Set MAKE env variable in jib profile for gnumake
ihse
parents: 48035
diff changeset
   891
        ? input.get("gnumake", "install_path") + "/cygwin/bin"
eaa406097d93 8193060: Set MAKE env variable in jib profile for gnumake
ihse
parents: 48035
diff changeset
   892
        : input.get("gnumake", "install_path") + "/bin");
eaa406097d93 8193060: Set MAKE env variable in jib profile for gnumake
ihse
parents: 48035
diff changeset
   893
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   894
    var dependencies = {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   895
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   896
        boot_jdk: {
47364
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47292
diff changeset
   897
            server: "jpg",
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47292
diff changeset
   898
            product: "jdk",
47365
92f08900cb3c 8189679: JDK-8189094 broke testing in Mach 5
erikj
parents: 47364
diff changeset
   899
            version: common.boot_jdk_version,
52509
b091b768fea4 8213569: Bump minimum boot jdk to JDK 11
mikael
parents: 52443
diff changeset
   900
            build_number: "28",
47365
92f08900cb3c 8189679: JDK-8189094 broke testing in Mach 5
erikj
parents: 47364
diff changeset
   901
            file: "bundles/" + boot_jdk_platform + "/jdk-" + common.boot_jdk_version + "_"
53240
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
   902
                + boot_jdk_platform + "_bin" + boot_jdk_ext,
41047
de6f69208f82 8164301: jib should provide a JDK for running jtreg with
erikj
parents: 40241
diff changeset
   903
            configure_args: "--with-boot-jdk=" + common.boot_jdk_home,
43288
58b8748ef90d 8173476: Provide lldb from devkit when running tests on macosx
erikj
parents: 43049
diff changeset
   904
            environment_path: common.boot_jdk_home + "/bin"
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   905
        },
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   906
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   907
        devkit: {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   908
            organization: common.organization,
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   909
            ext: "tar.gz",
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   910
            module: "devkit-" + devkit_platform,
52393
ff10f8f3a583 8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents: 52368
diff changeset
   911
            revision: devkit_platform_revisions[devkit_platform],
ff10f8f3a583 8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents: 52368
diff changeset
   912
            environment: {
ff10f8f3a583 8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents: 52368
diff changeset
   913
                "DEVKIT_HOME": input.get("devkit", "home_path"),
ff10f8f3a583 8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
epavlova
parents: 52368
diff changeset
   914
            }
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   915
        },
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   916
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   917
        build_devkit: {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   918
            organization: common.organization,
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   919
            ext: "tar.gz",
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   920
            module: "devkit-" + input.build_platform,
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   921
            revision: devkit_platform_revisions[input.build_platform]
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   922
        },
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   923
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   924
        cups: {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   925
            organization: common.organization,
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   926
            ext: "tar.gz",
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   927
            revision: "1.0118+1.0"
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   928
        },
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   929
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   930
        jtreg: {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   931
            server: "javare",
36506
17612cee3530 8142968: Module System implementation
alanb
parents: 36170
diff changeset
   932
            revision: "4.2",
51280
a306c84e40fa 8208647: switch jtreg to 4.2b13
iignatyev
parents: 51215
diff changeset
   933
            build_number: "b13",
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   934
            checksum_file: "MD5_VALUES",
36506
17612cee3530 8142968: Module System implementation
alanb
parents: 36170
diff changeset
   935
            file: "jtreg_bin-4.2.zip",
41047
de6f69208f82 8164301: jib should provide a JDK for running jtreg with
erikj
parents: 40241
diff changeset
   936
            environment_name: "JT_HOME",
de6f69208f82 8164301: jib should provide a JDK for running jtreg with
erikj
parents: 40241
diff changeset
   937
            environment_path: input.get("jtreg", "install_path") + "/jtreg/bin"
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   938
        },
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   939
52595
16609197022c 8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents: 52588
diff changeset
   940
        jmh: {
16609197022c 8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents: 52588
diff changeset
   941
            organization: common.organization,
16609197022c 8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents: 52588
diff changeset
   942
            ext: "tar.gz",
16609197022c 8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents: 52588
diff changeset
   943
            revision: "1.21+1.0"
16609197022c 8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents: 52588
diff changeset
   944
        },
16609197022c 8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents: 52588
diff changeset
   945
52774
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52714
diff changeset
   946
        jcov: {
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52714
diff changeset
   947
            server: "jpg",
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52714
diff changeset
   948
            product: "jcov",
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52714
diff changeset
   949
            version: "3.0",
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52714
diff changeset
   950
            build_number: "b07",
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52714
diff changeset
   951
            file: "bundles/jcov-3_0.zip",
53526
688ce88f89cd 8217761: Enhance run-test-prebuilt jib profile to support running tests with JCov
shurailine
parents: 53423
diff changeset
   952
            environment_name: "JCOV_HOME",
52774
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52714
diff changeset
   953
        },
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52714
diff changeset
   954
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   955
        gnumake: {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   956
            organization: common.organization,
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   957
            ext: "tar.gz",
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   958
            revision: "4.0+1.0",
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   959
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   960
            module: (input.build_os == "windows"
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   961
                ? "gnumake-" + input.build_osenv_platform
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   962
                : "gnumake-" + input.build_platform),
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   963
48079
eaa406097d93 8193060: Set MAKE env variable in jib profile for gnumake
ihse
parents: 48035
diff changeset
   964
            configure_args: "MAKE=" + makeBinDir + "/make",
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   965
48079
eaa406097d93 8193060: Set MAKE env variable in jib profile for gnumake
ihse
parents: 48035
diff changeset
   966
            environment: {
eaa406097d93 8193060: Set MAKE env variable in jib profile for gnumake
ihse
parents: 48035
diff changeset
   967
                "MAKE": makeBinDir + "/make"
eaa406097d93 8193060: Set MAKE env variable in jib profile for gnumake
ihse
parents: 48035
diff changeset
   968
            },
eaa406097d93 8193060: Set MAKE env variable in jib profile for gnumake
ihse
parents: 48035
diff changeset
   969
eaa406097d93 8193060: Set MAKE env variable in jib profile for gnumake
ihse
parents: 48035
diff changeset
   970
            environment_path: makeBinDir
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   971
        },
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
   972
48743
ba52fa7bbf14 8195689: Remove generated-configure.sh and instead use autoconf
ihse
parents: 48357
diff changeset
   973
        autoconf: {
ba52fa7bbf14 8195689: Remove generated-configure.sh and instead use autoconf
ihse
parents: 48357
diff changeset
   974
            organization: common.organization,
ba52fa7bbf14 8195689: Remove generated-configure.sh and instead use autoconf
ihse
parents: 48357
diff changeset
   975
            ext: "tar.gz",
ba52fa7bbf14 8195689: Remove generated-configure.sh and instead use autoconf
ihse
parents: 48357
diff changeset
   976
            revision: "2.69+1.0.1",
ba52fa7bbf14 8195689: Remove generated-configure.sh and instead use autoconf
ihse
parents: 48357
diff changeset
   977
            module: (input.build_os == "windows"
ba52fa7bbf14 8195689: Remove generated-configure.sh and instead use autoconf
ihse
parents: 48357
diff changeset
   978
                ? "autoconf-" + input.build_osenv_platform
ba52fa7bbf14 8195689: Remove generated-configure.sh and instead use autoconf
ihse
parents: 48357
diff changeset
   979
                : "autoconf-" + input.build_platform),
ba52fa7bbf14 8195689: Remove generated-configure.sh and instead use autoconf
ihse
parents: 48357
diff changeset
   980
            configure_args: "",
ba52fa7bbf14 8195689: Remove generated-configure.sh and instead use autoconf
ihse
parents: 48357
diff changeset
   981
            environment_path: input.get("autoconf", "install_path")
ba52fa7bbf14 8195689: Remove generated-configure.sh and instead use autoconf
ihse
parents: 48357
diff changeset
   982
        },
ba52fa7bbf14 8195689: Remove generated-configure.sh and instead use autoconf
ihse
parents: 48357
diff changeset
   983
44727
ca162fc20601 8178965: Second part of JDK-8176785
ihse
parents: 44626
diff changeset
   984
        graphviz: {
ca162fc20601 8178965: Second part of JDK-8176785
ihse
parents: 44626
diff changeset
   985
            organization: common.organization,
ca162fc20601 8178965: Second part of JDK-8176785
ihse
parents: 44626
diff changeset
   986
            ext: "tar.gz",
ca162fc20601 8178965: Second part of JDK-8176785
ihse
parents: 44626
diff changeset
   987
            revision: "2.38.0-1+1.1",
ca162fc20601 8178965: Second part of JDK-8176785
ihse
parents: 44626
diff changeset
   988
            module: "graphviz-" + input.target_platform,
45107
8d21264e7878 8180420: Set PATH for dot and pandoc in JIB
ihse
parents: 45099
diff changeset
   989
            configure_args: "DOT=" + input.get("graphviz", "install_path") + "/dot",
8d21264e7878 8180420: Set PATH for dot and pandoc in JIB
ihse
parents: 45099
diff changeset
   990
            environment_path: input.get("graphviz", "install_path")
44727
ca162fc20601 8178965: Second part of JDK-8176785
ihse
parents: 44626
diff changeset
   991
        },
44734
70bbd6884287 8179022: Add serialization spec as markdown
ihse
parents: 44727
diff changeset
   992
70bbd6884287 8179022: Add serialization spec as markdown
ihse
parents: 44727
diff changeset
   993
        pandoc: {
70bbd6884287 8179022: Add serialization spec as markdown
ihse
parents: 44727
diff changeset
   994
            organization: common.organization,
70bbd6884287 8179022: Add serialization spec as markdown
ihse
parents: 44727
diff changeset
   995
            ext: "tar.gz",
52714
2e52aa822c57 8178317: Create man pages using pandoc from markdown sources
ihse
parents: 52595
diff changeset
   996
            revision: "2.3.1+1.0",
53240
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
   997
            module: "pandoc-" + input.build_platform,
45107
8d21264e7878 8180420: Set PATH for dot and pandoc in JIB
ihse
parents: 45099
diff changeset
   998
            configure_args: "PANDOC=" + input.get("pandoc", "install_path") + "/pandoc/pandoc",
8d21264e7878 8180420: Set PATH for dot and pandoc in JIB
ihse
parents: 45099
diff changeset
   999
            environment_path: input.get("pandoc", "install_path") + "/pandoc"
44734
70bbd6884287 8179022: Add serialization spec as markdown
ihse
parents: 44727
diff changeset
  1000
        },
48743
ba52fa7bbf14 8195689: Remove generated-configure.sh and instead use autoconf
ihse
parents: 48357
diff changeset
  1001
46196
822ca950ddaa 8175300: Enable artifact resolution for jtreg tests
ctornqvi
parents: 46193
diff changeset
  1002
        // This adds java jib as a dependency for the test artifacts resolver
822ca950ddaa 8175300: Enable artifact resolution for jtreg tests
ctornqvi
parents: 46193
diff changeset
  1003
        jib: {
822ca950ddaa 8175300: Enable artifact resolution for jtreg tests
ctornqvi
parents: 46193
diff changeset
  1004
            organization: "com.oracle.java.jib",
822ca950ddaa 8175300: Enable artifact resolution for jtreg tests
ctornqvi
parents: 46193
diff changeset
  1005
            ext: "zip",
822ca950ddaa 8175300: Enable artifact resolution for jtreg tests
ctornqvi
parents: 46193
diff changeset
  1006
            classifier: "distribution",
822ca950ddaa 8175300: Enable artifact resolution for jtreg tests
ctornqvi
parents: 46193
diff changeset
  1007
            revision: "3.0-SNAPSHOT",
51856
11b9d3a6f31c 8211037: Load jib jars dynamically from JibArtifactManager
erikj
parents: 51466
diff changeset
  1008
            environment_name: "JIB_HOME",
53642
2336cd378e7f 8218177: Bump jib format_version to support new devkit archive layout
erikj
parents: 53607
diff changeset
  1009
            environment_value: input.get("jib", "home_path")
49243
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
  1010
        },
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
  1011
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
  1012
        ant: {
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
  1013
            organization: common.organization,
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
  1014
            ext: "zip",
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
  1015
            revision: "1.7.1+1.0",
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
  1016
            configure_args: "",
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
  1017
        },
176b3da8ce61 8199423: Create builds-infra Mach5 job
erikj
parents: 49234
diff changeset
  1018
50908
7c51db95ccb6 8205207: Port Graal unit tests under jtreg
epavlova
parents: 50807
diff changeset
  1019
        graalunit_lib: {
7c51db95ccb6 8205207: Port Graal unit tests under jtreg
epavlova
parents: 50807
diff changeset
  1020
            organization: common.organization,
7c51db95ccb6 8205207: Port Graal unit tests under jtreg
epavlova
parents: 50807
diff changeset
  1021
            ext: "zip",
7c51db95ccb6 8205207: Port Graal unit tests under jtreg
epavlova
parents: 50807
diff changeset
  1022
            revision: "619_Apr_12_2018",
7c51db95ccb6 8205207: Port Graal unit tests under jtreg
epavlova
parents: 50807
diff changeset
  1023
            module: "graalunit-lib",
7c51db95ccb6 8205207: Port Graal unit tests under jtreg
epavlova
parents: 50807
diff changeset
  1024
            configure_args: "--with-graalunit-lib=" + input.get("graalunit_lib", "install_path"),
7c51db95ccb6 8205207: Port Graal unit tests under jtreg
epavlova
parents: 50807
diff changeset
  1025
            environment_name: "GRAALUNIT_LIB"
7c51db95ccb6 8205207: Port Graal unit tests under jtreg
epavlova
parents: 50807
diff changeset
  1026
        },
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1027
    };
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1028
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1029
    return dependencies;
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1030
};
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1031
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1032
/**
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1033
 * Generate the missing platform attributes for profiles
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1034
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1035
 * @param profiles Profiles map to generate attributes on
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1036
 * @returns {{}} New profiles map with platform attributes fully filled in
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1037
 */
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1038
var generatePlatformAttributes = function (profiles) {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1039
    var ret = concatObjects(profiles, {});
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1040
    for (var profile in profiles) {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1041
        if (ret[profile].build_os == null) {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1042
            ret[profile].build_os = ret[profile].target_os;
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1043
        }
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1044
        if (ret[profile].build_cpu == null) {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1045
            ret[profile].build_cpu = ret[profile].target_cpu;
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1046
        }
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1047
        ret[profile].target_platform = ret[profile].target_os + "_" + ret[profile].target_cpu;
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1048
        ret[profile].build_platform = ret[profile].build_os + "_" + ret[profile].build_cpu;
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1049
    }
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1050
    return ret;
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1051
};
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1052
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1053
/**
37649
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1054
 * 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
  1055
 * 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
  1056
 * 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
  1057
 *
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1058
 * @param common Common values
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1059
 * @param profiles Profiles map to rewrite profiles for
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1060
 * @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
  1061
 */
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1062
var generateDefaultMakeTargetsConfigureArg = function (common, profiles) {
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1063
    var ret = concatObjects(profiles, {});
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1064
    for (var profile in ret) {
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1065
        if (ret[profile]["default_make_targets"] != null) {
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1066
            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
  1067
            // 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
  1068
            // 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
  1069
            var found = false;
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1070
            for (var i in ret[profile].configure_args) {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1071
                var arg = ret[profile].configure_args[i];
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1072
                if (arg != null && arg.startsWith("--with-default-make-target=")) {
37649
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1073
                    found = true;
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1074
                    ret[profile].configure_args[i]
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1075
                        = "--with-default-make-target=" + targetsString;
37649
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1076
                }
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1077
            }
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1078
            if (!found) {
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1079
                ret[profile].configure_args = concat(
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1080
                    ret[profile].configure_args,
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1081
                    "--with-default-make-target=" + targetsString);
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1082
            }
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1083
        }
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1084
    }
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1085
    return ret;
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1086
}
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1087
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1088
var getBuildId = function (input) {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1089
    if (input.build_id != null) {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1090
        return input.build_id;
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1091
    } else {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1092
        var topdir = new java.io.File(__DIR__, "../..").getCanonicalFile().getName();
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1093
        var userName = java.lang.System.getProperty("user.name");
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1094
        return userName + "." + topdir;
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1095
    }
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1096
}
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1097
37649
3809534d4531 8154841: Let different Jib profiles have different default make targets
erikj
parents: 37407
diff changeset
  1098
/**
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1099
 * Deep clones an object tree.
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1100
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1101
 * @param o Object to clone
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1102
 * @returns {{}} Clone of o
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1103
 */
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1104
var clone = function (o) {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1105
    return JSON.parse(JSON.stringify(o));
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1106
};
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1107
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1108
/**
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1109
 * Concatenates all arguments into a new array
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1110
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1111
 * @returns {Array.<T>} New array containing all arguments
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1112
 */
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1113
var concat = function () {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1114
    return Array.prototype.concat.apply([], arguments);
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1115
};
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1116
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1117
/**
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1118
 * Takes a String or Array of Strings and does a replace operation on each
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1119
 * of them.
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1120
 *
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1121
 * @param pattern Pattern to look for
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1122
 * @param replacement Replacement text to insert
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1123
 * @param a String or Array of Strings to replace
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1124
 * @returns {Array} Either a new array or a new string depending on the input
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1125
 */
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1126
var replaceAll = function (pattern, replacement, a) {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1127
    // If a is an array
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1128
    if (Array === a.constructor) {
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1129
    var newA = [];
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1130
    for (var i in a) {
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1131
            newA.push(a[i].replace(pattern, replacement));
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1132
        }
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1133
        return newA;
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1134
        } else {
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1135
        return a.replace(pattern, replacement);
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1136
    }
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1137
};
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1138
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1139
/**
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1140
 * Deep concatenation of two objects. For each node encountered, merge
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1141
 * the contents with the corresponding node in the other object tree,
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1142
 * treating all strings as array elements.
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1143
 *
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1144
 * @param o1 Object to concatenate
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1145
 * @param o2 Object to concatenate
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1146
 * @returns {{}} New object tree containing the concatenation of o1 and o2
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1147
 */
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1148
var concatObjects = function (o1, o2) {
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1149
    if (o1 == null) {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1150
        return clone(o2);
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1151
    }
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1152
    if (o2 == null) {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1153
        return clone(o1);
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1154
    }
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1155
    var ret = {};
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1156
    for (var a in o1) {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1157
        if (o2[a] == null) {
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1158
            ret[a] = clone(o1[a]);
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1159
        }
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1160
    }
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1161
    for (var a in o2) {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1162
        if (o1[a] == null) {
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1163
            ret[a] = clone(o2[a]);
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1164
        } else {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1165
            if (typeof o1[a] == 'string') {
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1166
                ret[a] = clone([o1[a]].concat(o2[a]));
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1167
            } else if (Array.isArray(o1[a])) {
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1168
                ret[a] = clone(o1[a].concat(o2[a]));
34491
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1169
            } else if (typeof o1[a] == 'object') {
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1170
                ret[a] = concatObjects(o1[a], o2[a]);
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1171
            }
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1172
        }
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1173
    }
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1174
    return ret;
307c28cb36c2 8136782: Introduce a build/configure wrapper
erikj
parents:
diff changeset
  1175
};
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1176
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1177
/**
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1178
 * Constructs the numeric version string from reading the
47928
fb62d4519338 8191715: Update documentation pointing to "common" directory
ihse
parents: 47825
diff changeset
  1179
 * make/autoconf/version-numbers file and removing all trailing ".0".
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1180
 *
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 48212
diff changeset
  1181
 * @param feature Override feature version
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 48212
diff changeset
  1182
 * @param interim Override interim version
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 48212
diff changeset
  1183
 * @param update Override update version
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1184
 * @param patch Override patch version
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1185
 * @returns {String} The numeric version string
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1186
 */
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 48212
diff changeset
  1187
var getVersion = function (feature, interim, update, patch) {
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1188
    var version_numbers = getVersionNumbers();
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 48212
diff changeset
  1189
    var version = (feature != null ? feature : version_numbers.get("DEFAULT_VERSION_FEATURE"))
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 48212
diff changeset
  1190
        + "." + (interim != null ? interim : version_numbers.get("DEFAULT_VERSION_INTERIM"))
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 48212
diff changeset
  1191
        + "." + (update != null ? update :  version_numbers.get("DEFAULT_VERSION_UPDATE"))
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1192
        + "." + (patch != null ? patch : version_numbers.get("DEFAULT_VERSION_PATCH"));
43600
092ff49ea148 8173894: jib reports version "" in jdk10
ssarne
parents: 43049
diff changeset
  1193
    while (version.match(".*\\.0$")) {
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1194
        version = version.substring(0, version.length - 2);
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1195
    }
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1196
    return version;
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1197
};
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1198
45048
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
  1199
/**
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
  1200
 * Constructs the common version configure args based on build type and
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
  1201
 * other version inputs
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
  1202
 */
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
  1203
var versionArgs = function(input, common) {
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
  1204
    var args = ["--with-version-build=" + common.build_number];
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
  1205
    if (input.build_type == "promoted") {
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
  1206
        args = concat(args,
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
  1207
                      // This needs to be changed when we start building release candidates
48773
8a0181cb87d2 8195973: Update JDK 10 repo for FCS build
asaha
parents: 48327
diff changeset
  1208
                      // with-version-pre must be set to ea for 'ea' and empty for fcs build
51466
d222f503b7fe 8209760: merge error: restore ea in make/conf/jib-profiles.js
tbell
parents: 51464
diff changeset
  1209
                      "--with-version-pre=ea",
45048
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
  1210
                      "--without-version-opt");
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
  1211
    } else {
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
  1212
        args = concat(args, "--with-version-opt=" + common.build_id);
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
  1213
    }
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
  1214
    return args;
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
  1215
}
665cd82e98dc 8180081: Adjust Jib and JDL configuration for 10 to support promotable builds
erikj
parents: 44894
diff changeset
  1216
47928
fb62d4519338 8191715: Update documentation pointing to "common" directory
ihse
parents: 47825
diff changeset
  1217
// Properties representation of the make/autoconf/version-numbers file. Lazily
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1218
// initiated by the function below.
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1219
var version_numbers;
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1220
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1221
/**
47928
fb62d4519338 8191715: Update documentation pointing to "common" directory
ihse
parents: 47825
diff changeset
  1222
 * Read the make/autoconf/version-numbers file into a Properties object.
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1223
 *
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1224
 * @returns {java.utilProperties}
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1225
 */
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1226
var getVersionNumbers = function () {
47928
fb62d4519338 8191715: Update documentation pointing to "common" directory
ihse
parents: 47825
diff changeset
  1227
    // Read version information from make/autoconf/version-numbers
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1228
    if (version_numbers == null) {
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1229
        version_numbers = new java.util.Properties();
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
  1230
        var stream = new java.io.FileInputStream(__DIR__ + "/../autoconf/version-numbers");
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1231
        version_numbers.load(stream);
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1232
        stream.close();
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1233
    }
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1234
    return version_numbers;
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42425
diff changeset
  1235
}
53240
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
  1236
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
  1237
/**
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
  1238
 * Returns true if running in Windows Subsystem for Linux. Jib does not yet
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
  1239
 * detect wsl as osenv, so fall back on linux with version containing Microsoft.
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
  1240
 */
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
  1241
var isWsl = function (input) {
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
  1242
    return ( input.build_osenv == "wsl"
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
  1243
             || (input.build_os == "linux"
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
  1244
                 && java.lang.System.getProperty("os.version").contains("Microsoft")));
f6ab4cc4c70e 8216278: Fix devkit and basic Jib support on WSL
erikj
parents: 52930
diff changeset
  1245
}