Skip to content

Commit

Permalink
8145185: Rename JAB the build tool to JIB
Browse files Browse the repository at this point in the history
Reviewed-by: ihse, tbell
  • Loading branch information
erikj committed Dec 11, 2015
1 parent 573adf3 commit 16e72e8
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 139 deletions.
2 changes: 1 addition & 1 deletion .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ nbproject/private/
^webrev
^.hgtip
^.bridge2
^.jab/
^.jib/
.DS_Store
.metadata/
.recommenders/
127 changes: 0 additions & 127 deletions common/bin/jab.sh

This file was deleted.

127 changes: 127 additions & 0 deletions common/bin/jib.sh
Original file line number Diff line number Diff line change
@@ -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} "$@"
22 changes: 11 additions & 11 deletions common/conf/jab-profiles.js → common/conf/jib-profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 = {};

Expand All @@ -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
Expand All @@ -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;
};
Expand All @@ -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"],
Expand 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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 16e72e8

Please sign in to comment.