mirror of
https://github.com/darlinghq/darling-openjdk.git
synced 2024-11-23 12:29:56 +00:00
8192833: JEP 322: Time-Based Release Versioning
Reviewed-by: erikj, ihse, iris, mchung, psandoz, tbell
This commit is contained in:
parent
4be0e4c6f6
commit
0214135fde
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 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
|
||||
@ -41,7 +41,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(VERSION_SHORT)
|
||||
BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(VERSION_SHORT)
|
||||
BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(VERSION_STRING)
|
||||
BUNDLE_PLATFORM_VERSION := $(VERSION_MAJOR).$(VERSION_MINOR)
|
||||
BUNDLE_PLATFORM_VERSION := $(VERSION_FEATURE).$(VERSION_INTERIM)
|
||||
BUNDLE_VERSION := $(VERSION_NUMBER)
|
||||
ifeq ($(COMPANY_NAME), N/A)
|
||||
BUNDLE_VENDOR := UNDEFINED
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2016, 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
|
||||
@ -48,6 +48,9 @@ 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)")
|
||||
$(if $(VENDOR_VERSION_STRING), \
|
||||
$(call info-file-item, "IMPLEMENTOR_VERSION", "$(VENDOR_VERSION_STRING)"))
|
||||
$(call info-file-item, "JAVA_VERSION_DATE", "$(VERSION_DATE)")
|
||||
$(call info-file-item, "OS_NAME", "$(RELEASE_FILE_OS_NAME)")
|
||||
$(call info-file-item, "OS_ARCH", "$(RELEASE_FILE_OS_ARCH)")
|
||||
endef
|
||||
|
@ -313,7 +313,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
|
||||
-D\"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \
|
||||
-D\"JDK_VER=\$(VERSION_NUMBER)\" \
|
||||
-D\"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
|
||||
-D\"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(VERSION_MAJOR)\" \
|
||||
-D\"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(VERSION_FEATURE)\" \
|
||||
-D\"JDK_FVER=\$(subst .,\$(COMMA),\$(VERSION_NUMBER_FOUR_POSITIONS))\""
|
||||
|
||||
JVM_RCFLAGS="$JVM_RCFLAGS \
|
||||
|
@ -887,6 +887,8 @@ JAVA
|
||||
BOOT_JDK
|
||||
JAVA_CHECK
|
||||
JAVAC_CHECK
|
||||
VENDOR_VERSION_STRING
|
||||
VERSION_DATE
|
||||
VERSION_IS_GA
|
||||
VERSION_SHORT
|
||||
VERSION_STRING
|
||||
@ -896,9 +898,9 @@ VERSION_OPT
|
||||
VERSION_BUILD
|
||||
VERSION_PRE
|
||||
VERSION_PATCH
|
||||
VERSION_SECURITY
|
||||
VERSION_MINOR
|
||||
VERSION_MAJOR
|
||||
VERSION_UPDATE
|
||||
VERSION_INTERIM
|
||||
VERSION_FEATURE
|
||||
MACOSX_BUNDLE_ID_BASE
|
||||
MACOSX_BUNDLE_NAME_BASE
|
||||
HOTSPOT_VM_DISTRO
|
||||
@ -1091,6 +1093,7 @@ infodir
|
||||
docdir
|
||||
oldincludedir
|
||||
includedir
|
||||
runstatedir
|
||||
localstatedir
|
||||
sharedstatedir
|
||||
sysconfdir
|
||||
@ -1141,14 +1144,19 @@ with_milestone
|
||||
with_update_version
|
||||
with_user_release_suffix
|
||||
with_build_number
|
||||
with_version_major
|
||||
with_version_minor
|
||||
with_version_security
|
||||
with_version_string
|
||||
with_version_pre
|
||||
with_version_opt
|
||||
with_version_build
|
||||
with_version_major
|
||||
with_version_minor
|
||||
with_version_security
|
||||
with_version_feature
|
||||
with_version_interim
|
||||
with_version_update
|
||||
with_version_patch
|
||||
with_version_date
|
||||
with_vendor_version_string
|
||||
with_boot_jdk
|
||||
with_build_jdk
|
||||
with_import_modules
|
||||
@ -1375,6 +1383,7 @@ datadir='${datarootdir}'
|
||||
sysconfdir='${prefix}/etc'
|
||||
sharedstatedir='${prefix}/com'
|
||||
localstatedir='${prefix}/var'
|
||||
runstatedir='${localstatedir}/run'
|
||||
includedir='${prefix}/include'
|
||||
oldincludedir='/usr/include'
|
||||
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
||||
@ -1627,6 +1636,15 @@ do
|
||||
| -silent | --silent | --silen | --sile | --sil)
|
||||
silent=yes ;;
|
||||
|
||||
-runstatedir | --runstatedir | --runstatedi | --runstated \
|
||||
| --runstate | --runstat | --runsta | --runst | --runs \
|
||||
| --run | --ru | --r)
|
||||
ac_prev=runstatedir ;;
|
||||
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
|
||||
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
|
||||
| --run=* | --ru=* | --r=*)
|
||||
runstatedir=$ac_optarg ;;
|
||||
|
||||
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
||||
ac_prev=sbindir ;;
|
||||
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
||||
@ -1764,7 +1782,7 @@ fi
|
||||
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
||||
datadir sysconfdir sharedstatedir localstatedir includedir \
|
||||
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
||||
libdir localedir mandir
|
||||
libdir localedir mandir runstatedir
|
||||
do
|
||||
eval ac_val=\$$ac_var
|
||||
# Remove trailing slashes.
|
||||
@ -1917,6 +1935,7 @@ Fine tuning of the installation directories:
|
||||
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
||||
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
||||
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
||||
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
|
||||
--libdir=DIR object code libraries [EPREFIX/lib]
|
||||
--includedir=DIR C header files [PREFIX/include]
|
||||
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
||||
@ -2058,6 +2077,12 @@ Optional Packages:
|
||||
compatibility and is ignored
|
||||
--with-build-number Deprecated. Option is kept for backwards
|
||||
compatibility and is ignored
|
||||
--with-version-major Deprecated. Option is kept for backwards
|
||||
compatibility and is ignored
|
||||
--with-version-minor Deprecated. Option is kept for backwards
|
||||
compatibility and is ignored
|
||||
--with-version-security Deprecated. Option is kept for backwards
|
||||
compatibility and is ignored
|
||||
--with-version-string Set version string [calculated]
|
||||
--with-version-pre Set the base part of the version 'PRE' field
|
||||
(pre-release identifier) ['internal']
|
||||
@ -2065,14 +2090,17 @@ Optional Packages:
|
||||
[<timestamp>.<user>.<dirname>]
|
||||
--with-version-build Set version 'BUILD' field (build number) [not
|
||||
specified]
|
||||
--with-version-major Set version 'MAJOR' field (first number) [current
|
||||
--with-version-feature Set version 'FEATURE' field (first number) [current
|
||||
source value]
|
||||
--with-version-minor Set version 'MINOR' field (second number) [current
|
||||
--with-version-interim Set version 'INTERIM' field (second number) [current
|
||||
source value]
|
||||
--with-version-security Set version 'SECURITY' field (third number) [current
|
||||
--with-version-update Set version 'UPDATE' field (third number) [current
|
||||
source value]
|
||||
--with-version-patch Set version 'PATCH' field (fourth number) [not
|
||||
specified]
|
||||
--with-version-date Set version date [current source value]
|
||||
--with-vendor-version-string
|
||||
Set vendor version string [not specified]
|
||||
--with-boot-jdk path to Boot JDK (used to bootstrap build) [probed]
|
||||
--with-build-jdk path to JDK of same version as is being built[the
|
||||
newly built JDK]
|
||||
@ -4447,7 +4475,7 @@ VALID_JVM_VARIANTS="server client minimal core zero custom"
|
||||
|
||||
|
||||
#
|
||||
# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# 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
|
||||
@ -5157,7 +5185,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=1512638287
|
||||
DATE_WHEN_GENERATED=1513206608
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
@ -24988,6 +25016,33 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
# Check whether --with-version-major was given.
|
||||
if test "${with_version_major+set}" = set; then :
|
||||
withval=$with_version_major; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-version-major is deprecated and will be ignored." >&5
|
||||
$as_echo "$as_me: WARNING: Option --with-version-major is deprecated and will be ignored." >&2;}
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
# Check whether --with-version-minor was given.
|
||||
if test "${with_version_minor+set}" = set; then :
|
||||
withval=$with_version_minor; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-version-minor is deprecated and will be ignored." >&5
|
||||
$as_echo "$as_me: WARNING: Option --with-version-minor is deprecated and will be ignored." >&2;}
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
# Check whether --with-version-security was given.
|
||||
if test "${with_version_security+set}" = set; then :
|
||||
withval=$with_version_security; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-version-security is deprecated and will be ignored." >&5
|
||||
$as_echo "$as_me: WARNING: Option --with-version-security is deprecated and will be ignored." >&2;}
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Source the version numbers file
|
||||
. $AUTOCONF_DIR/version-numbers
|
||||
|
||||
@ -25016,20 +25071,20 @@ fi
|
||||
elif test "x$with_version_string" != x; then
|
||||
# Additional [] needed to keep m4 from mangling shell constructs.
|
||||
if [[ $with_version_string =~ ^([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(-([a-zA-Z]+))?((\+)([0-9]+)?(-([-a-zA-Z0-9.]+))?)?$ ]] ; then
|
||||
VERSION_MAJOR=${BASH_REMATCH[1]}
|
||||
VERSION_MINOR=${BASH_REMATCH[3]}
|
||||
VERSION_SECURITY=${BASH_REMATCH[5]}
|
||||
VERSION_FEATURE=${BASH_REMATCH[1]}
|
||||
VERSION_INTERIM=${BASH_REMATCH[3]}
|
||||
VERSION_UPDATE=${BASH_REMATCH[5]}
|
||||
VERSION_PATCH=${BASH_REMATCH[7]}
|
||||
VERSION_PRE=${BASH_REMATCH[9]}
|
||||
version_plus_separator=${BASH_REMATCH[11]}
|
||||
VERSION_BUILD=${BASH_REMATCH[12]}
|
||||
VERSION_OPT=${BASH_REMATCH[14]}
|
||||
# Unspecified numerical fields are interpreted as 0.
|
||||
if test "x$VERSION_MINOR" = x; then
|
||||
VERSION_MINOR=0
|
||||
if test "x$VERSION_INTERIM" = x; then
|
||||
VERSION_INTERIM=0
|
||||
fi
|
||||
if test "x$VERSION_SECURITY" = x; then
|
||||
VERSION_SECURITY=0
|
||||
if test "x$VERSION_UPDATE" = x; then
|
||||
VERSION_UPDATE=0
|
||||
fi
|
||||
if test "x$VERSION_PATCH" = x; then
|
||||
VERSION_PATCH=0
|
||||
@ -25158,22 +25213,22 @@ $as_echo "$as_me: WARNING: Value for VERSION_BUILD has been sanitized from '$wit
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --with-version-major was given.
|
||||
if test "${with_version_major+set}" = set; then :
|
||||
withval=$with_version_major; with_version_major_present=true
|
||||
# Check whether --with-version-feature was given.
|
||||
if test "${with_version_feature+set}" = set; then :
|
||||
withval=$with_version_feature; with_version_feature_present=true
|
||||
else
|
||||
with_version_major_present=false
|
||||
with_version_feature_present=false
|
||||
fi
|
||||
|
||||
|
||||
if test "x$with_version_major_present" = xtrue; then
|
||||
if test "x$with_version_major" = xyes; then
|
||||
as_fn_error $? "--with-version-major must have a value" "$LINENO" 5
|
||||
if test "x$with_version_feature_present" = xtrue; then
|
||||
if test "x$with_version_feature" = xyes; then
|
||||
as_fn_error $? "--with-version-feature must have a value" "$LINENO" 5
|
||||
else
|
||||
|
||||
# Additional [] needed to keep m4 from mangling shell constructs.
|
||||
if ! [[ "$with_version_major" =~ ^0*([1-9][0-9]*)|(0)$ ]] ; then
|
||||
as_fn_error $? "\"$with_version_major\" is not a valid numerical value for VERSION_MAJOR" "$LINENO" 5
|
||||
if ! [[ "$with_version_feature" =~ ^0*([1-9][0-9]*)|(0)$ ]] ; then
|
||||
as_fn_error $? "\"$with_version_feature\" is not a valid numerical value for VERSION_FEATURE" "$LINENO" 5
|
||||
fi
|
||||
# Extract the version number without leading zeros.
|
||||
cleaned_value=${BASH_REMATCH[1]}
|
||||
@ -25183,44 +25238,44 @@ fi
|
||||
fi
|
||||
|
||||
if test $cleaned_value -gt 255; then
|
||||
as_fn_error $? "VERSION_MAJOR is given as $with_version_major. This is greater than 255 which is not allowed." "$LINENO" 5
|
||||
as_fn_error $? "VERSION_FEATURE is given as $with_version_feature. This is greater than 255 which is not allowed." "$LINENO" 5
|
||||
fi
|
||||
if test "x$cleaned_value" != "x$with_version_major"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Value for VERSION_MAJOR has been sanitized from '$with_version_major' to '$cleaned_value'" >&5
|
||||
$as_echo "$as_me: WARNING: Value for VERSION_MAJOR has been sanitized from '$with_version_major' to '$cleaned_value'" >&2;}
|
||||
if test "x$cleaned_value" != "x$with_version_feature"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Value for VERSION_FEATURE has been sanitized from '$with_version_feature' to '$cleaned_value'" >&5
|
||||
$as_echo "$as_me: WARNING: Value for VERSION_FEATURE has been sanitized from '$with_version_feature' to '$cleaned_value'" >&2;}
|
||||
fi
|
||||
VERSION_MAJOR=$cleaned_value
|
||||
VERSION_FEATURE=$cleaned_value
|
||||
|
||||
fi
|
||||
else
|
||||
if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
|
||||
# Default is to get value from version-numbers
|
||||
VERSION_MAJOR="$DEFAULT_VERSION_MAJOR"
|
||||
VERSION_FEATURE="$DEFAULT_VERSION_FEATURE"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --with-version-minor was given.
|
||||
if test "${with_version_minor+set}" = set; then :
|
||||
withval=$with_version_minor; with_version_minor_present=true
|
||||
# Check whether --with-version-interim was given.
|
||||
if test "${with_version_interim+set}" = set; then :
|
||||
withval=$with_version_interim; with_version_interim_present=true
|
||||
else
|
||||
with_version_minor_present=false
|
||||
with_version_interim_present=false
|
||||
fi
|
||||
|
||||
|
||||
if test "x$with_version_minor_present" = xtrue; then
|
||||
if test "x$with_version_minor" = xyes; then
|
||||
as_fn_error $? "--with-version-minor must have a value" "$LINENO" 5
|
||||
elif test "x$with_version_minor" = xno; then
|
||||
if test "x$with_version_interim_present" = xtrue; then
|
||||
if test "x$with_version_interim" = xyes; then
|
||||
as_fn_error $? "--with-version-interim must have a value" "$LINENO" 5
|
||||
elif test "x$with_version_interim" = xno; then
|
||||
# Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
|
||||
VERSION_MINOR=0
|
||||
elif test "x$with_version_minor" = x; then
|
||||
VERSION_MINOR=0
|
||||
VERSION_INTERIM=0
|
||||
elif test "x$with_version_interim" = x; then
|
||||
VERSION_INTERIM=0
|
||||
else
|
||||
|
||||
# Additional [] needed to keep m4 from mangling shell constructs.
|
||||
if ! [[ "$with_version_minor" =~ ^0*([1-9][0-9]*)|(0)$ ]] ; then
|
||||
as_fn_error $? "\"$with_version_minor\" is not a valid numerical value for VERSION_MINOR" "$LINENO" 5
|
||||
if ! [[ "$with_version_interim" =~ ^0*([1-9][0-9]*)|(0)$ ]] ; then
|
||||
as_fn_error $? "\"$with_version_interim\" is not a valid numerical value for VERSION_INTERIM" "$LINENO" 5
|
||||
fi
|
||||
# Extract the version number without leading zeros.
|
||||
cleaned_value=${BASH_REMATCH[1]}
|
||||
@ -25230,44 +25285,44 @@ fi
|
||||
fi
|
||||
|
||||
if test $cleaned_value -gt 255; then
|
||||
as_fn_error $? "VERSION_MINOR is given as $with_version_minor. This is greater than 255 which is not allowed." "$LINENO" 5
|
||||
as_fn_error $? "VERSION_INTERIM is given as $with_version_interim. This is greater than 255 which is not allowed." "$LINENO" 5
|
||||
fi
|
||||
if test "x$cleaned_value" != "x$with_version_minor"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Value for VERSION_MINOR has been sanitized from '$with_version_minor' to '$cleaned_value'" >&5
|
||||
$as_echo "$as_me: WARNING: Value for VERSION_MINOR has been sanitized from '$with_version_minor' to '$cleaned_value'" >&2;}
|
||||
if test "x$cleaned_value" != "x$with_version_interim"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Value for VERSION_INTERIM has been sanitized from '$with_version_interim' to '$cleaned_value'" >&5
|
||||
$as_echo "$as_me: WARNING: Value for VERSION_INTERIM has been sanitized from '$with_version_interim' to '$cleaned_value'" >&2;}
|
||||
fi
|
||||
VERSION_MINOR=$cleaned_value
|
||||
VERSION_INTERIM=$cleaned_value
|
||||
|
||||
fi
|
||||
else
|
||||
if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
|
||||
# Default is 0, if unspecified
|
||||
VERSION_MINOR=$DEFAULT_VERSION_MINOR
|
||||
VERSION_INTERIM=$DEFAULT_VERSION_INTERIM
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --with-version-security was given.
|
||||
if test "${with_version_security+set}" = set; then :
|
||||
withval=$with_version_security; with_version_security_present=true
|
||||
# Check whether --with-version-update was given.
|
||||
if test "${with_version_update+set}" = set; then :
|
||||
withval=$with_version_update; with_version_update_present=true
|
||||
else
|
||||
with_version_security_present=false
|
||||
with_version_update_present=false
|
||||
fi
|
||||
|
||||
|
||||
if test "x$with_version_security_present" = xtrue; then
|
||||
if test "x$with_version_security" = xyes; then
|
||||
as_fn_error $? "--with-version-security must have a value" "$LINENO" 5
|
||||
elif test "x$with_version_security" = xno; then
|
||||
if test "x$with_version_update_present" = xtrue; then
|
||||
if test "x$with_version_update" = xyes; then
|
||||
as_fn_error $? "--with-version-update must have a value" "$LINENO" 5
|
||||
elif test "x$with_version_update" = xno; then
|
||||
# Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
|
||||
VERSION_SECURITY=0
|
||||
elif test "x$with_version_security" = x; then
|
||||
VERSION_SECURITY=0
|
||||
VERSION_UPDATE=0
|
||||
elif test "x$with_version_update" = x; then
|
||||
VERSION_UPDATE=0
|
||||
else
|
||||
|
||||
# Additional [] needed to keep m4 from mangling shell constructs.
|
||||
if ! [[ "$with_version_security" =~ ^0*([1-9][0-9]*)|(0)$ ]] ; then
|
||||
as_fn_error $? "\"$with_version_security\" is not a valid numerical value for VERSION_SECURITY" "$LINENO" 5
|
||||
if ! [[ "$with_version_update" =~ ^0*([1-9][0-9]*)|(0)$ ]] ; then
|
||||
as_fn_error $? "\"$with_version_update\" is not a valid numerical value for VERSION_UPDATE" "$LINENO" 5
|
||||
fi
|
||||
# Extract the version number without leading zeros.
|
||||
cleaned_value=${BASH_REMATCH[1]}
|
||||
@ -25277,19 +25332,19 @@ fi
|
||||
fi
|
||||
|
||||
if test $cleaned_value -gt 255; then
|
||||
as_fn_error $? "VERSION_SECURITY is given as $with_version_security. This is greater than 255 which is not allowed." "$LINENO" 5
|
||||
as_fn_error $? "VERSION_UPDATE is given as $with_version_update. This is greater than 255 which is not allowed." "$LINENO" 5
|
||||
fi
|
||||
if test "x$cleaned_value" != "x$with_version_security"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Value for VERSION_SECURITY has been sanitized from '$with_version_security' to '$cleaned_value'" >&5
|
||||
$as_echo "$as_me: WARNING: Value for VERSION_SECURITY has been sanitized from '$with_version_security' to '$cleaned_value'" >&2;}
|
||||
if test "x$cleaned_value" != "x$with_version_update"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Value for VERSION_UPDATE has been sanitized from '$with_version_update' to '$cleaned_value'" >&5
|
||||
$as_echo "$as_me: WARNING: Value for VERSION_UPDATE has been sanitized from '$with_version_update' to '$cleaned_value'" >&2;}
|
||||
fi
|
||||
VERSION_SECURITY=$cleaned_value
|
||||
VERSION_UPDATE=$cleaned_value
|
||||
|
||||
fi
|
||||
else
|
||||
if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
|
||||
# Default is 0, if unspecified
|
||||
VERSION_SECURITY=$DEFAULT_VERSION_SECURITY
|
||||
VERSION_UPDATE=$DEFAULT_VERSION_UPDATE
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -25350,7 +25405,7 @@ $as_echo "$as_me: WARNING: Value for VERSION_PATCH has been sanitized from '$wit
|
||||
fi
|
||||
|
||||
# VERSION_NUMBER but always with exactly 4 positions, with 0 for empty positions.
|
||||
VERSION_NUMBER_FOUR_POSITIONS=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_SECURITY.$VERSION_PATCH
|
||||
VERSION_NUMBER_FOUR_POSITIONS=$VERSION_FEATURE.$VERSION_INTERIM.$VERSION_UPDATE.$VERSION_PATCH
|
||||
|
||||
stripped_version_number=$VERSION_NUMBER_FOUR_POSITIONS
|
||||
# Strip trailing zeroes from stripped_version_number
|
||||
@ -25368,6 +25423,40 @@ $as_echo "$as_me: WARNING: Value for VERSION_PATCH has been sanitized from '$wit
|
||||
# The short version string, just VERSION_NUMBER and PRE, if present.
|
||||
VERSION_SHORT=$VERSION_NUMBER${VERSION_PRE:+-$VERSION_PRE}
|
||||
|
||||
# The version date
|
||||
|
||||
# Check whether --with-version-date was given.
|
||||
if test "${with_version_date+set}" = set; then :
|
||||
withval=$with_version_date;
|
||||
fi
|
||||
|
||||
if test "x$with_version_date" = xyes; then
|
||||
as_fn_error $? "--with-version-date must have a value" "$LINENO" 5
|
||||
elif test "x$with_version_date" != x; then
|
||||
if ! [[ $with_version_date =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]] ; then
|
||||
as_fn_error $? "\"$with_version_date\" is not a valid version date" "$LINENO" 5
|
||||
else
|
||||
VERSION_DATE="$with_version_date"
|
||||
fi
|
||||
else
|
||||
VERSION_DATE="$DEFAULT_VERSION_DATE"
|
||||
fi
|
||||
|
||||
# The vendor version string, if any
|
||||
|
||||
# Check whether --with-vendor-version-string was given.
|
||||
if test "${with_vendor_version_string+set}" = set; then :
|
||||
withval=$with_vendor_version_string;
|
||||
fi
|
||||
|
||||
if test "x$with_vendor_version_string" = xyes; then
|
||||
as_fn_error $? "--with-vendor-version-string must have a value" "$LINENO" 5
|
||||
elif ! [[ $with_vendor_version_string =~ ^[[:graph:]]*$ ]] ; then
|
||||
as_fn_error $? "--with--vendor-version-string contains non-graphical characters: $with_vendor_version_string" "$LINENO" 5
|
||||
else
|
||||
VENDOR_VERSION_STRING="$with_vendor_version_string"
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for version string" >&5
|
||||
$as_echo_n "checking for version string... " >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $VERSION_STRING" >&5
|
||||
@ -25387,6 +25476,8 @@ $as_echo "$VERSION_STRING" >&6; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Setup BootJDK, used to bootstrap the build.
|
||||
@ -50653,7 +50744,7 @@ $as_echo "no" >&6; }
|
||||
-D\"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \
|
||||
-D\"JDK_VER=\$(VERSION_NUMBER)\" \
|
||||
-D\"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
|
||||
-D\"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(VERSION_MAJOR)\" \
|
||||
-D\"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(VERSION_FEATURE)\" \
|
||||
-D\"JDK_FVER=\$(subst .,\$(COMMA),\$(VERSION_NUMBER_FOUR_POSITIONS))\""
|
||||
|
||||
JVM_RCFLAGS="$JVM_RCFLAGS \
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# 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
|
||||
@ -62,6 +62,9 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
|
||||
BASIC_DEPRECATED_ARG_WITH([update-version])
|
||||
BASIC_DEPRECATED_ARG_WITH([user-release-suffix])
|
||||
BASIC_DEPRECATED_ARG_WITH([build-number])
|
||||
BASIC_DEPRECATED_ARG_WITH([version-major])
|
||||
BASIC_DEPRECATED_ARG_WITH([version-minor])
|
||||
BASIC_DEPRECATED_ARG_WITH([version-security])
|
||||
|
||||
# Source the version numbers file
|
||||
. $AUTOCONF_DIR/version-numbers
|
||||
@ -87,20 +90,20 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
|
||||
elif test "x$with_version_string" != x; then
|
||||
# Additional [] needed to keep m4 from mangling shell constructs.
|
||||
if [ [[ $with_version_string =~ ^([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(-([a-zA-Z]+))?((\+)([0-9]+)?(-([-a-zA-Z0-9.]+))?)?$ ]] ]; then
|
||||
VERSION_MAJOR=${BASH_REMATCH[[1]]}
|
||||
VERSION_MINOR=${BASH_REMATCH[[3]]}
|
||||
VERSION_SECURITY=${BASH_REMATCH[[5]]}
|
||||
VERSION_FEATURE=${BASH_REMATCH[[1]]}
|
||||
VERSION_INTERIM=${BASH_REMATCH[[3]]}
|
||||
VERSION_UPDATE=${BASH_REMATCH[[5]]}
|
||||
VERSION_PATCH=${BASH_REMATCH[[7]]}
|
||||
VERSION_PRE=${BASH_REMATCH[[9]]}
|
||||
version_plus_separator=${BASH_REMATCH[[11]]}
|
||||
VERSION_BUILD=${BASH_REMATCH[[12]]}
|
||||
VERSION_OPT=${BASH_REMATCH[[14]]}
|
||||
# Unspecified numerical fields are interpreted as 0.
|
||||
if test "x$VERSION_MINOR" = x; then
|
||||
VERSION_MINOR=0
|
||||
if test "x$VERSION_INTERIM" = x; then
|
||||
VERSION_INTERIM=0
|
||||
fi
|
||||
if test "x$VERSION_SECURITY" = x; then
|
||||
VERSION_SECURITY=0
|
||||
if test "x$VERSION_UPDATE" = x; then
|
||||
VERSION_UPDATE=0
|
||||
fi
|
||||
if test "x$VERSION_PATCH" = x; then
|
||||
VERSION_PATCH=0
|
||||
@ -191,64 +194,64 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(version-major, [AS_HELP_STRING([--with-version-major],
|
||||
[Set version 'MAJOR' field (first number) @<:@current source value@:>@])],
|
||||
[with_version_major_present=true], [with_version_major_present=false])
|
||||
AC_ARG_WITH(version-feature, [AS_HELP_STRING([--with-version-feature],
|
||||
[Set version 'FEATURE' field (first number) @<:@current source value@:>@])],
|
||||
[with_version_feature_present=true], [with_version_feature_present=false])
|
||||
|
||||
if test "x$with_version_major_present" = xtrue; then
|
||||
if test "x$with_version_major" = xyes; then
|
||||
AC_MSG_ERROR([--with-version-major must have a value])
|
||||
if test "x$with_version_feature_present" = xtrue; then
|
||||
if test "x$with_version_feature" = xyes; then
|
||||
AC_MSG_ERROR([--with-version-feature must have a value])
|
||||
else
|
||||
JDKVER_CHECK_AND_SET_NUMBER(VERSION_MAJOR, $with_version_major)
|
||||
JDKVER_CHECK_AND_SET_NUMBER(VERSION_FEATURE, $with_version_feature)
|
||||
fi
|
||||
else
|
||||
if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
|
||||
# Default is to get value from version-numbers
|
||||
VERSION_MAJOR="$DEFAULT_VERSION_MAJOR"
|
||||
VERSION_FEATURE="$DEFAULT_VERSION_FEATURE"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(version-minor, [AS_HELP_STRING([--with-version-minor],
|
||||
[Set version 'MINOR' field (second number) @<:@current source value@:>@])],
|
||||
[with_version_minor_present=true], [with_version_minor_present=false])
|
||||
AC_ARG_WITH(version-interim, [AS_HELP_STRING([--with-version-interim],
|
||||
[Set version 'INTERIM' field (second number) @<:@current source value@:>@])],
|
||||
[with_version_interim_present=true], [with_version_interim_present=false])
|
||||
|
||||
if test "x$with_version_minor_present" = xtrue; then
|
||||
if test "x$with_version_minor" = xyes; then
|
||||
AC_MSG_ERROR([--with-version-minor must have a value])
|
||||
elif test "x$with_version_minor" = xno; then
|
||||
if test "x$with_version_interim_present" = xtrue; then
|
||||
if test "x$with_version_interim" = xyes; then
|
||||
AC_MSG_ERROR([--with-version-interim must have a value])
|
||||
elif test "x$with_version_interim" = xno; then
|
||||
# Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
|
||||
VERSION_MINOR=0
|
||||
elif test "x$with_version_minor" = x; then
|
||||
VERSION_MINOR=0
|
||||
VERSION_INTERIM=0
|
||||
elif test "x$with_version_interim" = x; then
|
||||
VERSION_INTERIM=0
|
||||
else
|
||||
JDKVER_CHECK_AND_SET_NUMBER(VERSION_MINOR, $with_version_minor)
|
||||
JDKVER_CHECK_AND_SET_NUMBER(VERSION_INTERIM, $with_version_interim)
|
||||
fi
|
||||
else
|
||||
if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
|
||||
# Default is 0, if unspecified
|
||||
VERSION_MINOR=$DEFAULT_VERSION_MINOR
|
||||
VERSION_INTERIM=$DEFAULT_VERSION_INTERIM
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(version-security, [AS_HELP_STRING([--with-version-security],
|
||||
[Set version 'SECURITY' field (third number) @<:@current source value@:>@])],
|
||||
[with_version_security_present=true], [with_version_security_present=false])
|
||||
AC_ARG_WITH(version-update, [AS_HELP_STRING([--with-version-update],
|
||||
[Set version 'UPDATE' field (third number) @<:@current source value@:>@])],
|
||||
[with_version_update_present=true], [with_version_update_present=false])
|
||||
|
||||
if test "x$with_version_security_present" = xtrue; then
|
||||
if test "x$with_version_security" = xyes; then
|
||||
AC_MSG_ERROR([--with-version-security must have a value])
|
||||
elif test "x$with_version_security" = xno; then
|
||||
if test "x$with_version_update_present" = xtrue; then
|
||||
if test "x$with_version_update" = xyes; then
|
||||
AC_MSG_ERROR([--with-version-update must have a value])
|
||||
elif test "x$with_version_update" = xno; then
|
||||
# Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
|
||||
VERSION_SECURITY=0
|
||||
elif test "x$with_version_security" = x; then
|
||||
VERSION_SECURITY=0
|
||||
VERSION_UPDATE=0
|
||||
elif test "x$with_version_update" = x; then
|
||||
VERSION_UPDATE=0
|
||||
else
|
||||
JDKVER_CHECK_AND_SET_NUMBER(VERSION_SECURITY, $with_version_security)
|
||||
JDKVER_CHECK_AND_SET_NUMBER(VERSION_UPDATE, $with_version_update)
|
||||
fi
|
||||
else
|
||||
if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
|
||||
# Default is 0, if unspecified
|
||||
VERSION_SECURITY=$DEFAULT_VERSION_SECURITY
|
||||
VERSION_UPDATE=$DEFAULT_VERSION_UPDATE
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -284,7 +287,7 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
|
||||
fi
|
||||
|
||||
# VERSION_NUMBER but always with exactly 4 positions, with 0 for empty positions.
|
||||
VERSION_NUMBER_FOUR_POSITIONS=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_SECURITY.$VERSION_PATCH
|
||||
VERSION_NUMBER_FOUR_POSITIONS=$VERSION_FEATURE.$VERSION_INTERIM.$VERSION_UPDATE.$VERSION_PATCH
|
||||
|
||||
stripped_version_number=$VERSION_NUMBER_FOUR_POSITIONS
|
||||
# Strip trailing zeroes from stripped_version_number
|
||||
@ -302,12 +305,38 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
|
||||
# The short version string, just VERSION_NUMBER and PRE, if present.
|
||||
VERSION_SHORT=$VERSION_NUMBER${VERSION_PRE:+-$VERSION_PRE}
|
||||
|
||||
# The version date
|
||||
AC_ARG_WITH(version-date, [AS_HELP_STRING([--with-version-date],
|
||||
[Set version date @<:@current source value@:>@])])
|
||||
if test "x$with_version_date" = xyes; then
|
||||
AC_MSG_ERROR([--with-version-date must have a value])
|
||||
elif test "x$with_version_date" != x; then
|
||||
if [ ! [[ $with_version_date =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]] ]; then
|
||||
AC_MSG_ERROR(["$with_version_date" is not a valid version date])
|
||||
else
|
||||
VERSION_DATE="$with_version_date"
|
||||
fi
|
||||
else
|
||||
VERSION_DATE="$DEFAULT_VERSION_DATE"
|
||||
fi
|
||||
|
||||
# The vendor version string, if any
|
||||
AC_ARG_WITH(vendor-version-string, [AS_HELP_STRING([--with-vendor-version-string],
|
||||
[Set vendor version string @<:@not specified@:>@])])
|
||||
if test "x$with_vendor_version_string" = xyes; then
|
||||
AC_MSG_ERROR([--with-vendor-version-string must have a value])
|
||||
elif [ ! [[ $with_vendor_version_string =~ ^[[:graph:]]*$ ]] ]; then
|
||||
AC_MSG_ERROR([--with--vendor-version-string contains non-graphical characters: $with_vendor_version_string])
|
||||
else
|
||||
VENDOR_VERSION_STRING="$with_vendor_version_string"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for version string])
|
||||
AC_MSG_RESULT([$VERSION_STRING])
|
||||
|
||||
AC_SUBST(VERSION_MAJOR)
|
||||
AC_SUBST(VERSION_MINOR)
|
||||
AC_SUBST(VERSION_SECURITY)
|
||||
AC_SUBST(VERSION_FEATURE)
|
||||
AC_SUBST(VERSION_INTERIM)
|
||||
AC_SUBST(VERSION_UPDATE)
|
||||
AC_SUBST(VERSION_PATCH)
|
||||
AC_SUBST(VERSION_PRE)
|
||||
AC_SUBST(VERSION_BUILD)
|
||||
@ -317,4 +346,6 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
|
||||
AC_SUBST(VERSION_STRING)
|
||||
AC_SUBST(VERSION_SHORT)
|
||||
AC_SUBST(VERSION_IS_GA)
|
||||
AC_SUBST(VERSION_DATE)
|
||||
AC_SUBST(VENDOR_VERSION_STRING)
|
||||
])
|
||||
|
@ -143,10 +143,9 @@ COPYRIGHT_YEAR:=@COPYRIGHT_YEAR@
|
||||
|
||||
## Building blocks of the version string
|
||||
# First three version numbers, with well-specified meanings (numerical)
|
||||
VERSION_MAJOR := @VERSION_MAJOR@
|
||||
VERSION_MINOR := @VERSION_MINOR@
|
||||
VERSION_SECURITY := @VERSION_SECURITY@
|
||||
# Optional fourth element for use by OpenJDK consumers (numerical)
|
||||
VERSION_FEATURE := @VERSION_FEATURE@
|
||||
VERSION_INTERIM := @VERSION_INTERIM@
|
||||
VERSION_UPDATE := @VERSION_UPDATE@
|
||||
VERSION_PATCH := @VERSION_PATCH@
|
||||
# The pre-release identifier (string)
|
||||
VERSION_PRE := @VERSION_PRE@
|
||||
@ -164,17 +163,23 @@ VERSION_NUMBER_FOUR_POSITIONS := @VERSION_NUMBER_FOUR_POSITIONS@
|
||||
VERSION_STRING := @VERSION_STRING@
|
||||
# The short version string, without trailing zeroes and just PRE, if present.
|
||||
VERSION_SHORT := @VERSION_SHORT@
|
||||
# The Java specification version. It usually equals the major version number.
|
||||
VERSION_SPECIFICATION := @VERSION_MAJOR@
|
||||
# The Java specification version. It usually equals the feature version number.
|
||||
VERSION_SPECIFICATION := @VERSION_FEATURE@
|
||||
# A GA version is defined by the PRE string being empty. Rather than testing for
|
||||
# that, this variable defines it with true/false.
|
||||
VERSION_IS_GA := @VERSION_IS_GA@
|
||||
|
||||
# Version date
|
||||
VERSION_DATE := @VERSION_DATE@
|
||||
|
||||
# Vendor version string
|
||||
VENDOR_VERSION_STRING := @VENDOR_VERSION_STRING@
|
||||
|
||||
# Convenience CFLAGS settings for passing version information into native programs.
|
||||
VERSION_CFLAGS := \
|
||||
-DVERSION_MAJOR=$(VERSION_MAJOR) \
|
||||
-DVERSION_MINOR=$(VERSION_MINOR) \
|
||||
-DVERSION_SECURITY=$(VERSION_SECURITY) \
|
||||
-DVERSION_FEATURE=$(VERSION_FEATURE) \
|
||||
-DVERSION_INTERIM=$(VERSION_INTERIM) \
|
||||
-DVERSION_UPDATE=$(VERSION_UPDATE) \
|
||||
-DVERSION_PATCH=$(VERSION_PATCH) \
|
||||
-DVERSION_PRE='"$(VERSION_PRE)"' \
|
||||
-DVERSION_BUILD=$(VERSION_BUILD) \
|
||||
@ -183,6 +188,8 @@ VERSION_CFLAGS := \
|
||||
-DVERSION_STRING='"$(VERSION_STRING)"' \
|
||||
-DVERSION_SHORT='"$(VERSION_SHORT)"' \
|
||||
-DVERSION_SPECIFICATION='"$(VERSION_SPECIFICATION)"' \
|
||||
-DVERSION_DATE='"$(VERSION_DATE)"' \
|
||||
-DVENDOR_VERSION_STRING='"$(VENDOR_VERSION_STRING)"' \
|
||||
#
|
||||
|
||||
# Platform naming variables
|
||||
|
@ -25,10 +25,11 @@
|
||||
|
||||
# Default version numbers to use unless overridden by configure
|
||||
|
||||
DEFAULT_VERSION_MAJOR=10
|
||||
DEFAULT_VERSION_MINOR=0
|
||||
DEFAULT_VERSION_SECURITY=0
|
||||
DEFAULT_VERSION_FEATURE=10
|
||||
DEFAULT_VERSION_INTERIM=0
|
||||
DEFAULT_VERSION_UPDATE=0
|
||||
DEFAULT_VERSION_PATCH=0
|
||||
DEFAULT_VERSION_DATE=2018-03-20
|
||||
|
||||
LAUNCHER_NAME=openjdk
|
||||
PRODUCT_NAME=OpenJDK
|
||||
|
@ -1050,17 +1050,17 @@ var concatObjects = function (o1, o2) {
|
||||
* Constructs the numeric version string from reading the
|
||||
* make/autoconf/version-numbers file and removing all trailing ".0".
|
||||
*
|
||||
* @param major Override major version
|
||||
* @param minor Override minor version
|
||||
* @param security Override security version
|
||||
* @param feature Override feature version
|
||||
* @param interim Override interim version
|
||||
* @param update Override update version
|
||||
* @param patch Override patch version
|
||||
* @returns {String} The numeric version string
|
||||
*/
|
||||
var getVersion = function (major, minor, security, patch) {
|
||||
var getVersion = function (feature, interim, update, patch) {
|
||||
var version_numbers = getVersionNumbers();
|
||||
var version = (major != null ? major : version_numbers.get("DEFAULT_VERSION_MAJOR"))
|
||||
+ "." + (minor != null ? minor : version_numbers.get("DEFAULT_VERSION_MINOR"))
|
||||
+ "." + (security != null ? security : version_numbers.get("DEFAULT_VERSION_SECURITY"))
|
||||
var version = (feature != null ? feature : version_numbers.get("DEFAULT_VERSION_FEATURE"))
|
||||
+ "." + (interim != null ? interim : version_numbers.get("DEFAULT_VERSION_INTERIM"))
|
||||
+ "." + (update != null ? update : version_numbers.get("DEFAULT_VERSION_UPDATE"))
|
||||
+ "." + (patch != null ? patch : version_numbers.get("DEFAULT_VERSION_PATCH"));
|
||||
while (version.match(".*\\.0$")) {
|
||||
version = version.substring(0, version.length - 2);
|
||||
|
@ -38,7 +38,9 @@ $(eval $(call SetupTextFileProcessing, BUILD_VERSION_JAVA, \
|
||||
@@VERSION_NUMBER@@ => $(VERSION_NUMBER) ; \
|
||||
@@VERSION_PRE@@ => $(VERSION_PRE) ; \
|
||||
@@VERSION_BUILD@@ => $(VERSION_BUILD) ; \
|
||||
@@VERSION_OPT@@ => $(VERSION_OPT), \
|
||||
@@VERSION_OPT@@ => $(VERSION_OPT) ; \
|
||||
@@VERSION_DATE@@ => $(VERSION_DATE) ; \
|
||||
@@VENDOR_VERSION_STRING@@ => $(VENDOR_VERSION_STRING), \
|
||||
))
|
||||
|
||||
GENSRC_JAVA_BASE += $(BUILD_VERSION_JAVA)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 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
|
||||
@ -48,14 +48,14 @@ unsigned int Abstract_VM_Version::_L1_data_cache_line_size = 0;
|
||||
#error HOTSPOT_VERSION_STRING must be defined
|
||||
#endif
|
||||
|
||||
#ifndef VERSION_MAJOR
|
||||
#error VERSION_MAJOR must be defined
|
||||
#ifndef VERSION_FEATURE
|
||||
#error VERSION_FEATURE must be defined
|
||||
#endif
|
||||
#ifndef VERSION_MINOR
|
||||
#error VERSION_MINOR must be defined
|
||||
#ifndef VERSION_INTERIM
|
||||
#error VERSION_INTERIM must be defined
|
||||
#endif
|
||||
#ifndef VERSION_SECURITY
|
||||
#error VERSION_SECURITY must be defined
|
||||
#ifndef VERSION_UPDATE
|
||||
#error VERSION_UPDATE must be defined
|
||||
#endif
|
||||
#ifndef VERSION_PATCH
|
||||
#error VERSION_PATCH must be defined
|
||||
@ -76,9 +76,9 @@ unsigned int Abstract_VM_Version::_L1_data_cache_line_size = 0;
|
||||
|
||||
// HOTSPOT_VERSION_STRING equals the JDK VERSION_STRING (unless overridden
|
||||
// in a standalone build).
|
||||
int Abstract_VM_Version::_vm_major_version = VERSION_MAJOR;
|
||||
int Abstract_VM_Version::_vm_minor_version = VERSION_MINOR;
|
||||
int Abstract_VM_Version::_vm_security_version = VERSION_SECURITY;
|
||||
int Abstract_VM_Version::_vm_major_version = VERSION_FEATURE;
|
||||
int Abstract_VM_Version::_vm_minor_version = VERSION_INTERIM;
|
||||
int Abstract_VM_Version::_vm_security_version = VERSION_UPDATE;
|
||||
int Abstract_VM_Version::_vm_patch_version = VERSION_PATCH;
|
||||
int Abstract_VM_Version::_vm_build_number = VERSION_BUILD;
|
||||
unsigned int Abstract_VM_Version::_parallel_worker_threads = 0;
|
||||
|
@ -899,81 +899,68 @@ public class Runtime {
|
||||
*
|
||||
* <h2><a id="verNum">Version numbers</a></h2>
|
||||
*
|
||||
* <p> A <em>version number</em>, {@code $VNUM}, is a non-empty sequence
|
||||
* of elements separated by period characters (U+002E). An element is
|
||||
* either zero, or an unsigned integer numeral without leading zeros. The
|
||||
* final element in a version number must not be zero. The format is:
|
||||
* </p>
|
||||
* <p> A <em>version number</em>, {@code $VNUM}, is a non-empty sequence of
|
||||
* elements separated by period characters (U+002E). An element is either
|
||||
* zero, or an unsigned integer numeral without leading zeros. The final
|
||||
* element in a version number must not be zero. When an element is
|
||||
* incremented, all subsequent elements are removed. The format is: </p>
|
||||
*
|
||||
* <blockquote><pre>
|
||||
* [1-9][0-9]*((\.0)*\.[1-9][0-9]*)*
|
||||
* </pre></blockquote>
|
||||
*
|
||||
* <p> The sequence may be of arbitrary length but the first three
|
||||
* elements are assigned specific meanings, as follows:</p>
|
||||
* <p> The sequence may be of arbitrary length but the first four elements
|
||||
* are assigned specific meanings, as follows:</p>
|
||||
*
|
||||
* <blockquote><pre>
|
||||
* $MAJOR.$MINOR.$SECURITY
|
||||
* $FEATURE.$INTERIM.$UPDATE.$PATCH
|
||||
* </pre></blockquote>
|
||||
*
|
||||
* <ul>
|
||||
*
|
||||
* <li><p> <a id="major">{@code $MAJOR}</a> --- The major version
|
||||
* number, incremented for a major release that contains significant new
|
||||
* features as specified in a new edition of the Java SE Platform
|
||||
* Specification, <em>e.g.</em>, <a
|
||||
* href="https://jcp.org/en/jsr/detail?id=337">JSR 337</a> for
|
||||
* Java SE 8. Features may be removed in a major release, given
|
||||
* advance notice at least one major release ahead of time, and
|
||||
* incompatible changes may be made when justified. The {@code $MAJOR}
|
||||
* version number of JDK 8 is {@code 8}; the {@code $MAJOR} version
|
||||
* number of JDK 9 is {@code 9}. When {@code $MAJOR} is incremented,
|
||||
* all subsequent elements are removed. </p></li>
|
||||
* <li><p> <a id="FEATURE">{@code $FEATURE}</a> — The
|
||||
* feature-release counter, incremented for every feature release
|
||||
* regardless of release content. Features may be added in a feature
|
||||
* release; they may also be removed, if advance notice was given at least
|
||||
* one feature release ahead of time. Incompatible changes may be made
|
||||
* when justified. </p></li>
|
||||
*
|
||||
* <li><p> <a id="minor">{@code $MINOR}</a> --- The minor version
|
||||
* number, incremented for a minor update release that may contain
|
||||
* compatible bug fixes, revisions to standard APIs mandated by a
|
||||
* <a href="https://jcp.org/en/procedures/jcp2#5.3">Maintenance Release</a>
|
||||
* of the relevant Platform Specification, and implementation features
|
||||
* outside the scope of that Specification such as new JDK-specific APIs,
|
||||
* additional service providers, new garbage collectors, and ports to new
|
||||
* hardware architectures. </p></li>
|
||||
* <li><p> <a id="INTERIM">{@code $INTERIM}</a> — The
|
||||
* interim-release counter, incremented for non-feature releases that
|
||||
* contain compatible bug fixes and enhancements but no incompatible
|
||||
* changes, no feature removals, and no changes to standard APIs.
|
||||
* </p></li>
|
||||
*
|
||||
* <li><p> <a id="security">{@code $SECURITY}</a> --- The security
|
||||
* level, incremented for a security update release that contains critical
|
||||
* fixes including those necessary to improve security. {@code $SECURITY}
|
||||
* is <strong>not</strong> reset when {@code $MINOR} is incremented. A
|
||||
* higher value of {@code $SECURITY} for a given {@code $MAJOR} value,
|
||||
* therefore, always indicates a more secure release, regardless of the
|
||||
* value of {@code $MINOR}. </p></li>
|
||||
* <li><p> <a id="UPDATE">{@code $UPDATE}</a> — The update-release
|
||||
* counter, incremented for compatible update releases that fix security
|
||||
* issues, regressions, and bugs in newer features. </p></li>
|
||||
*
|
||||
* <li><p> <a id="PATCH">{@code $PATCH}</a> — The emergency
|
||||
* patch-release counter, incremented only when it's necessary to produce
|
||||
* an emergency release to fix a critical issue. </p></li>
|
||||
*
|
||||
* </ul>
|
||||
*
|
||||
* <p> The fourth and later elements of a version number are free for use
|
||||
* by downstream consumers of this code base. Such a consumer may,
|
||||
* <em>e.g.</em>, use the fourth element to identify patch releases which
|
||||
* contain a small number of critical non-security fixes in addition to
|
||||
* the security fixes in the corresponding security release. </p>
|
||||
* <p> The fifth and later elements of a version number are free for use by
|
||||
* platform implementors, to identify implementor-specific patch
|
||||
* releases. </p>
|
||||
*
|
||||
* <p> The version number does not include trailing zero elements;
|
||||
* <em>i.e.</em>, {@code $SECURITY} is omitted if it has the value zero,
|
||||
* and {@code $MINOR} is omitted if both {@code $MINOR} and {@code
|
||||
* $SECURITY} have the value zero. </p>
|
||||
* <p> A version number never has trailing zero elements. If an element
|
||||
* and all those that follow it logically have the value zero then all of
|
||||
* them are omitted. </p>
|
||||
*
|
||||
* <p> The sequence of numerals in a version number is compared to another
|
||||
* such sequence in numerical, pointwise fashion; <em>e.g.</em>, {@code
|
||||
* 9.9.1} is less than {@code 9.10.3}. If one sequence is shorter than
|
||||
* another then the missing elements of the shorter sequence are
|
||||
* considered to be less than the corresponding elements of the longer
|
||||
* sequence; <em>e.g.</em>, {@code 9.1.2} is less than {@code 9.1.2.1}.
|
||||
* </p>
|
||||
* 10.0.4} is less than {@code 10.1.2}. If one sequence is shorter than
|
||||
* another then the missing elements of the shorter sequence are considered
|
||||
* to be less than the corresponding elements of the longer sequence;
|
||||
* <em>e.g.</em>, {@code 10.0.2} is less than {@code 10.0.2.1}. </p>
|
||||
*
|
||||
* <h2><a id="verStr">Version strings</a></h2>
|
||||
*
|
||||
* <p> A <em>version string</em>, {@code $VSTR}, consists of a version
|
||||
* number {@code $VNUM}, as described above, optionally followed by
|
||||
* pre-release and build information, in one of the following formats:
|
||||
* </p>
|
||||
* <p> A <em>version string</em>, {@code $VSTR}, is a version number {@code
|
||||
* $VNUM}, as described above, optionally followed by pre-release and build
|
||||
* information, in one of the following formats: </p>
|
||||
*
|
||||
* <blockquote><pre>
|
||||
* $VNUM(-$PRE)?\+$BUILD(-$OPT)?
|
||||
@ -986,19 +973,19 @@ public class Runtime {
|
||||
* <ul>
|
||||
*
|
||||
* <li><p> <a id="pre">{@code $PRE}</a>, matching {@code ([a-zA-Z0-9]+)}
|
||||
* --- A pre-release identifier. Typically {@code ea}, for a
|
||||
* potentially unstable early-access release under active development,
|
||||
* or {@code internal}, for an internal developer build. </p></li>
|
||||
* — A pre-release identifier. Typically {@code ea}, for a
|
||||
* potentially unstable early-access release under active development, or
|
||||
* {@code internal}, for an internal developer build. </p></li>
|
||||
*
|
||||
* <li><p> <a id="build">{@code $BUILD}</a>, matching {@code
|
||||
* (0|[1-9][0-9]*)} --- The build number, incremented for each promoted
|
||||
* (0|[1-9][0-9]*)} — The build number, incremented for each promoted
|
||||
* build. {@code $BUILD} is reset to {@code 1} when any portion of {@code
|
||||
* $VNUM} is incremented. </p></li>
|
||||
*
|
||||
* <li><p> <a id="opt">{@code $OPT}</a>, matching {@code
|
||||
* ([-a-zA-Z0-9.]+)} --- Additional build information, if desired. In
|
||||
* the case of an {@code internal} build this will often contain the date
|
||||
* and time of the build. </p></li>
|
||||
* <li><p> <a id="opt">{@code $OPT}</a>, matching {@code ([-a-zA-Z0-9.]+)}
|
||||
* — Additional build information, if desired. In the case of an
|
||||
* {@code internal} build this will often contain the date and time of the
|
||||
* build. </p></li>
|
||||
*
|
||||
* </ul>
|
||||
*
|
||||
@ -1082,7 +1069,7 @@ public class Runtime {
|
||||
throw new NullPointerException();
|
||||
|
||||
// Shortcut to avoid initializing VersionPattern when creating
|
||||
// major version constants during startup
|
||||
// feature-version constants during startup
|
||||
if (isSimpleNumber(s)) {
|
||||
return new Version(List.of(Integer.parseInt(s)),
|
||||
Optional.empty(), Optional.empty(), Optional.empty());
|
||||
@ -1139,43 +1126,114 @@ public class Runtime {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the <a href="#major">major</a> version number.
|
||||
* Returns the value of the <a href="#FEATURE">feature</a> element of
|
||||
* the version number.
|
||||
*
|
||||
* @return The major version number
|
||||
* @return The value of the feature element
|
||||
*
|
||||
* @since 10
|
||||
*/
|
||||
public int major() {
|
||||
public int feature() {
|
||||
return version.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the <a href="#minor">minor</a> version number or zero if it
|
||||
* was not set.
|
||||
* Returns the value of the <a href="#INTERIM">interim</a> element of
|
||||
* the version number, or zero if it is absent.
|
||||
*
|
||||
* @return The minor version number or zero if it was not set
|
||||
* @return The value of the interim element, or zero
|
||||
*
|
||||
* @since 10
|
||||
*/
|
||||
public int minor() {
|
||||
public int interim() {
|
||||
return (version.size() > 1 ? version.get(1) : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the <a href="#security">security</a> version number or zero
|
||||
* if it was not set.
|
||||
* Returns the value of the <a href="#UPDATE">update</a> element of the
|
||||
* version number, or zero if it is absent.
|
||||
*
|
||||
* @return The security version number or zero if it was not set
|
||||
* @return The value of the update element, or zero
|
||||
*
|
||||
* @since 10
|
||||
*/
|
||||
public int security() {
|
||||
public int update() {
|
||||
return (version.size() > 2 ? version.get(2) : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an unmodifiable {@link java.util.List List} of the
|
||||
* integer numerals contained in the <a href="#verNum">version
|
||||
* number</a>. The {@code List} always contains at least one
|
||||
* element corresponding to the <a href="#major">major version
|
||||
* number</a>.
|
||||
* Returns the value of the <a href="#PATCH">patch</a> element of the
|
||||
* version number, or zero if it is absent.
|
||||
*
|
||||
* @return An unmodifiable list of the integer numerals
|
||||
* contained in the version number
|
||||
* @return The value of the patch element, or zero
|
||||
*
|
||||
* @since 10
|
||||
*/
|
||||
public int patch() {
|
||||
return (version.size() > 3 ? version.get(3) : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of the major element of the version number.
|
||||
*
|
||||
* @deprecated As of Java SE 10, the first element of a version
|
||||
* number is not the major-release number but the feature-release
|
||||
* counter, incremented for every time-based release. Use the {@link
|
||||
* #feature()} method in preference to this method. For compatibility,
|
||||
* this method returns the value of the <a href="FEATURE">feature</a>
|
||||
* element.
|
||||
*
|
||||
* @return The value of the feature element
|
||||
*/
|
||||
@Deprecated(since = "10")
|
||||
public int major() {
|
||||
return feature();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of the minor element of the version number, or
|
||||
* zero if it is absent.
|
||||
*
|
||||
* @deprecated As of Java SE 10, the second element of a version
|
||||
* number is not the minor-release number but the interim-release
|
||||
* counter, incremented for every interim release. Use the {@link
|
||||
* #interim()} method in preference to this method. For compatibility,
|
||||
* this method returns the value of the <a href="INTERIM">interim</a>
|
||||
* element, or zero if it is absent.
|
||||
*
|
||||
* @return The value of the interim element, or zero
|
||||
*/
|
||||
@Deprecated(since = "10")
|
||||
public int minor() {
|
||||
return interim();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of the security element of the version number, or
|
||||
* zero if it is absent.
|
||||
*
|
||||
* @deprecated As of Java SE 10, the third element of a version
|
||||
* number is not the security level but the update-release counter,
|
||||
* incremented for every update release. Use the {@link #update()}
|
||||
* method in preference to this method. For compatibility, this method
|
||||
* returns the value of the <a href="UPDATE">update</a> element, or
|
||||
* zero if it is absent.
|
||||
*
|
||||
* @return The value of the update element, or zero
|
||||
*/
|
||||
@Deprecated(since = "10")
|
||||
public int security() {
|
||||
return update();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an unmodifiable {@link java.util.List List} of the integers
|
||||
* represented in the <a href="#verNum">version number</a>. The {@code
|
||||
* List} always contains at least one element corresponding to the <a
|
||||
* href="#feature">feature version number</a>.
|
||||
*
|
||||
* @return An unmodifiable list of the integers
|
||||
* represented in the version number
|
||||
*/
|
||||
public List<Integer> version() {
|
||||
return version;
|
||||
|
@ -550,8 +550,10 @@ public final class System {
|
||||
* System properties. The following properties are guaranteed to be defined:
|
||||
* <dl>
|
||||
* <dt>java.version <dd>Java version number
|
||||
* <dt>java.version.date <dd>Java version date
|
||||
* <dt>java.vendor <dd>Java vendor specific string
|
||||
* <dt>java.vendor.url <dd>Java vendor URL
|
||||
* <dt>java.vendor.version <dd>Java vendor version
|
||||
* <dt>java.home <dd>Java installation directory
|
||||
* <dt>java.class.version <dd>Java class version number
|
||||
* <dt>java.class.path <dd>Java classpath
|
||||
@ -591,12 +593,18 @@ public final class System {
|
||||
* </thead>
|
||||
* <tbody>
|
||||
* <tr><th scope="row"><code>java.version</code></th>
|
||||
* <td>Java Runtime Environment version which may be interpreted
|
||||
* <td>Java Runtime Environment version, which may be interpreted
|
||||
* as a {@link Runtime.Version}</td></tr>
|
||||
* <tr><th scope="row"><code>java.version.date</code></th>
|
||||
* <td>Java Runtime Environment version date, in ISO-8601 YYYY-MM-DD
|
||||
* format, which may be interpreted as a {@link
|
||||
* java.time.LocalDate}</td></tr>
|
||||
* <tr><th scope="row"><code>java.vendor</code></th>
|
||||
* <td>Java Runtime Environment vendor</td></tr>
|
||||
* <tr><th scope="row"><code>java.vendor.url</code></th>
|
||||
* <td>Java vendor URL</td></tr>
|
||||
* <tr><th scope="row"><code>java.vendor.version</code></th>
|
||||
* <td>Java vendor version</td></tr>
|
||||
* <tr><th scope="row"><code>java.home</code></th>
|
||||
* <td>Java installation directory</td></tr>
|
||||
* <tr><th scope="row"><code>java.vm.specification.version</code></th>
|
||||
|
@ -32,13 +32,15 @@ import java.util.Optional;
|
||||
|
||||
class VersionProps {
|
||||
|
||||
|
||||
private static final String launcher_name =
|
||||
"@@LAUNCHER_NAME@@";
|
||||
|
||||
private static final String java_version =
|
||||
"@@VERSION_SHORT@@";
|
||||
|
||||
private static final String java_version_date =
|
||||
"@@VERSION_DATE@@";
|
||||
|
||||
private static final String java_runtime_name =
|
||||
"@@RUNTIME_NAME@@";
|
||||
|
||||
@ -57,14 +59,27 @@ class VersionProps {
|
||||
private static final String VERSION_OPT =
|
||||
"@@VERSION_OPT@@";
|
||||
|
||||
private static final boolean isLTS =
|
||||
"@@VERSION_OPT@@".startsWith("LTS");
|
||||
|
||||
private static final String VENDOR_VERSION_STRING =
|
||||
"@@VENDOR_VERSION_STRING@@";
|
||||
|
||||
private static final String vendor_version =
|
||||
(VENDOR_VERSION_STRING.length() > 0
|
||||
? " " + VENDOR_VERSION_STRING : "");
|
||||
|
||||
static {
|
||||
init();
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
System.setProperty("java.version", java_version);
|
||||
System.setProperty("java.version.date", java_version_date);
|
||||
System.setProperty("java.runtime.version", java_runtime_version);
|
||||
System.setProperty("java.runtime.name", java_runtime_name);
|
||||
if (VENDOR_VERSION_STRING.length() > 0)
|
||||
System.setProperty("java.vendor.version", VENDOR_VERSION_STRING);
|
||||
}
|
||||
|
||||
private static int parseVersionNumber(String version, int prevIndex, int index) {
|
||||
@ -162,31 +177,36 @@ class VersionProps {
|
||||
|
||||
/* First line: platform version. */
|
||||
if (err) {
|
||||
ps.println(launcher_name + " version \"" + java_version + "\"");
|
||||
ps.println(launcher_name + " version \"" + java_version + "\""
|
||||
+ " " + java_version_date
|
||||
+ (isLTS ? " LTS" : ""));
|
||||
} else {
|
||||
/* Use a format more in line with GNU conventions */
|
||||
ps.println(launcher_name + " " + java_version);
|
||||
ps.println(launcher_name + " " + java_version
|
||||
+ " " + java_version_date
|
||||
+ (isLTS ? " LTS" : ""));
|
||||
}
|
||||
|
||||
/* Second line: runtime version (ie, libraries). */
|
||||
String jdk_debug_level = System.getProperty("jdk.debug", "release");
|
||||
/* Debug level is not printed for "release" builds */
|
||||
if ("release".equals(jdk_debug_level)) {
|
||||
/* Do not show debug level "release" builds */
|
||||
jdk_debug_level = "";
|
||||
} else {
|
||||
jdk_debug_level = jdk_debug_level + " ";
|
||||
}
|
||||
|
||||
ps.print(java_runtime_name + " (" + jdk_debug_level + "build " + java_runtime_version);
|
||||
|
||||
ps.println(')');
|
||||
ps.println(java_runtime_name + vendor_version
|
||||
+ " (" + jdk_debug_level + "build " + java_runtime_version + ")");
|
||||
|
||||
/* Third line: JVM information. */
|
||||
String java_vm_name = System.getProperty("java.vm.name");
|
||||
String java_vm_version = System.getProperty("java.vm.version");
|
||||
String java_vm_info = System.getProperty("java.vm.info");
|
||||
ps.println(java_vm_name + " (" + jdk_debug_level + "build " + java_vm_version + ", " +
|
||||
java_vm_info + ")");
|
||||
ps.println(java_vm_name + vendor_version
|
||||
+ " (" + jdk_debug_level + "build " + java_vm_version + ", "
|
||||
+ java_vm_info + ")");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
@ -112,9 +112,9 @@ import java.util.zip.ZipFile;
|
||||
* <li>
|
||||
* {@code jdk.util.jar.version} can be assigned a value that is the
|
||||
* {@code String} representation of a non-negative integer
|
||||
* {@code <= Runtime.version().major()}. The value is used to set the effective
|
||||
* {@code <= Runtime.version().feature()}. The value is used to set the effective
|
||||
* runtime version to something other than the default value obtained by
|
||||
* evaluating {@code Runtime.version().major()}. The effective runtime version
|
||||
* evaluating {@code Runtime.version().feature()}. The effective runtime version
|
||||
* is the version that the {@link JarFile#JarFile(File, boolean, int, Runtime.Version)}
|
||||
* constructor uses when the value of the last argument is
|
||||
* {@code JarFile.runtimeVersion()}.
|
||||
@ -143,7 +143,7 @@ import java.util.zip.ZipFile;
|
||||
public
|
||||
class JarFile extends ZipFile {
|
||||
private final static Runtime.Version BASE_VERSION;
|
||||
private final static int BASE_VERSION_MAJOR;
|
||||
private final static int BASE_VERSION_FEATURE;
|
||||
private final static Runtime.Version RUNTIME_VERSION;
|
||||
private final static boolean MULTI_RELEASE_ENABLED;
|
||||
private final static boolean MULTI_RELEASE_FORCED;
|
||||
@ -153,7 +153,7 @@ class JarFile extends ZipFile {
|
||||
private boolean jvInitialized;
|
||||
private boolean verify;
|
||||
private final Runtime.Version version; // current version
|
||||
private final int versionMajor; // version.major()
|
||||
private final int versionFeature; // version.feature()
|
||||
private boolean isMultiRelease; // is jar multi-release?
|
||||
|
||||
// indicates if Class-Path attribute present
|
||||
@ -170,14 +170,14 @@ class JarFile extends ZipFile {
|
||||
JUZFA = jdk.internal.misc.SharedSecrets.getJavaUtilZipFileAccess();
|
||||
// multi-release jar file versions >= 9
|
||||
BASE_VERSION = Runtime.Version.parse(Integer.toString(8));
|
||||
BASE_VERSION_MAJOR = BASE_VERSION.major();
|
||||
BASE_VERSION_FEATURE = BASE_VERSION.feature();
|
||||
String jarVersion = GetPropertyAction.privilegedGetProperty("jdk.util.jar.version");
|
||||
int runtimeVersion = Runtime.version().major();
|
||||
int runtimeVersion = Runtime.version().feature();
|
||||
if (jarVersion != null) {
|
||||
int jarVer = Integer.parseInt(jarVersion);
|
||||
runtimeVersion = (jarVer > runtimeVersion)
|
||||
? runtimeVersion
|
||||
: Math.max(jarVer, BASE_VERSION_MAJOR);
|
||||
: Math.max(jarVer, BASE_VERSION_FEATURE);
|
||||
}
|
||||
RUNTIME_VERSION = Runtime.Version.parse(Integer.toString(runtimeVersion));
|
||||
String enableMultiRelease = GetPropertyAction
|
||||
@ -224,10 +224,10 @@ class JarFile extends ZipFile {
|
||||
* Returns the version that represents the effective runtime versioned
|
||||
* configuration of a multi-release jar file.
|
||||
* <p>
|
||||
* By default the major version number of the returned {@code Version} will
|
||||
* be equal to the major version number of {@code Runtime.version()}.
|
||||
* By default the feature version number of the returned {@code Version} will
|
||||
* be equal to the feature version number of {@code Runtime.version()}.
|
||||
* However, if the {@code jdk.util.jar.version} property is set, the
|
||||
* returned {@code Version} is derived from that property and major version
|
||||
* returned {@code Version} is derived from that property and feature version
|
||||
* numbers may not be equal.
|
||||
*
|
||||
* @return the version that represents the runtime versioned configuration
|
||||
@ -322,7 +322,7 @@ class JarFile extends ZipFile {
|
||||
* <p>
|
||||
* The canonical form derived from the version parameter is
|
||||
* {@code Runtime.Version.parse(Integer.toString(n))} where {@code n} is
|
||||
* {@code Math.max(version.major(), JarFile.baseVersion().major())}.
|
||||
* {@code Math.max(version.feature(), JarFile.baseVersion().feature())}.
|
||||
*
|
||||
* @param file the jar file to be opened for reading
|
||||
* @param verify whether or not to verify the jar file if
|
||||
@ -341,17 +341,17 @@ class JarFile extends ZipFile {
|
||||
super(file, mode);
|
||||
this.verify = verify;
|
||||
Objects.requireNonNull(version);
|
||||
if (MULTI_RELEASE_FORCED || version.major() == RUNTIME_VERSION.major()) {
|
||||
if (MULTI_RELEASE_FORCED || version.feature() == RUNTIME_VERSION.feature()) {
|
||||
// This deals with the common case where the value from JarFile.runtimeVersion() is passed
|
||||
this.version = RUNTIME_VERSION;
|
||||
} else if (version.major() <= BASE_VERSION_MAJOR) {
|
||||
} else if (version.feature() <= BASE_VERSION_FEATURE) {
|
||||
// This also deals with the common case where the value from JarFile.baseVersion() is passed
|
||||
this.version = BASE_VERSION;
|
||||
} else {
|
||||
// Canonicalize
|
||||
this.version = Runtime.Version.parse(Integer.toString(version.major()));
|
||||
this.version = Runtime.Version.parse(Integer.toString(version.feature()));
|
||||
}
|
||||
this.versionMajor = this.version.major();
|
||||
this.versionFeature = this.version.feature();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -579,7 +579,7 @@ class JarFile extends ZipFile {
|
||||
// filter out dir META-INF/versions/ and META-INF/versions/*/
|
||||
// and any entry with version > 'version'
|
||||
if (index == -1 || index == (name.length() - 1) ||
|
||||
Integer.parseInt(name, off, index, 10) > versionMajor) {
|
||||
Integer.parseInt(name, off, index, 10) > versionFeature) {
|
||||
return null;
|
||||
}
|
||||
} catch (NumberFormatException x) {
|
||||
@ -592,11 +592,11 @@ class JarFile extends ZipFile {
|
||||
}
|
||||
|
||||
private JarEntry getVersionedEntry(String name, JarEntry je) {
|
||||
if (BASE_VERSION_MAJOR < versionMajor) {
|
||||
if (BASE_VERSION_FEATURE < versionFeature) {
|
||||
if (!name.startsWith(META_INF)) {
|
||||
// search for versioned entry
|
||||
int v = versionMajor;
|
||||
while (v > BASE_VERSION_MAJOR) {
|
||||
int v = versionFeature;
|
||||
while (v > BASE_VERSION_FEATURE) {
|
||||
JarFileEntry vje = getEntry0(META_INF_VERSIONS + v + "/" + name);
|
||||
if (vje != null) {
|
||||
return vje.withBasename(name);
|
||||
@ -673,7 +673,7 @@ class JarFile extends ZipFile {
|
||||
}
|
||||
|
||||
JarFileEntry realEntry() {
|
||||
if (isMultiRelease() && versionMajor != BASE_VERSION_MAJOR) {
|
||||
if (isMultiRelease() && versionFeature != BASE_VERSION_FEATURE) {
|
||||
String entryName = super.getName();
|
||||
return entryName == basename || entryName.equals(basename) ?
|
||||
this : new JarFileEntry(entryName, this);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 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
|
||||
@ -34,9 +34,9 @@
|
||||
JNIEXPORT void
|
||||
JDK_GetVersionInfo0(jdk_version_info* info, size_t info_size) {
|
||||
/* These VERSION_* macros are given by the build system */
|
||||
const unsigned int version_major = VERSION_MAJOR;
|
||||
const unsigned int version_minor = VERSION_MINOR;
|
||||
const unsigned int version_security = VERSION_SECURITY;
|
||||
const unsigned int version_major = VERSION_FEATURE;
|
||||
const unsigned int version_minor = VERSION_INTERIM;
|
||||
const unsigned int version_security = VERSION_UPDATE;
|
||||
const unsigned int version_patch = VERSION_PATCH;
|
||||
const unsigned int version_build = VERSION_BUILD;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2006, 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
|
||||
@ -181,7 +181,7 @@ public class AboutDialog extends InternalDialog {
|
||||
}
|
||||
|
||||
private static String getOnlineDocUrl() {
|
||||
String version = Integer.toString(Runtime.version().major());
|
||||
String version = Integer.toString(Runtime.version().feature());
|
||||
return Resources.format(Messages.HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL,
|
||||
version);
|
||||
}
|
||||
|
@ -448,13 +448,14 @@ public class JlinkTask {
|
||||
|
||||
// java.base version is different than the current runtime version
|
||||
version = Runtime.Version.parse(v.toString());
|
||||
if (Runtime.version().major() != version.major() ||
|
||||
Runtime.version().minor() != version.minor()) {
|
||||
if (Runtime.version().feature() != version.feature() ||
|
||||
Runtime.version().interim() != version.interim())
|
||||
{
|
||||
// jlink version and java.base version do not match.
|
||||
// We do not (yet) support this mode.
|
||||
throw new IllegalArgumentException(taskHelper.getMessage("err.jlink.version.mismatch",
|
||||
Runtime.version().major(), Runtime.version().minor(),
|
||||
version.major(), version.minor()));
|
||||
Runtime.version().feature(), Runtime.version().interim(),
|
||||
version.feature(), version.interim()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* 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
|
||||
@ -299,7 +299,7 @@ public final class Main extends Shell {
|
||||
private static String JAVADOC_BASE = "https://docs.oracle.com/javase/%d/docs/api/";
|
||||
private static void openBrowserForJavadoc(ScriptFunction browse, String relativeUrl) {
|
||||
try {
|
||||
final URI uri = new URI(String.format(JAVADOC_BASE, Runtime.version().major()) + relativeUrl);
|
||||
final URI uri = new URI(String.format(JAVADOC_BASE, Runtime.version().feature()) + relativeUrl);
|
||||
ScriptRuntime.apply(browse, null, uri);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
@ -70,14 +70,14 @@ class JarFileSystem extends ZipFileSystem {
|
||||
if (o instanceof String) {
|
||||
String s = (String)o;
|
||||
if (s.equals("runtime")) {
|
||||
version = Runtime.version().major();
|
||||
version = Runtime.version().feature();
|
||||
} else {
|
||||
version = Integer.parseInt(s);
|
||||
}
|
||||
} else if (o instanceof Integer) {
|
||||
version = (Integer)o;
|
||||
} else if (o instanceof Version) {
|
||||
version = ((Version)o).major();
|
||||
version = ((Version)o).feature();
|
||||
} else {
|
||||
throw new IllegalArgumentException("env parameter must be String, Integer, "
|
||||
+ "or Version");
|
||||
|
@ -38,6 +38,7 @@ import java.util.stream.Collectors;
|
||||
import static java.lang.System.out;
|
||||
|
||||
public class Basic {
|
||||
|
||||
private static final Class<? extends Throwable> IAE
|
||||
= IllegalArgumentException.class;
|
||||
private static final Class<? extends Throwable> NPE
|
||||
@ -51,17 +52,19 @@ public class Basic {
|
||||
|
||||
public static void main(String ... args) {
|
||||
|
||||
//// Tests for parse(), major(), minor(), security(), pre(),
|
||||
//// build(), optional(), version(), toString()
|
||||
// v M m sec pre bld opt
|
||||
//// Tests for parse(), feature(), interim(), update(), patch(),
|
||||
//// pre(), build(), optional(), version(), and toString()
|
||||
// v f i u p pre bld opt
|
||||
|
||||
// $VNUM
|
||||
test("9", 9, 0, 0, "", 0, "");
|
||||
test("9.1", 9, 1, 0, "", 0, "");
|
||||
test("9.0.1", 9, 0, 1, "", 0, "");
|
||||
test("404.1.2", 404, 1, 2, "", 0, "");
|
||||
test("9.1.2.3", 9, 1, 2, "", 0, "");
|
||||
test("1000.0.0.0.0.0.99999999", 1000, 0, 0, "", 0, "");
|
||||
test("9", 9, 0, 0, 0, "", 0, "");
|
||||
test("9.1", 9, 1, 0, 0, "", 0, "");
|
||||
test("9.0.1", 9, 0, 1, 0, "", 0, "");
|
||||
test("9.0.0.1", 9, 0, 0, 1, "", 0, "");
|
||||
test("9.0.0.0.1", 9, 0, 0, 0, "", 0, "");
|
||||
test("404.1.2", 404, 1, 2, 0, "", 0, "");
|
||||
test("9.1.2.3", 9, 1, 2, 3, "", 0, "");
|
||||
test("1000.0.0.0.0.0.99999999", 1000, 0, 0, 0, "", 0, "");
|
||||
|
||||
tryCatch(null, NPE);
|
||||
tryCatch("", IAE);
|
||||
@ -75,23 +78,23 @@ public class Basic {
|
||||
tryCatch(TOO_BIG_STR, NFE);
|
||||
|
||||
// $PRE
|
||||
test("9-ea", 9, 0, 0, "ea", 0, "");
|
||||
test("9-internal", 9, 0, 0, "internal", 0, "");
|
||||
test("9-0", 9, 0, 0, "0", 0, "");
|
||||
test("9.2.7-8", 9, 2, 7, "8", 0, "");
|
||||
test("1-ALL", 1, 0, 0, "ALL", 0, "");
|
||||
test("2.3.4.5-1a", 2, 3, 4, "1a", 0, "");
|
||||
test("1-" + TOO_BIG_STR, 1, 0, 0, TOO_BIG_STR, 0, "");
|
||||
test("9-ea", 9, 0, 0, 0, "ea", 0, "");
|
||||
test("9-internal", 9, 0, 0, 0, "internal", 0, "");
|
||||
test("9-0", 9, 0, 0, 0, "0", 0, "");
|
||||
test("9.2.7-8", 9, 2, 7, 0, "8", 0, "");
|
||||
test("1-ALL", 1, 0, 0, 0, "ALL", 0, "");
|
||||
test("2.3.4.5-1a", 2, 3, 4, 5, "1a", 0, "");
|
||||
test("1-" + TOO_BIG_STR, 1, 0, 0, 0, TOO_BIG_STR, 0, "");
|
||||
|
||||
tryCatch("9:-ea", IAE);
|
||||
tryCatch("3.14159-", IAE);
|
||||
tryCatch("3.14159-%", IAE);
|
||||
|
||||
// $BUILD
|
||||
test("9+0", 9, 0, 0, "", 0, "");
|
||||
test("3.14+9999900", 3, 14, 0, "", 9999900, "");
|
||||
test("9-pre+105", 9, 0, 0, "pre", 105, "");
|
||||
test("6.0.42-8beta+4", 6, 0, 42, "8beta", 4, "");
|
||||
test("9+0", 9, 0, 0, 0, "", 0, "");
|
||||
test("3.14+9999900", 3, 14, 0, 0, "", 9999900, "");
|
||||
test("9-pre+105", 9, 0, 0, 0, "pre", 105, "");
|
||||
test("6.0.42-8beta+4", 6, 0, 42, 0, "8beta", 4, "");
|
||||
|
||||
tryCatch("9+", IAE);
|
||||
tryCatch("7+a", IAE);
|
||||
@ -101,13 +104,13 @@ public class Basic {
|
||||
tryCatch("1+" + TOO_BIG_STR, NFE);
|
||||
|
||||
// $OPT
|
||||
test("9+-foo", 9, 0, 0, "", 0, "foo");
|
||||
test("9-pre-opt", 9, 0, 0, "pre", 0, "opt");
|
||||
test("42+---bar", 42, 0, 0, "", 0, "--bar");
|
||||
test("2.91+-8061493-", 2, 91, 0, "", 0, "8061493-");
|
||||
test("24+-foo.bar", 24, 0, 0, "", 0, "foo.bar");
|
||||
test("9-ribbit+17-...", 9, 0, 0, "ribbit", 17, "...");
|
||||
test("7+1-" + TOO_BIG_STR, 7,0, 0, "", 1, TOO_BIG_STR);
|
||||
test("9+-foo", 9, 0, 0, 0, "", 0, "foo");
|
||||
test("9-pre-opt", 9, 0, 0, 0, "pre", 0, "opt");
|
||||
test("42+---bar", 42, 0, 0, 0, "", 0, "--bar");
|
||||
test("2.91+-8061493-", 2, 91, 0, 0, "", 0, "8061493-");
|
||||
test("24+-foo.bar", 24, 0, 0, 0, "", 0, "foo.bar");
|
||||
test("9-ribbit+17-...", 9, 0, 0, 0, "ribbit", 17, "...");
|
||||
test("7+1-" + TOO_BIG_STR, 7,0, 0, 0, "", 1, TOO_BIG_STR);
|
||||
|
||||
tryCatch("9-pre+-opt", IAE);
|
||||
tryCatch("1.4142+-", IAE);
|
||||
@ -127,6 +130,8 @@ public class Basic {
|
||||
testEHC("9", "8", false, false, 1, 1);
|
||||
|
||||
testEHC("10.512.1", "10.512.2", false, false, -1, -1);
|
||||
testEHC("10.512.0.1", "10.512.0.2", false, false, -1, -1);
|
||||
testEHC("10.512.0.0.1", "10.512.0.0.2", false, false, -1, -1);
|
||||
testEHC("512.10.1", "512.11.1", false, false, -1, -1);
|
||||
|
||||
// $OPT comparison
|
||||
@ -164,17 +169,21 @@ public class Basic {
|
||||
|
||||
}
|
||||
|
||||
private static void test(String s, Integer major, Integer minor,
|
||||
Integer sec, String pre, Integer build,
|
||||
String opt)
|
||||
private static void test(String s, Integer feature, Integer interim,
|
||||
Integer update, Integer patch,
|
||||
String pre, Integer build, String opt)
|
||||
{
|
||||
Version v = testParse(s);
|
||||
|
||||
testStr(v.toString(), s);
|
||||
|
||||
testInt(v.major(), major);
|
||||
testInt(v.minor(), minor);
|
||||
testInt(v.security(), sec);
|
||||
testInt(v.feature(), feature);
|
||||
testInt(v.major(), feature);
|
||||
testInt(v.interim(), interim);
|
||||
testInt(v.minor(), interim);
|
||||
testInt(v.update(), update);
|
||||
testInt(v.security(), update);
|
||||
testInt(v.patch(), patch);
|
||||
testStr((v.pre().isPresent() ? v.pre().get() : ""), pre);
|
||||
testInt((v.build().isPresent() ? v.build().get() : 0), build);
|
||||
testStr((v.optional().isPresent() ? v.optional().get() : ""), opt);
|
||||
@ -381,4 +390,5 @@ public class Basic {
|
||||
first = x;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user