8145185: Rename JAB the build tool to JIB
Reviewed-by: ihse, tbell
This commit is contained in:
parent
7310665243
commit
7eb52768c6
@ -4,7 +4,7 @@ nbproject/private/
|
||||
^webrev
|
||||
^.hgtip
|
||||
^.bridge2
|
||||
^.jab/
|
||||
^.jib/
|
||||
.DS_Store
|
||||
.metadata/
|
||||
.recommenders/
|
||||
|
@ -1,127 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# This script installs the JAB tool into it's own local repository and
|
||||
# puts a wrapper scripts into <source-root>/.jab
|
||||
|
||||
mydir="$(dirname "${BASH_SOURCE[0]}")"
|
||||
myname="$(basename "${BASH_SOURCE[0]}")"
|
||||
|
||||
installed_jab_script=${mydir}/../../.jab/jab
|
||||
install_data=${mydir}/../../.jab/.data
|
||||
|
||||
setup_url() {
|
||||
if [ -f "~/.config/jab/jab.conf" ]; then
|
||||
source ~/.config/jab/jab.conf
|
||||
fi
|
||||
|
||||
jab_repository="jdk-virtual"
|
||||
jab_organization="jpg/infra/builddeps"
|
||||
jab_module="jab"
|
||||
jab_revision="2.0-SNAPSHOT"
|
||||
jab_ext="jab.sh.gz"
|
||||
|
||||
closed_script="${mydir}/../../closed/conf/jab-install.conf"
|
||||
if [ -f "${closed_script}" ]; then
|
||||
source "${closed_script}"
|
||||
fi
|
||||
|
||||
if [ -n "${JAB_SERVER}" ]; then
|
||||
jab_server="${JAB_SERVER}"
|
||||
fi
|
||||
if [ -n "${JAB_REPOSITORY}" ]; then
|
||||
jab_repository="${JAB_REPOSITORY}"
|
||||
fi
|
||||
if [ -n "${JAB_ORGANIZATION}" ]; then
|
||||
jab_organization="${JAB_ORGANIZATION}"
|
||||
fi
|
||||
if [ -n "${JAB_MODULE}" ]; then
|
||||
jab_module="${JAB_MODULE}"
|
||||
fi
|
||||
if [ -n "${JAB_REVISION}" ]; then
|
||||
jab_revision="${JAB_REVISION}"
|
||||
fi
|
||||
if [ -n "${JAB_EXTENSION}" ]; then
|
||||
jab_extension="${JAB_EXTENSION}"
|
||||
fi
|
||||
|
||||
if [ -n "${JAB_URL}" ]; then
|
||||
jab_url="${JAB_URL}"
|
||||
data_string="${jab_url}"
|
||||
else
|
||||
data_string="${jab_repository}/${jab_organization}/${jab_module}/${jab_revision}/${jab_module}-${jab_revision}.${jab_ext}"
|
||||
jab_url="${jab_server}/${data_string}"
|
||||
fi
|
||||
}
|
||||
|
||||
install_jab() {
|
||||
if [ -z "${jab_server}" -a -z "${JAB_URL}" ]; then
|
||||
echo "No jab server or URL provided, set either"
|
||||
echo "JAB_SERVER=<base server address>"
|
||||
echo "or"
|
||||
echo "JAB_URL=<full path to install script>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if command -v curl > /dev/null; then
|
||||
getcmd="curl -s"
|
||||
elif command -v wget > /dev/null; then
|
||||
getcmd="wget --quiet -O -"
|
||||
else
|
||||
echo "Could not find either curl or wget"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v gunzip > /dev/null; then
|
||||
echo "Could not find gunzip"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Downloading JAB bootstrap script"
|
||||
mkdir -p "${installed_jab_script%/*}"
|
||||
rm -f "${installed_jab_script}.gz"
|
||||
${getcmd} ${jab_url} > "${installed_jab_script}.gz"
|
||||
if [ ! -s "${installed_jab_script}.gz" ]; then
|
||||
echo "Failed to download ${jab_url}"
|
||||
exit 1
|
||||
fi
|
||||
echo "Extracting JAB bootstrap script"
|
||||
rm -f "${installed_jab_script}"
|
||||
gunzip "${installed_jab_script}.gz"
|
||||
chmod +x "${installed_jab_script}"
|
||||
echo "${data_string}" > "${install_data}"
|
||||
}
|
||||
|
||||
# Main body starts here
|
||||
|
||||
setup_url
|
||||
|
||||
if [ ! -x "${installed_jab_script}" ]; then
|
||||
install_jab
|
||||
elif [ ! -e "${install_data}" ] || [ "${data_string}" != "$(cat "${install_data}")" ]; then
|
||||
echo "Install url changed since last time, reinstalling"
|
||||
install_jab
|
||||
fi
|
||||
|
||||
${installed_jab_script} "$@"
|
127
common/bin/jib.sh
Normal file
127
common/bin/jib.sh
Normal file
@ -0,0 +1,127 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# This script installs the JIB tool into it's own local repository and
|
||||
# puts a wrapper scripts into <source-root>/.jib
|
||||
|
||||
mydir="$(dirname "${BASH_SOURCE[0]}")"
|
||||
myname="$(basename "${BASH_SOURCE[0]}")"
|
||||
|
||||
installed_jib_script=${mydir}/../../.jib/jib
|
||||
install_data=${mydir}/../../.jib/.data
|
||||
|
||||
setup_url() {
|
||||
if [ -f "~/.config/jib/jib.conf" ]; then
|
||||
source ~/.config/jib/jib.conf
|
||||
fi
|
||||
|
||||
jib_repository="jdk-virtual"
|
||||
jib_organization="jpg/infra/builddeps"
|
||||
jib_module="jib"
|
||||
jib_revision="2.0-SNAPSHOT"
|
||||
jib_ext="jib.sh.gz"
|
||||
|
||||
closed_script="${mydir}/../../closed/conf/jib-install.conf"
|
||||
if [ -f "${closed_script}" ]; then
|
||||
source "${closed_script}"
|
||||
fi
|
||||
|
||||
if [ -n "${JIB_SERVER}" ]; then
|
||||
jib_server="${JIB_SERVER}"
|
||||
fi
|
||||
if [ -n "${JIB_REPOSITORY}" ]; then
|
||||
jib_repository="${JIB_REPOSITORY}"
|
||||
fi
|
||||
if [ -n "${JIB_ORGANIZATION}" ]; then
|
||||
jib_organization="${JIB_ORGANIZATION}"
|
||||
fi
|
||||
if [ -n "${JIB_MODULE}" ]; then
|
||||
jib_module="${JIB_MODULE}"
|
||||
fi
|
||||
if [ -n "${JIB_REVISION}" ]; then
|
||||
jib_revision="${JIB_REVISION}"
|
||||
fi
|
||||
if [ -n "${JIB_EXTENSION}" ]; then
|
||||
jib_extension="${JIB_EXTENSION}"
|
||||
fi
|
||||
|
||||
if [ -n "${JIB_URL}" ]; then
|
||||
jib_url="${JIB_URL}"
|
||||
data_string="${jib_url}"
|
||||
else
|
||||
data_string="${jib_repository}/${jib_organization}/${jib_module}/${jib_revision}/${jib_module}-${jib_revision}.${jib_ext}"
|
||||
jib_url="${jib_server}/${data_string}"
|
||||
fi
|
||||
}
|
||||
|
||||
install_jib() {
|
||||
if [ -z "${jib_server}" -a -z "${JIB_URL}" ]; then
|
||||
echo "No jib server or URL provided, set either"
|
||||
echo "JIB_SERVER=<base server address>"
|
||||
echo "or"
|
||||
echo "JIB_URL=<full path to install script>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if command -v curl > /dev/null; then
|
||||
getcmd="curl -s"
|
||||
elif command -v wget > /dev/null; then
|
||||
getcmd="wget --quiet -O -"
|
||||
else
|
||||
echo "Could not find either curl or wget"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v gunzip > /dev/null; then
|
||||
echo "Could not find gunzip"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Downloading JIB bootstrap script"
|
||||
mkdir -p "${installed_jib_script%/*}"
|
||||
rm -f "${installed_jib_script}.gz"
|
||||
${getcmd} ${jib_url} > "${installed_jib_script}.gz"
|
||||
if [ ! -s "${installed_jib_script}.gz" ]; then
|
||||
echo "Failed to download ${jib_url}"
|
||||
exit 1
|
||||
fi
|
||||
echo "Extracting JIB bootstrap script"
|
||||
rm -f "${installed_jib_script}"
|
||||
gunzip "${installed_jib_script}.gz"
|
||||
chmod +x "${installed_jib_script}"
|
||||
echo "${data_string}" > "${install_data}"
|
||||
}
|
||||
|
||||
# Main body starts here
|
||||
|
||||
setup_url
|
||||
|
||||
if [ ! -x "${installed_jib_script}" ]; then
|
||||
install_jib
|
||||
elif [ ! -e "${install_data}" ] || [ "${data_string}" != "$(cat "${install_data}")" ]; then
|
||||
echo "Install url changed since last time, reinstalling"
|
||||
install_jib
|
||||
fi
|
||||
|
||||
${installed_jib_script} "$@"
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file defines build profiles for the JAB tool and others.
|
||||
* This file defines build profiles for the JIB tool and others.
|
||||
*
|
||||
* A build profile defines a set of configuration options and external
|
||||
* dependencies that we for some reason or other care about specifically.
|
||||
@ -34,7 +34,7 @@
|
||||
* Contract against this file from the tools that use it, is to provide
|
||||
* a function on the form:
|
||||
*
|
||||
* getJabProfiles(input)
|
||||
* getJibProfiles(input)
|
||||
*
|
||||
* which returns an object graph describing the profiles and their
|
||||
* dependencies. The name of the function is based on the name of this
|
||||
@ -84,7 +84,7 @@
|
||||
* // Identifies the version of this format to the tool reading it
|
||||
* format_version: "1.0",
|
||||
*
|
||||
* // Name of base outputdir. JAB assumes the actual output dir is formed
|
||||
* // Name of base outputdir. JIB assumes the actual output dir is formed
|
||||
* // by adding the configuration name: <output_basedir>/<config-name>
|
||||
* output_basedir: "build",
|
||||
* // Configure argument to use to specify configuration name
|
||||
@ -177,7 +177,7 @@
|
||||
* @param input External data to use for generating the configuration
|
||||
* @returns {{}} Profile configuration
|
||||
*/
|
||||
var getJabProfiles = function (input) {
|
||||
var getJibProfiles = function (input) {
|
||||
|
||||
var data = {};
|
||||
|
||||
@ -187,7 +187,7 @@ var getJabProfiles = function (input) {
|
||||
// Organization is used when uploading/publishing build results
|
||||
data.organization = "com.oracle.jpg.jdk";
|
||||
|
||||
// The base directory for the build output. JAB will assume that the
|
||||
// The base directory for the build output. JIB will assume that the
|
||||
// actual build directory will be <output_basedir>/<configuration>
|
||||
data.output_basedir = "build";
|
||||
// The configure argument to use to specify the name of the configuration
|
||||
@ -196,11 +196,11 @@ var getJabProfiles = function (input) {
|
||||
data.configuration_make_arg = "CONF_NAME=";
|
||||
|
||||
// Define some common values
|
||||
var common = getJabProfilesCommon(input);
|
||||
var common = getJibProfilesCommon(input);
|
||||
// Generate the profiles part of the configuration
|
||||
data.profiles = getJabProfilesProfiles(input, common);
|
||||
data.profiles = getJibProfilesProfiles(input, common);
|
||||
// Generate the dependencies part of the configuration
|
||||
data.dependencies = getJabProfilesDependencies(input, common);
|
||||
data.dependencies = getJibProfilesDependencies(input, common);
|
||||
|
||||
return data;
|
||||
};
|
||||
@ -211,7 +211,7 @@ var getJabProfiles = function (input) {
|
||||
* @param input External data to use for generating the configuration
|
||||
* @returns Common values
|
||||
*/
|
||||
var getJabProfilesCommon = function (input) {
|
||||
var getJibProfilesCommon = function (input) {
|
||||
var common = {
|
||||
dependencies: ["boot_jdk", "gnumake", "jtreg"],
|
||||
configure_args: ["--with-default-make-target=all"],
|
||||
@ -230,7 +230,7 @@ var getJabProfilesCommon = function (input) {
|
||||
* @param common The common values
|
||||
* @returns {{}} Profiles part of the configuration
|
||||
*/
|
||||
var getJabProfilesProfiles = function (input, common) {
|
||||
var getJibProfilesProfiles = function (input, common) {
|
||||
var profiles = {};
|
||||
|
||||
// Main SE profiles
|
||||
@ -349,7 +349,7 @@ var getJabProfilesProfiles = function (input, common) {
|
||||
* @param common The common values
|
||||
* @returns {{}} Dependencies part of configuration
|
||||
*/
|
||||
var getJabProfilesDependencies = function (input, common) {
|
||||
var getJibProfilesDependencies = function (input, common) {
|
||||
|
||||
var boot_jdk_platform = input.build_os + "-"
|
||||
+ (input.build_cpu == "x86" ? "i586" : input.build_cpu);
|
Loading…
Reference in New Issue
Block a user