Merge
This commit is contained in:
commit
12ace599a4
@ -417,4 +417,6 @@ ba5b16c9c6d80632b61959a33d424b1c3398ce62 jdk-9+166
|
||||
06373236a30801f72e2a31ee5c691c2a1e500f57 jdk-10+3
|
||||
8ec175c61fc3f58328a3324f07d7ded00e060be3 jdk-10+4
|
||||
111e2e7d00f45c983cdbc9c59ae40552152fcc23 jdk-10+5
|
||||
03fe61bb7670644cf6e46b5cfafb6b27c0e0157e jdk-10+6
|
||||
03fe61bb7670644cf6e46b5cfafb6b27c0e0157e jdk-10+6
|
||||
b25838a28195f4b6dab34668411eedd2d366a16c jdk-9+169
|
||||
|
||||
|
@ -318,7 +318,7 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
|
||||
AC_SUBST(JAVAC_FLAGS)
|
||||
|
||||
# Check if the boot jdk is 32 or 64 bit
|
||||
if "$JAVA" -d64 -version > /dev/null 2>&1; then
|
||||
if "$JAVA" -version 2>&1 | $GREP -q "64-Bit"; then
|
||||
BOOT_JDK_BITS="64"
|
||||
else
|
||||
BOOT_JDK_BITS="32"
|
||||
|
@ -1,5 +1,28 @@
|
||||
#!/bin/sh
|
||||
echo >&2 "No suitable 'install' command found.'"
|
||||
echo >&2 "If automake is installed, running 'automake -fa'"
|
||||
echo >&2 "(and ignoring the errors) might produce one."
|
||||
exit 1
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2017, 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. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# 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 file is empty on purpose. It's a placeholder which is required by
|
||||
# autoconf, but it serves no purpose for us.
|
||||
|
@ -417,10 +417,8 @@ AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC],
|
||||
AC_SUBST(SJAVAC_SERVER_JAVA)
|
||||
|
||||
if test "$MEMORY_SIZE" -gt "3000"; then
|
||||
ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA_FLAGS,[$SJAVAC_SERVER_JAVA])
|
||||
if test "$JVM_ARG_OK" = true; then
|
||||
if "$JAVA" -version 2>&1 | $GREP -q "64-Bit"; then
|
||||
JVM_64BIT=true
|
||||
JVM_ARG_OK=false
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -996,8 +996,9 @@ OPENJDK_TARGET_CPU_OSARCH
|
||||
OPENJDK_TARGET_CPU_ISADIR
|
||||
OPENJDK_TARGET_CPU_LEGACY_LIB
|
||||
OPENJDK_TARGET_CPU_LEGACY
|
||||
OPENJDK_MODULE_TARGET_OS_ARCH
|
||||
OPENJDK_MODULE_TARGET_OS_NAME
|
||||
RELEASE_FILE_OS_ARCH
|
||||
RELEASE_FILE_OS_NAME
|
||||
OPENJDK_MODULE_TARGET_PLATFORM
|
||||
COMPILE_TYPE
|
||||
OPENJDK_TARGET_CPU_ENDIAN
|
||||
OPENJDK_TARGET_CPU_BITS
|
||||
@ -4900,6 +4901,8 @@ VALID_JVM_VARIANTS="server client minimal core zero zeroshark custom"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#%%% Build and target systems %%%
|
||||
|
||||
|
||||
@ -5183,7 +5186,7 @@ VS_SDK_PLATFORM_NAME_2013=
|
||||
#CUSTOM_AUTOCONF_INCLUDE
|
||||
|
||||
# Do not change or remove the following line, it is needed for consistency checks:
|
||||
DATE_WHEN_GENERATED=1492975963
|
||||
DATE_WHEN_GENERATED=1494615666
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
@ -16043,6 +16046,27 @@ $as_echo "$COMPILE_TYPE" >&6; }
|
||||
OPENJDK_MODULE_TARGET_OS_ARCH="$OPENJDK_TARGET_CPU"
|
||||
fi
|
||||
|
||||
OPENJDK_MODULE_TARGET_PLATFORM="${OPENJDK_MODULE_TARGET_OS_NAME}-${OPENJDK_MODULE_TARGET_OS_ARCH}"
|
||||
|
||||
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
|
||||
RELEASE_FILE_OS_NAME=SunOS
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = "xlinux"; then
|
||||
RELEASE_FILE_OS_NAME=Linux
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||
RELEASE_FILE_OS_NAME=Windows
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
RELEASE_FILE_OS_NAME="Darwin"
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = "xaix"; then
|
||||
RELEASE_FILE_OS_NAME="AIX"
|
||||
fi
|
||||
RELEASE_FILE_OS_ARCH=${OPENJDK_TARGET_CPU}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -31392,7 +31416,7 @@ $as_echo "no" >&6; }
|
||||
|
||||
|
||||
# Check if the boot jdk is 32 or 64 bit
|
||||
if "$JAVA" -d64 -version > /dev/null 2>&1; then
|
||||
if "$JAVA" -version 2>&1 | $GREP -q "64-Bit"; then
|
||||
BOOT_JDK_BITS="64"
|
||||
else
|
||||
BOOT_JDK_BITS="32"
|
||||
@ -65910,24 +65934,8 @@ fi
|
||||
|
||||
|
||||
if test "$MEMORY_SIZE" -gt "3000"; then
|
||||
|
||||
$ECHO "Check if jvm arg is ok: -d64" >&5
|
||||
$ECHO "Command: $SJAVAC_SERVER_JAVA -d64 -version" >&5
|
||||
OUTPUT=`$SJAVAC_SERVER_JAVA -d64 -version 2>&1`
|
||||
FOUND_WARN=`$ECHO "$OUTPUT" | $GREP -i warn`
|
||||
FOUND_VERSION=`$ECHO $OUTPUT | $GREP " version \""`
|
||||
if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
|
||||
SJAVAC_SERVER_JAVA_FLAGS="$SJAVAC_SERVER_JAVA_FLAGS -d64"
|
||||
JVM_ARG_OK=true
|
||||
else
|
||||
$ECHO "Arg failed:" >&5
|
||||
$ECHO "$OUTPUT" >&5
|
||||
JVM_ARG_OK=false
|
||||
fi
|
||||
|
||||
if test "$JVM_ARG_OK" = true; then
|
||||
if "$JAVA" -version 2>&1 | $GREP -q "64-Bit"; then
|
||||
JVM_64BIT=true
|
||||
JVM_ARG_OK=false
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -433,6 +433,29 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES],
|
||||
[
|
||||
if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
|
||||
RELEASE_FILE_OS_NAME=SunOS
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = "xlinux"; then
|
||||
RELEASE_FILE_OS_NAME=Linux
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||
RELEASE_FILE_OS_NAME=Windows
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
RELEASE_FILE_OS_NAME="Darwin"
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = "xaix"; then
|
||||
RELEASE_FILE_OS_NAME="AIX"
|
||||
fi
|
||||
RELEASE_FILE_OS_ARCH=${OPENJDK_TARGET_CPU}
|
||||
|
||||
AC_SUBST(RELEASE_FILE_OS_NAME)
|
||||
AC_SUBST(RELEASE_FILE_OS_ARCH)
|
||||
])
|
||||
|
||||
AC_DEFUN([PLATFORM_SET_MODULE_TARGET_OS_VALUES],
|
||||
[
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
@ -447,8 +470,8 @@ AC_DEFUN([PLATFORM_SET_MODULE_TARGET_OS_VALUES],
|
||||
OPENJDK_MODULE_TARGET_OS_ARCH="$OPENJDK_TARGET_CPU"
|
||||
fi
|
||||
|
||||
AC_SUBST(OPENJDK_MODULE_TARGET_OS_NAME)
|
||||
AC_SUBST(OPENJDK_MODULE_TARGET_OS_ARCH)
|
||||
OPENJDK_MODULE_TARGET_PLATFORM="${OPENJDK_MODULE_TARGET_OS_NAME}-${OPENJDK_MODULE_TARGET_OS_ARCH}"
|
||||
AC_SUBST(OPENJDK_MODULE_TARGET_PLATFORM)
|
||||
])
|
||||
|
||||
#%%% Build and target systems %%%
|
||||
@ -466,6 +489,7 @@ AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET],
|
||||
PLATFORM_EXTRACT_TARGET_AND_BUILD
|
||||
PLATFORM_SETUP_TARGET_CPU_BITS
|
||||
PLATFORM_SET_MODULE_TARGET_OS_VALUES
|
||||
PLATFORM_SET_RELEASE_FILE_OS_VALUES
|
||||
PLATFORM_SETUP_LEGACY_VARS
|
||||
])
|
||||
|
||||
|
@ -101,9 +101,12 @@ OPENJDK_BUILD_CPU_ARCH:=@OPENJDK_BUILD_CPU_ARCH@
|
||||
OPENJDK_BUILD_CPU_BITS:=@OPENJDK_BUILD_CPU_BITS@
|
||||
OPENJDK_BUILD_CPU_ENDIAN:=@OPENJDK_BUILD_CPU_ENDIAN@
|
||||
|
||||
# OS values for use in ModuleTarget class file attribute.
|
||||
OPENJDK_MODULE_TARGET_OS_NAME:=@OPENJDK_MODULE_TARGET_OS_NAME@
|
||||
OPENJDK_MODULE_TARGET_OS_ARCH:=@OPENJDK_MODULE_TARGET_OS_ARCH@
|
||||
# Target platform value in ModuleTarget class file attribute.
|
||||
OPENJDK_MODULE_TARGET_PLATFORM:=@OPENJDK_MODULE_TARGET_PLATFORM@
|
||||
|
||||
# OS_* properties in release file
|
||||
RELEASE_FILE_OS_NAME:=@RELEASE_FILE_OS_NAME@
|
||||
RELEASE_FILE_OS_ARCH:=@RELEASE_FILE_OS_ARCH@
|
||||
|
||||
LIBM:=@LIBM@
|
||||
LIBDL:=@LIBDL@
|
||||
|
@ -239,11 +239,8 @@ var getJibProfilesCommon = function (input, data) {
|
||||
common.main_profile_base = {
|
||||
dependencies: ["boot_jdk", "gnumake", "jtreg"],
|
||||
default_make_targets: ["product-bundles", "test-bundles"],
|
||||
configure_args: [
|
||||
"--with-version-opt=" + common.build_id,
|
||||
"--enable-jtreg-failure-handler",
|
||||
"--with-version-build=" + common.build_number
|
||||
]
|
||||
configure_args: concat(["--enable-jtreg-failure-handler"],
|
||||
versionArgs(input, common))
|
||||
};
|
||||
// Extra settings for debug profiles
|
||||
common.debug_suffix = "-debug";
|
||||
@ -269,10 +266,12 @@ var getJibProfilesCommon = function (input, data) {
|
||||
|
||||
/**
|
||||
* Define common artifacts template for all main profiles
|
||||
* @param pf - Name of platform in bundle names
|
||||
* @param demo_ext - Type of extension for demo bundle
|
||||
* @param o - Object containing data for artifacts
|
||||
*/
|
||||
common.main_profile_artifacts = function (pf, demo_ext) {
|
||||
common.main_profile_artifacts = function (o) {
|
||||
var jdk_subdir = (o.jdk_subdir != null ? o.jdk_subdir : "jdk-" + data.version);
|
||||
var jre_subdir = (o.jre_subdir != null ? o.jre_subdir : "jre-" + data.version);
|
||||
var pf = o.platform
|
||||
return {
|
||||
artifacts: {
|
||||
jdk: {
|
||||
@ -281,7 +280,7 @@ var getJibProfilesCommon = function (input, data) {
|
||||
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin.tar.gz",
|
||||
"bundles/" + pf + "/\\1"
|
||||
],
|
||||
subdir: "jdk-" + data.version,
|
||||
subdir: jdk_subdir,
|
||||
exploded: "images/jdk"
|
||||
},
|
||||
jre: {
|
||||
@ -290,7 +289,7 @@ var getJibProfilesCommon = function (input, data) {
|
||||
"bundles/" + pf + "/jre-" + data.version + "_" + pf + "_bin.tar.gz",
|
||||
"bundles/" + pf + "/\\1"
|
||||
],
|
||||
subdir: "jre-" + data.version,
|
||||
subdir: jre_subdir,
|
||||
exploded: "images/jre"
|
||||
},
|
||||
test: {
|
||||
@ -307,7 +306,7 @@ var getJibProfilesCommon = function (input, data) {
|
||||
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-symbols.tar.gz",
|
||||
"bundles/" + pf + "/\\1"
|
||||
],
|
||||
subdir: "jdk-" + data.version,
|
||||
subdir: jdk_subdir,
|
||||
exploded: "images/jdk"
|
||||
},
|
||||
jre_symbols: {
|
||||
@ -316,15 +315,8 @@ var getJibProfilesCommon = function (input, data) {
|
||||
"bundles/" + pf + "/jre-" + data.version + "_" + pf + "_bin-symbols.tar.gz",
|
||||
"bundles/" + pf + "/\\1"
|
||||
],
|
||||
subdir: "jre-" + data.version,
|
||||
subdir: jre_subdir,
|
||||
exploded: "images/jre"
|
||||
},
|
||||
demo: {
|
||||
local: "bundles/\\(jdk.*demo." + demo_ext + "\\)",
|
||||
remote: [
|
||||
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_demo." + demo_ext,
|
||||
"bundles/" + pf + "/\\1"
|
||||
],
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -333,9 +325,12 @@ var getJibProfilesCommon = function (input, data) {
|
||||
|
||||
/**
|
||||
* Define common artifacts template for all debug profiles
|
||||
* @param pf - Name of platform in bundle names
|
||||
* @param o - Object containing data for artifacts
|
||||
*/
|
||||
common.debug_profile_artifacts = function (pf) {
|
||||
common.debug_profile_artifacts = function (o) {
|
||||
var jdk_subdir = "jdk-" + data.version + "/fastdebug";
|
||||
var jre_subdir = "jre-" + data.version + "/fastdebug";
|
||||
var pf = o.platform
|
||||
return {
|
||||
artifacts: {
|
||||
jdk: {
|
||||
@ -344,7 +339,7 @@ var getJibProfilesCommon = function (input, data) {
|
||||
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-debug.tar.gz",
|
||||
"bundles/" + pf + "/\\1"
|
||||
],
|
||||
subdir: "jdk-" + data.version,
|
||||
subdir: jdk_subdir,
|
||||
exploded: "images/jdk"
|
||||
},
|
||||
jre: {
|
||||
@ -353,7 +348,7 @@ var getJibProfilesCommon = function (input, data) {
|
||||
"bundles/" + pf + "/jre-" + data.version + "_" + pf + "_bin-debug.tar.gz",
|
||||
"bundles/" + pf + "/\\1"
|
||||
],
|
||||
subdir: "jre-" + data.version,
|
||||
subdir: jre_subdir,
|
||||
exploded: "images/jre"
|
||||
},
|
||||
test: {
|
||||
@ -370,7 +365,7 @@ var getJibProfilesCommon = function (input, data) {
|
||||
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-debug-symbols.tar.gz",
|
||||
"bundles/" + pf + "/\\1"
|
||||
],
|
||||
subdir: "jdk-" + data.version,
|
||||
subdir: jdk_subdir,
|
||||
exploded: "images/jdk"
|
||||
},
|
||||
jre_symbols: {
|
||||
@ -379,7 +374,7 @@ var getJibProfilesCommon = function (input, data) {
|
||||
"bundles/" + pf + "/jre-" + data.version + "_" + pf + "_bin-debug-symbols.tar.gz",
|
||||
"bundles/" + pf + "/\\1"
|
||||
],
|
||||
subdir: "jre-" + data.version,
|
||||
subdir: jre_subdir,
|
||||
exploded: "images/jre"
|
||||
}
|
||||
}
|
||||
@ -665,61 +660,53 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
//
|
||||
// Define artifacts for profiles
|
||||
//
|
||||
// Macosx bundles are named osx and Windows demo bundles use zip instead of
|
||||
// Macosx bundles are named osx
|
||||
// tar.gz.
|
||||
var artifactData = {
|
||||
"linux-x64": {
|
||||
platform: "linux-x64",
|
||||
demo_ext: "tar.gz"
|
||||
},
|
||||
"linux-x86": {
|
||||
platform: "linux-x86",
|
||||
demo_ext: "tar.gz"
|
||||
},
|
||||
"macosx-x64": {
|
||||
platform: "osx-x64",
|
||||
demo_ext: "tar.gz"
|
||||
jdk_subdir: "jdk-" + data.version + ".jdk/Contents/Home",
|
||||
jre_subdir: "jre-" + data.version + ".jre/Contents/Home"
|
||||
},
|
||||
"solaris-x64": {
|
||||
platform: "solaris-x64",
|
||||
demo_ext: "tar.gz"
|
||||
},
|
||||
"solaris-sparcv9": {
|
||||
platform: "solaris-sparcv9",
|
||||
demo_ext: "tar.gz"
|
||||
},
|
||||
"windows-x64": {
|
||||
platform: "windows-x64",
|
||||
demo_ext: "zip"
|
||||
},
|
||||
"windows-x86": {
|
||||
platform: "windows-x86",
|
||||
demo_ext: "zip"
|
||||
},
|
||||
"linux-arm64": {
|
||||
platform: "linux-arm64-vfp-hflt",
|
||||
demo_ext: "tar.gz"
|
||||
},
|
||||
"linux-arm-vfp-hflt": {
|
||||
platform: "linux-arm32-vfp-hflt",
|
||||
demo_ext: "tar.gz"
|
||||
},
|
||||
"linux-arm-vfp-hflt-dyn": {
|
||||
platform: "linux-arm32-vfp-hflt-dyn",
|
||||
demo_ext: "tar.gz"
|
||||
}
|
||||
}
|
||||
// Generate common artifacts for all main profiles
|
||||
Object.keys(artifactData).forEach(function (name) {
|
||||
profiles[name] = concatObjects(profiles[name],
|
||||
common.main_profile_artifacts(artifactData[name].platform, artifactData[name].demo_ext));
|
||||
common.main_profile_artifacts(artifactData[name]));
|
||||
});
|
||||
|
||||
// Generate common artifacts for all debug profiles
|
||||
Object.keys(artifactData).forEach(function (name) {
|
||||
var debugName = name + common.debug_suffix;
|
||||
profiles[debugName] = concatObjects(profiles[debugName],
|
||||
common.debug_profile_artifacts(artifactData[name].platform));
|
||||
common.debug_profile_artifacts(artifactData[name]));
|
||||
});
|
||||
|
||||
// Extra profile specific artifacts
|
||||
@ -740,7 +727,12 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
artifacts: {
|
||||
jdk: {
|
||||
local: "bundles/\\(jdk.*bin.tar.gz\\)",
|
||||
remote: "bundles/openjdk/GPL/linux-x64/\\1",
|
||||
remote: [
|
||||
"bundles/openjdk/GPL/linux-x64/jdk-" + data.version
|
||||
+ "_linux-x64_bin.tar.gz",
|
||||
"bundles/openjdk/GPL/linux-x64/\\1"
|
||||
],
|
||||
subdir: "jdk-" + data.version
|
||||
},
|
||||
jre: {
|
||||
local: "bundles/\\(jre.*bin.tar.gz\\)",
|
||||
@ -748,20 +740,25 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
},
|
||||
test: {
|
||||
local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
|
||||
remote: "bundles/openjdk/GPL/linux-x64/\\1",
|
||||
remote: [
|
||||
"bundles/openjdk/GPL/linux-x64/jdk-" + data.version
|
||||
+ "_linux-x64_bin-tests.tar.gz",
|
||||
"bundles/openjdk/GPL/linux-x64/\\1"
|
||||
]
|
||||
},
|
||||
jdk_symbols: {
|
||||
local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
|
||||
remote: "bundles/openjdk/GPL/linux-x64/\\1",
|
||||
remote: [
|
||||
"bundles/openjdk/GPL/linux-x64/jdk-" + data.version
|
||||
+ "_linux-x64_bin-symbols.tar.gz",
|
||||
"bundles/openjdk/GPL/linux-x64/\\1"
|
||||
],
|
||||
subdir: "jdk-" + data.version
|
||||
},
|
||||
jre_symbols: {
|
||||
local: "bundles/\\(jre.*bin-symbols.tar.gz\\)",
|
||||
remote: "bundles/openjdk/GPL/linux-x64/\\1",
|
||||
},
|
||||
demo: {
|
||||
local: "bundles/\\(jdk.*demo.tar.gz\\)",
|
||||
remote: "bundles/openjdk/GPL/linux-x64/\\1",
|
||||
},
|
||||
doc_api_spec: {
|
||||
local: "bundles/\\(jdk.*doc-api-spec.tar.gz\\)",
|
||||
remote: "bundles/openjdk/GPL/linux-x64/\\1",
|
||||
@ -773,11 +770,29 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
artifacts: {
|
||||
jdk: {
|
||||
local: "bundles/\\(jdk.*bin.tar.gz\\)",
|
||||
remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
|
||||
remote: [
|
||||
"bundles/openjdk/GPL/linux-x86/jdk-" + data.version
|
||||
+ "_linux-x86_bin.tar.gz",
|
||||
"bundles/openjdk/GPL/linux-x86/\\1"
|
||||
],
|
||||
subdir: "jdk-" + data.version
|
||||
},
|
||||
jdk_symbols: {
|
||||
local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
|
||||
remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
|
||||
remote: [
|
||||
"bundles/openjdk/GPL/linux-x86/jdk-" + data.version
|
||||
+ "_linux-x86_bin-symbols.tar.gz",
|
||||
"bundles/openjdk/GPL/linux-x86/\\1"
|
||||
],
|
||||
subdir: "jdk-" + data.version
|
||||
},
|
||||
test: {
|
||||
local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
|
||||
remote: [
|
||||
"bundles/openjdk/GPL/linux-x86/jdk-" + data.version
|
||||
+ "_linux-x86_bin-tests.tar.gz",
|
||||
"bundles/openjdk/GPL/linux-x86/\\1"
|
||||
]
|
||||
},
|
||||
jre: {
|
||||
// This regexp needs to not match the compact* files below
|
||||
@ -803,7 +818,12 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
artifacts: {
|
||||
jdk: {
|
||||
local: "bundles/\\(jdk.*bin.tar.gz\\)",
|
||||
remote: "bundles/openjdk/GPL/windows-x86/\\1",
|
||||
remote: [
|
||||
"bundles/openjdk/GPL/windows-x86/jdk-" + data.version
|
||||
+ "_windows-x86_bin.tar.gz",
|
||||
"bundles/openjdk/GPL/windows-x86/\\1"
|
||||
],
|
||||
subdir: "jdk-" + data.version
|
||||
},
|
||||
jre: {
|
||||
local: "bundles/\\(jre.*bin.tar.gz\\)",
|
||||
@ -811,19 +831,24 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
},
|
||||
test: {
|
||||
local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
|
||||
remote: "bundles/openjdk/GPL/windows-x86/\\1",
|
||||
remote: [
|
||||
"bundles/openjdk/GPL/windows-x86/jdk-" + data.version
|
||||
+ "_windows-x86_bin-tests.tar.gz",
|
||||
"bundles/openjdk/GPL/windows-x86/\\1"
|
||||
]
|
||||
},
|
||||
jdk_symbols: {
|
||||
local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
|
||||
remote: "bundles/openjdk/GPL/windows-x86/\\1"
|
||||
remote: [
|
||||
"bundles/openjdk/GPL/windows-x86/jdk-" + data.version
|
||||
+ "_windows-x86_bin-symbols.tar.gz",
|
||||
"bundles/openjdk/GPL/windows-x86/\\1"
|
||||
],
|
||||
subdir: "jdk-" + data.version
|
||||
},
|
||||
jre_symbols: {
|
||||
local: "bundles/\\(jre.*bin-symbols.tar.gz\\)",
|
||||
remote: "bundles/openjdk/GPL/windows-x86/\\1",
|
||||
},
|
||||
demo: {
|
||||
local: "bundles/\\(jdk.*demo.zip\\)",
|
||||
remote: "bundles/openjdk/GPL/windows-x86/\\1",
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -1154,6 +1179,23 @@ var getVersion = function (major, minor, security, patch) {
|
||||
return version;
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructs the common version configure args based on build type and
|
||||
* other version inputs
|
||||
*/
|
||||
var versionArgs = function(input, common) {
|
||||
var args = ["--with-version-build=" + common.build_number];
|
||||
if (input.build_type == "promoted") {
|
||||
args = concat(args,
|
||||
// This needs to be changed when we start building release candidates
|
||||
"--with-version-pre=ea",
|
||||
"--without-version-opt");
|
||||
} else {
|
||||
args = concat(args, "--with-version-opt=" + common.build_id);
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
// Properties representation of the common/autoconf/version-numbers file. Lazily
|
||||
// initiated by the function below.
|
||||
var version_numbers;
|
||||
|
@ -199,9 +199,8 @@ Additional options to the Gtest test framework.
|
||||
Use `GTEST="OPTIONS=--help"` to see all available Gtest options.
|
||||
|
||||
---
|
||||
# Override some definitions in http://openjdk.java.net/page.css that are
|
||||
# unsuitable for this document.
|
||||
# Override some definitions in the global css file that are not optimal for
|
||||
# this document.
|
||||
header-includes:
|
||||
- '<style type="text/css">pre, code, tt { color: #1d6ae5; }</style>'
|
||||
- '<style type="text/css">pre { font-size: 10pt; }</style>'
|
||||
---
|
||||
|
@ -135,8 +135,7 @@ $(JMODS_DIR)/$(MODULE).jmod: $(DEPS)
|
||||
$(RM) $@ $(JMODS_TEMPDIR)/$(notdir $@)
|
||||
$(JMOD) create \
|
||||
--module-version $(VERSION_SHORT) \
|
||||
--os-name '$(OPENJDK_MODULE_TARGET_OS_NAME)' \
|
||||
--os-arch '$(OPENJDK_MODULE_TARGET_OS_ARCH)' \
|
||||
--target-platform '$(OPENJDK_MODULE_TARGET_PLATFORM)' \
|
||||
--module-path $(JMODS_DIR) \
|
||||
--exclude '**{_the.*,_*.marker,*.diz,*.debuginfo,*.dSYM/**,*.dSYM,*.pdb,*.map}' \
|
||||
$(JMOD_FLAGS) $(JMODS_TEMPDIR)/$(notdir $@)
|
||||
|
@ -27,6 +27,7 @@ default: all
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include Modules.gmk
|
||||
include ProcessMarkdown.gmk
|
||||
include ZipArchive.gmk
|
||||
include $(JDK_TOPDIR)/make/Tools.gmk
|
||||
include $(JDK_TOPDIR)/make/ModuleTools.gmk
|
||||
@ -51,9 +52,12 @@ MODULES_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) \
|
||||
DOCROOTPARENT_FLAG ?= TRUE
|
||||
|
||||
# URLs
|
||||
JAVADOC_BASE_URL := http://docs.oracle.com/javase/$(VERSION_SPECIFICATION)/docs
|
||||
JAVADOC_BASE_URL := http://www.oracle.com/pls/topic/lookup?ctx=javase9&id=homepage
|
||||
BUG_SUBMIT_URL := http://bugreport.java.com/bugreport/
|
||||
COPYRIGHT_URL := {@docroot}/../legal/cpyr.html
|
||||
LICENSE_URL := http://www.oracle.com/technetwork/java/javase/terms/license/java9speclicense.html
|
||||
REDISTRIBUTION_URL := http://www.oracle.com/technetwork/java/redist-137594.html
|
||||
|
||||
|
||||
# In order to get a specific ordering it's necessary to specify the total
|
||||
# ordering of tags as the tags are otherwise ordered in order of definition.
|
||||
@ -134,7 +138,10 @@ JAVADOC_BOTTOM := \
|
||||
the US and other countries.<br> \
|
||||
<a href="$(COPYRIGHT_URL)">Copyright</a> \
|
||||
© 1993, $(COPYRIGHT_YEAR), $(FULL_COMPANY_NAME). \
|
||||
$(COMPANY_ADDRESS). All rights reserved.$(DRAFT_MARKER_STR)</span>
|
||||
$(COMPANY_ADDRESS). All rights reserved. \
|
||||
Use is subject to <a href="$(LICENSE_URL)">license terms</a>. Also see the \
|
||||
<a href="$(REDISTRIBUTION_URL)">documentation redistribution policy</a>. \
|
||||
$(DRAFT_MARKER_STR)</span>
|
||||
|
||||
JAVADOC_TOP := \
|
||||
<div style="background-color: $(HASH)EEEEEE"><div style="padding: 6px; \
|
||||
@ -356,7 +363,7 @@ $(eval $(call SetupApiDocsGeneration, JAVASE_API, \
|
||||
# unmodified
|
||||
|
||||
ALL_MODULES := $(call FindAllModules)
|
||||
COPY_SPEC_FILTER := %.html %.gif %.jpg %.mib
|
||||
COPY_SPEC_FILTER := %.html %.gif %.jpg %.mib %.css
|
||||
|
||||
$(foreach m, $(ALL_MODULES), \
|
||||
$(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
|
||||
@ -370,36 +377,35 @@ $(foreach m, $(ALL_MODULES), \
|
||||
) \
|
||||
)
|
||||
|
||||
# Copy the global resources
|
||||
GLOBAL_SPECS_RESOURCES_DIR := $(JDK_TOPDIR)/make/data/docs-resources/specs
|
||||
$(eval $(call SetupCopyFiles, COPY_GLOBAL_RESOURCES, \
|
||||
SRC := $(GLOBAL_SPECS_RESOURCES_DIR), \
|
||||
FILES := $(call CacheFind, $(GLOBAL_SPECS_RESOURCES_DIR)), \
|
||||
DEST := $(JAVADOC_OUTPUTDIR)/specs/, \
|
||||
))
|
||||
JDK_SPECS_TARGETS += $(COPY_GLOBAL_RESOURCES)
|
||||
|
||||
ifeq ($(ENABLE_FULL_DOCS), true)
|
||||
# For all markdown files in $module/share/specs directories, convert them to
|
||||
# html.
|
||||
MARKDOWN_SPEC_FILTER := %.md
|
||||
|
||||
# Macro for SetupCopyFiles that converts from markdown to html using pandoc.
|
||||
define markdown-to-html
|
||||
$(call MakeDir, $(@D))
|
||||
$(RM) $@
|
||||
$(PANDOC) -t html -s -o $@ $<
|
||||
endef
|
||||
|
||||
rename-md-to-html = \
|
||||
$(patsubst %.md,%.html,$1)
|
||||
GLOBAL_SPECS_DEFAULT_CSS_FILE := $(JAVADOC_OUTPUTDIR)/specs/resources/jdk-default.css
|
||||
|
||||
$(foreach m, $(ALL_MODULES), \
|
||||
$(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
|
||||
$(if $(SPECS_$m), \
|
||||
$(eval $(call SetupCopyFiles, CONVERT_MARKDOWN_$m, \
|
||||
SRC := $(SPECS_$m), \
|
||||
FILES := $(filter $(MARKDOWN_SPEC_FILTER), $(call CacheFind, $(SPECS_$m))), \
|
||||
DEST := $(JAVADOC_OUTPUTDIR)/specs/, \
|
||||
MACRO := markdown-to-html, \
|
||||
NAME_MACRO := rename-md-to-html, \
|
||||
LOG_ACTION := Converting from markdown, \
|
||||
)) \
|
||||
$(eval JDK_SPECS_TARGETS += $(CONVERT_MARKDOWN_$m)) \
|
||||
$(foreach d, $(SPECS_$m), \
|
||||
$(if $(filter %.md, $(call CacheFind, $d)), \
|
||||
$(eval $(call SetupProcessMarkdown, CONVERT_MARKDOWN_$m_$(patsubst $(TOPDIR)/%,%,$d), \
|
||||
SRC := $d, \
|
||||
FILES := $(filter %.md, $(call CacheFind, $d)), \
|
||||
DEST := $(JAVADOC_OUTPUTDIR)/specs/, \
|
||||
CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
|
||||
)) \
|
||||
) \
|
||||
$(eval JDK_SPECS_TARGETS += $(CONVERT_MARKDOWN_$m_$(patsubst $(TOPDIR)/%,%,$d))) \
|
||||
) \
|
||||
)
|
||||
|
||||
endif
|
||||
|
||||
# Special treatment for generated documentation
|
||||
|
@ -48,6 +48,8 @@ define create-info-file
|
||||
$(call info-file-item, "SUN_ARCH_ABI", "$(JDK_ARCH_ABI_PROP_NAME)"))
|
||||
$(call info-file-item, "SOURCE", "$(strip $(SOURCE_REVISION))")
|
||||
$(call info-file-item, "IMPLEMENTOR", "$(COMPANY_NAME)")
|
||||
$(call info-file-item, "OS_NAME", "$(RELEASE_FILE_OS_NAME)")
|
||||
$(call info-file-item, "OS_ARCH", "$(RELEASE_FILE_OS_ARCH)")
|
||||
endef
|
||||
|
||||
# Param 1 - The file containing the MODULES list
|
||||
|
@ -27,6 +27,7 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include ProcessMarkdown.gmk
|
||||
|
||||
################################################################################
|
||||
# This makefile updates the generated build html documentation.
|
||||
@ -38,62 +39,26 @@ ifeq ($(PANDOC), )
|
||||
$(error Cannot continue)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Setup make rules for converting a markdown file to html.
|
||||
#
|
||||
# Parameter 1 is the name of the rule. This name is used as variable prefix,
|
||||
# and the targets generated are listed in a variable by that name.
|
||||
#
|
||||
# Remaining parameters are named arguments. These include:
|
||||
# SOURCE_FILE The markdown source file
|
||||
# TARGET_DIR The directory where to store the generated html file
|
||||
# OPTIONS Additional options to pandoc
|
||||
#
|
||||
SetupMarkdownToHtml = $(NamedParamsMacroTemplate)
|
||||
define SetupMarkdownToHtmlBody
|
||||
ifeq ($$($1_SOURCE_FILE), )
|
||||
$$(error SOURCE_FILE is missing in SetupMarkdownToHtml $1)
|
||||
endif
|
||||
|
||||
ifeq ($$($1_TARGET_DIR), )
|
||||
$$(error TARGET_DIR is missing in SetupMarkdownToHtml $1)
|
||||
endif
|
||||
|
||||
$1_BASENAME := $$(notdir $$(basename $$($1_SOURCE_FILE)))
|
||||
$1_OUTPUT_FILE := $$($1_TARGET_DIR)/$$($1_BASENAME).html
|
||||
|
||||
$$($1_OUTPUT_FILE): $$($1_SOURCE_FILE)
|
||||
$$(call LogInfo, Converting $$(notdir $1) to html)
|
||||
$$(call MakeDir, $$($1_TARGET_DIR) $$(MAKESUPPORT_OUTPUTDIR)/markdown)
|
||||
$$(call ExecuteWithLog, $$(MAKESUPPORT_OUTPUTDIR)/markdown/$1, \
|
||||
$$(PANDOC) $$($1_OPTIONS) -f markdown -t html --standalone \
|
||||
--css 'http://openjdk.java.net/page.css' '$$<' -o '$$@')
|
||||
TOO_LONG_LINES=`$$(GREP) -E -e '^.{80}.+$$$$' $$<` || true ; \
|
||||
if [ "x$$$$TOO_LONG_LINES" != x ]; then \
|
||||
$$(ECHO) "Warning: Unsuitable markdown in $$<:" ; \
|
||||
$$(ECHO) "The following lines are longer than 80 characters:" ; \
|
||||
$$(GREP) -E -n -e '^.{80}.+$$$$' $$< || true ; \
|
||||
fi
|
||||
|
||||
$1 := $$($1_OUTPUT_FILE)
|
||||
|
||||
TARGETS += $$($1)
|
||||
endef
|
||||
GLOBAL_SPECS_DEFAULT_CSS_FILE := $(JDK_TOPDIR)/make/data/docs-resources/specs/resources/jdk-default.css
|
||||
|
||||
################################################################################
|
||||
|
||||
DOCS_DIR := $(TOPDIR)/common/doc
|
||||
|
||||
$(eval $(call SetupMarkdownToHtml, building, \
|
||||
SOURCE_FILE := $(DOCS_DIR)/building.md, \
|
||||
TARGET_DIR := $(DOCS_DIR), \
|
||||
$(eval $(call SetupProcessMarkdown, building, \
|
||||
FILES := $(DOCS_DIR)/building.md, \
|
||||
DEST := $(DOCS_DIR), \
|
||||
CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
|
||||
))
|
||||
TARGETS += $(building)
|
||||
|
||||
$(eval $(call SetupMarkdownToHtml, testing, \
|
||||
SOURCE_FILE := $(DOCS_DIR)/testing.md, \
|
||||
TARGET_DIR := $(DOCS_DIR), \
|
||||
$(eval $(call SetupProcessMarkdown, testing, \
|
||||
FILES := $(DOCS_DIR)/testing.md, \
|
||||
DEST := $(DOCS_DIR), \
|
||||
CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
|
||||
OPTIONS := --toc, \
|
||||
))
|
||||
TARGETS += $(testing)
|
||||
|
||||
################################################################################
|
||||
|
||||
|
103
make/common/ProcessMarkdown.gmk
Normal file
103
make/common/ProcessMarkdown.gmk
Normal file
@ -0,0 +1,103 @@
|
||||
# Copyright (c) 2017, 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. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
ifeq (,$(_MAKEBASE_GMK))
|
||||
$(error You must include MakeBase.gmk prior to including ProcessMarkdown.gmk)
|
||||
endif
|
||||
|
||||
# Helper function for SetupProcessMarkdown
|
||||
# $1: The $1 from SetupProcessMarkdown
|
||||
# $2: The name of the current source file, relative to $1_SRC
|
||||
define ProcessMarkdown
|
||||
$1_$2_OUTPUT_FILE := $$($1_DEST)/$$(basename $2).html
|
||||
$1_$2_TARGET_DIR := $$(dir $$($1_$2_OUTPUT_FILE))
|
||||
ifneq ($$($1_CSS), )
|
||||
ifneq ($$(findstring http:/, $$($1_CSS)), )
|
||||
$1_$2_CSS_OPTION := --css '$$($1_CSS)'
|
||||
else
|
||||
$1_$2_CSS := $$(call RelativePath, $$($1_CSS), $$($1_$2_TARGET_DIR))
|
||||
$1_$2_CSS_OPTION := --css '$$($1_$2_CSS)'
|
||||
endif
|
||||
endif
|
||||
$1_$2_OPTIONS = $$(shell $$(GREP) _pandoc-options_: $$($1_SRC)/$2 | $$(CUT) -d : -f 2-)
|
||||
$1_$2_MARKER := $$(subst /,_,$1_$2)
|
||||
|
||||
$1_$2_VARDEPS := $$($1_OPTIONS) $$($1_CSS)
|
||||
$1_$2_VARDEPS_FILE := $$(call DependOnVariable, $1_$2_VARDEPS, \
|
||||
$$(SUPPORT_OUTPUTDIR)/markdown/$$($1_$2_MARKER).vardeps)
|
||||
|
||||
$$($1_$2_OUTPUT_FILE): $$($1_SRC)/$2 $$($1_$2_VARDEPS_FILE)
|
||||
$$(call LogInfo, Converting $2 to html)
|
||||
$$(call MakeDir, $$($1_$2_TARGET_DIR) $$(SUPPORT_OUTPUTDIR)/markdown)
|
||||
$$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/markdown/$$($1_$2_MARKER), \
|
||||
$$(PANDOC) $$($1_OPTIONS) -f markdown -t html --standalone \
|
||||
$$($1_$2_CSS_OPTION) $$($1_$2_OPTIONS) '$$<' -o '$$@')
|
||||
ifneq ($$(findstring $$(LOG_LEVEL), debug trace),)
|
||||
TOO_LONG_LINES=`$$(GREP) -E -e '^.{80}.+$$$$' $$<` || true ; \
|
||||
if [ "x$$$$TOO_LONG_LINES" != x ]; then \
|
||||
$$(ECHO) "Warning: Unsuitable markdown in $$<:" ; \
|
||||
$$(ECHO) "The following lines are longer than 80 characters:" ; \
|
||||
$$(GREP) -E -n -e '^.{80}.+$$$$' $$< || true ; \
|
||||
fi
|
||||
endif
|
||||
|
||||
$1 += $$($1_$2_OUTPUT_FILE)
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# Setup make rules for converting a markdown file to html.
|
||||
#
|
||||
# Parameter 1 is the name of the rule. This name is used as variable prefix,
|
||||
# and the targets generated are listed in a variable by that name.
|
||||
#
|
||||
# Remaining parameters are named arguments. These include:
|
||||
# SRC : Source root dir (defaults to dir of first file)
|
||||
# DEST : Dest root dir
|
||||
# FILES : List of files to copy with absolute paths, or path relative to SRC.
|
||||
# Must be in SRC.
|
||||
# OPTIONS : Additional options to pandoc
|
||||
#
|
||||
SetupProcessMarkdown = $(NamedParamsMacroTemplate)
|
||||
define SetupProcessMarkdownBody
|
||||
ifeq ($$($1_FILES), )
|
||||
$$(error FILES is missing in SetupProcessMarkdown $1)
|
||||
endif
|
||||
|
||||
ifeq ($$($1_DEST), )
|
||||
$$(error DEST is missing in SetupProcessMarkdown $1)
|
||||
endif
|
||||
|
||||
# Default SRC to the dir of the first file.
|
||||
ifeq ($$($1_SRC), )
|
||||
$1_SRC := $$(dir $$(firstword $$($1_FILES)))
|
||||
endif
|
||||
|
||||
# Remove any trailing slash from SRC and DEST
|
||||
$1_SRC := $$(patsubst %/,%,$$($1_SRC))
|
||||
$1_DEST := $$(patsubst %/,%,$$($1_DEST))
|
||||
|
||||
$$(foreach f, $$(patsubst $$($1_SRC)/%,%,$$($1_FILES)), \
|
||||
$$(eval $$(call ProcessMarkdown,$1,$$f)) \
|
||||
)
|
||||
endef
|
81
test/lib/jdk/test/lib/compiler/CompilerUtils.java
Normal file
81
test/lib/jdk/test/lib/compiler/CompilerUtils.java
Normal file
@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2017, 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.
|
||||
*/
|
||||
|
||||
package jdk.test.lib.compiler;
|
||||
|
||||
import javax.tools.JavaCompiler;
|
||||
import javax.tools.StandardJavaFileManager;
|
||||
import javax.tools.StandardLocation;
|
||||
import javax.tools.ToolProvider;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* This class consists exclusively of static utility methods for invoking the
|
||||
* java compiler.
|
||||
*/
|
||||
|
||||
public final class CompilerUtils {
|
||||
private CompilerUtils() { }
|
||||
|
||||
/**
|
||||
* Compile all the java sources in {@code <source>/**} to
|
||||
* {@code <destination>/**}. The destination directory will be created if
|
||||
* it doesn't exist.
|
||||
*
|
||||
* All warnings/errors emitted by the compiler are output to System.out/err.
|
||||
*
|
||||
* @return true if the compilation is successful
|
||||
*
|
||||
* @throws IOException if there is an I/O error scanning the source tree or
|
||||
* creating the destination directory
|
||||
*/
|
||||
public static boolean compile(Path source, Path destination, String ... options)
|
||||
throws IOException
|
||||
{
|
||||
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
|
||||
StandardJavaFileManager jfm = compiler.getStandardFileManager(null, null, null);
|
||||
|
||||
List<Path> sources
|
||||
= Files.find(source, Integer.MAX_VALUE,
|
||||
(file, attrs) -> (file.toString().endsWith(".java")))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Files.createDirectories(destination);
|
||||
jfm.setLocation(StandardLocation.CLASS_PATH, Collections.emptyList());
|
||||
jfm.setLocationFromPaths(StandardLocation.CLASS_OUTPUT,
|
||||
Collections.singletonList(destination));
|
||||
|
||||
List<String> opts = Arrays.asList(options);
|
||||
JavaCompiler.CompilationTask task
|
||||
= compiler.getTask(null, jfm, null, opts, null,
|
||||
jfm.getJavaFileObjectsFromPaths(sources));
|
||||
|
||||
return task.call();
|
||||
}
|
||||
}
|
@ -24,6 +24,7 @@
|
||||
package jdk.test.lib.process;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
@ -415,6 +416,25 @@ public final class OutputAnalyzer {
|
||||
System.err.println(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Print the stdout buffer to the given {@code PrintStream}.
|
||||
*
|
||||
* @return this OutputAnalyzer
|
||||
*/
|
||||
public OutputAnalyzer outputTo(PrintStream out) {
|
||||
out.println(getStdout());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print the stderr buffer to the given {@code PrintStream}.
|
||||
*
|
||||
* @return this OutputAnalyzer
|
||||
*/
|
||||
public OutputAnalyzer errorTo(PrintStream out) {
|
||||
out.println(getStderr());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the contents of the output buffer (stdout and stderr)
|
||||
|
@ -365,7 +365,7 @@ public final class ProcessTools {
|
||||
*
|
||||
* The jvm process will have exited before this method returns.
|
||||
*
|
||||
* @param cmds User specifed arguments.
|
||||
* @param cmds User specified arguments.
|
||||
* @return The output from the process.
|
||||
*/
|
||||
public static OutputAnalyzer executeTestJvm(String... cmds) throws Exception {
|
||||
@ -373,6 +373,15 @@ public final class ProcessTools {
|
||||
return executeProcess(pb);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see #executeTestJvm(String...)
|
||||
* @param cmds User specified arguments.
|
||||
* @return The output from the process.
|
||||
*/
|
||||
public static OutputAnalyzer executeTestJava(String... cmds) throws Exception {
|
||||
return executeTestJvm(cmds);
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes a process, waits for it to finish and returns the process output.
|
||||
* The process will have exited before this method returns.
|
||||
|
Loading…
x
Reference in New Issue
Block a user