8252145: Unify Info.plist files with correct version strings

Reviewed-by: ihse, serb
This commit is contained in:
Erik Joelsson 2020-08-28 06:23:41 -07:00
parent 30c2dbea95
commit 7df86108cb
9 changed files with 91 additions and 74 deletions

View File

@ -38,11 +38,8 @@ ifeq ($(call isTargetOs, macosx), true)
MACOSX_PLIST_SRC := $(TOPDIR)/make/data/bundle MACOSX_PLIST_SRC := $(TOPDIR)/make/data/bundle
BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(VERSION_SHORT)
BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(VERSION_SHORT) BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(VERSION_SHORT)
BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(VERSION_STRING) BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(VERSION_STRING)
BUNDLE_PLATFORM_VERSION := $(VERSION_FEATURE).$(VERSION_INTERIM)
BUNDLE_VERSION := $(VERSION_NUMBER)
ifeq ($(COMPANY_NAME), N/A) ifeq ($(COMPANY_NAME), N/A)
BUNDLE_VENDOR := UNDEFINED BUNDLE_VENDOR := UNDEFINED
else else
@ -75,24 +72,26 @@ ifeq ($(call isTargetOs, macosx), true)
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist, \ SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist, \
OUTPUT_FILE := $(JDK_MACOSX_CONTENTS_DIR)/Info.plist, \ OUTPUT_FILE := $(JDK_MACOSX_CONTENTS_DIR)/Info.plist, \
REPLACEMENTS := \ REPLACEMENTS := \
@@ID@@ => $(BUNDLE_ID).jdk ; \ @@ID@@ => $(MACOSX_BUNDLE_ID_BASE).jdk ; \
@@NAME@@ => $(BUNDLE_NAME) ; \ @@NAME@@ => $(BUNDLE_NAME) ; \
@@INFO@@ => $(BUNDLE_INFO) ; \ @@INFO@@ => $(BUNDLE_INFO) ; \
@@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \ @@VERSION@@ => $(VERSION_NUMBER) ; \
@@VERSION@@ => $(BUNDLE_VERSION) ; \ @@BUILD_VERSION@@ => $(MACOSX_BUNDLE_BUILD_VERSION) ; \
@@VENDOR@@ => $(BUNDLE_VENDOR) , \ @@VENDOR@@ => $(BUNDLE_VENDOR) ; \
@@MACOSX_VERSION_MIN@@ => $(MACOSX_VERSION_MIN) , \
)) ))
$(eval $(call SetupTextFileProcessing, BUILD_JRE_PLIST, \ $(eval $(call SetupTextFileProcessing, BUILD_JRE_PLIST, \
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JRE-Info.plist, \ SOURCE_FILES := $(MACOSX_PLIST_SRC)/JRE-Info.plist, \
OUTPUT_FILE := $(JRE_MACOSX_CONTENTS_DIR)/Info.plist, \ OUTPUT_FILE := $(JRE_MACOSX_CONTENTS_DIR)/Info.plist, \
REPLACEMENTS := \ REPLACEMENTS := \
@@ID@@ => $(BUNDLE_ID).jre ; \ @@ID@@ => $(MACOSX_BUNDLE_ID_BASE).jre ; \
@@NAME@@ => $(BUNDLE_NAME) ; \ @@NAME@@ => $(BUNDLE_NAME) ; \
@@INFO@@ => $(BUNDLE_INFO) ; \ @@INFO@@ => $(BUNDLE_INFO) ; \
@@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \ @@VERSION@@ => $(VERSION_NUMBER) ; \
@@VERSION@@ => $(BUNDLE_VERSION) ; \ @@BUILD_VERSION@@ => $(BUNDLE_BUILD_VERSION) ; \
@@VENDOR@@ => $(BUNDLE_VENDOR) , \ @@VENDOR@@ => $(BUNDLE_VENDOR) ; \
@@MACOSX_VERSION_MIN@@ => $(MACOSX_VERSION_MIN) , \
)) ))
$(SUPPORT_OUTPUTDIR)/images/_jdk_bundle_attribute_set: $(COPY_JDK_IMAGE) $(SUPPORT_OUTPUTDIR)/images/_jdk_bundle_attribute_set: $(COPY_JDK_IMAGE)

View File

@ -67,34 +67,6 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
AC_SUBST(JDK_RC_PLATFORM_NAME) AC_SUBST(JDK_RC_PLATFORM_NAME)
AC_SUBST(HOTSPOT_VM_DISTRO) AC_SUBST(HOTSPOT_VM_DISTRO)
# Set the MACOSX Bundle Name base
AC_ARG_WITH(macosx-bundle-name-base, [AS_HELP_STRING([--with-macosx-bundle-name-base],
[Set the MacOSX Bundle Name base. This is the base name for calculating MacOSX Bundle Names.
@<:@not specified@:>@])])
if test "x$with_macosx_bundle_name_base" = xyes; then
AC_MSG_ERROR([--with-macosx-bundle-name-base must have a value])
elif [ ! [[ $with_macosx_bundle_name_base =~ ^[[:print:]]*$ ]] ]; then
AC_MSG_ERROR([--with-macosx-bundle-name-base contains non-printing characters: $with_macosx_bundle_name_base])
elif test "x$with_macosx_bundle_name_base" != x; then
# Set MACOSX_BUNDLE_NAME_BASE to the configured value.
MACOSX_BUNDLE_NAME_BASE="$with_macosx_bundle_name_base"
fi
AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
# Set the MACOSX Bundle ID base
AC_ARG_WITH(macosx-bundle-id-base, [AS_HELP_STRING([--with-macosx-bundle-id-base],
[Set the MacOSX Bundle ID base. This is the base ID for calculating MacOSX Bundle IDs.
@<:@not specified@:>@])])
if test "x$with_macosx_bundle_id_base" = xyes; then
AC_MSG_ERROR([--with-macosx-bundle-id-base must have a value])
elif [ ! [[ $with_macosx_bundle_id_base =~ ^[[:print:]]*$ ]] ]; then
AC_MSG_ERROR([--with-macosx-bundle-id-base contains non-printing characters: $with_macosx_bundle_id_base])
elif test "x$with_macosx_bundle_id_base" != x; then
# Set MACOSX_BUNDLE_ID_BASE to the configured value.
MACOSX_BUNDLE_ID_BASE="$with_macosx_bundle_id_base"
fi
AC_SUBST(MACOSX_BUNDLE_ID_BASE)
# Set the JDK RC name # Set the JDK RC name
AC_ARG_WITH(jdk-rc-name, [AS_HELP_STRING([--with-jdk-rc-name], AC_ARG_WITH(jdk-rc-name, [AS_HELP_STRING([--with-jdk-rc-name],
[Set JDK RC name. This is used for FileDescription and ProductName properties [Set JDK RC name. This is used for FileDescription and ProductName properties
@ -502,6 +474,60 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
VENDOR_VERSION_STRING="$with_vendor_version_string" VENDOR_VERSION_STRING="$with_vendor_version_string"
fi fi
# Set the MACOSX Bundle Name base
AC_ARG_WITH(macosx-bundle-name-base, [AS_HELP_STRING([--with-macosx-bundle-name-base],
[Set the MacOSX Bundle Name base. This is the base name for calculating MacOSX Bundle Names.
@<:@not specified@:>@])])
if test "x$with_macosx_bundle_name_base" = xyes; then
AC_MSG_ERROR([--with-macosx-bundle-name-base must have a value])
elif [ ! [[ $with_macosx_bundle_name_base =~ ^[[:print:]]*$ ]] ]; then
AC_MSG_ERROR([--with-macosx-bundle-name-base contains non-printing characters: $with_macosx_bundle_name_base])
elif test "x$with_macosx_bundle_name_base" != x; then
# Set MACOSX_BUNDLE_NAME_BASE to the configured value.
MACOSX_BUNDLE_NAME_BASE="$with_macosx_bundle_name_base"
fi
AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
# Set the MACOSX Bundle ID base
AC_ARG_WITH(macosx-bundle-id-base, [AS_HELP_STRING([--with-macosx-bundle-id-base],
[Set the MacOSX Bundle ID base. This is the base ID for calculating MacOSX Bundle IDs.
@<:@not specified@:>@])])
if test "x$with_macosx_bundle_id_base" = xyes; then
AC_MSG_ERROR([--with-macosx-bundle-id-base must have a value])
elif [ ! [[ $with_macosx_bundle_id_base =~ ^[[:print:]]*$ ]] ]; then
AC_MSG_ERROR([--with-macosx-bundle-id-base contains non-printing characters: $with_macosx_bundle_id_base])
elif test "x$with_macosx_bundle_id_base" != x; then
# Set MACOSX_BUNDLE_ID_BASE to the configured value.
MACOSX_BUNDLE_ID_BASE="$with_macosx_bundle_id_base"
else
# If using the default value, append the VERSION_PRE if there is one
# to make it possible to tell official builds apart from developer builds
if test "x$VERSION_PRE" != x; then
MACOSX_BUNDLE_ID_BASE="$MACOSX_BUNDLE_ID_BASE-$VERSION_PRE"
fi
fi
AC_SUBST(MACOSX_BUNDLE_ID_BASE)
# Set the MACOSX CFBundleVersion field
AC_ARG_WITH(macosx-bundle-build-version, [AS_HELP_STRING([--with-macosx-bundle-build-version],
[Set the MacOSX Bundle CFBundleVersion field. This key is a machine-readable
string composed of one to three period-separated integers and should represent the
build version. Defaults to the build number.])])
if test "x$with_macosx_bundle_build_version" = xyes; then
AC_MSG_ERROR([--with-macosx-bundle-build-version must have a value])
elif [ ! [[ $with_macosx_bundle_build_version =~ ^[0-9\.]*$ ]] ]; then
AC_MSG_ERROR([--with-macosx-bundle-build-version contains non numbers and periods: $with_macosx_bundle_build_version])
elif test "x$with_macosx_bundle_build_version" != x; then
MACOSX_BUNDLE_BUILD_VERSION="$with_macosx_bundle_build_version"
else
MACOSX_BUNDLE_BUILD_VERSION="$VERSION_BUILD"
# If VERSION_OPT consists of only numbers and periods, add it.
if [ [[ $VERSION_OPT =~ ^[0-9\.]+$ ]] ]; then
MACOSX_BUNDLE_BUILD_VERSION+=".$VERSION_OPT"
fi
fi
AC_SUBST(MACOSX_BUNDLE_BUILD_VERSION)
# We could define --with flags for these, if really needed # We could define --with flags for these, if really needed
VERSION_CLASSFILE_MAJOR="$DEFAULT_VERSION_CLASSFILE_MAJOR" VERSION_CLASSFILE_MAJOR="$DEFAULT_VERSION_CLASSFILE_MAJOR"
VERSION_CLASSFILE_MINOR="$DEFAULT_VERSION_CLASSFILE_MINOR" VERSION_CLASSFILE_MINOR="$DEFAULT_VERSION_CLASSFILE_MINOR"

View File

@ -170,6 +170,7 @@ COMPANY_NAME:=@COMPANY_NAME@
HOTSPOT_VM_DISTRO:=@HOTSPOT_VM_DISTRO@ HOTSPOT_VM_DISTRO:=@HOTSPOT_VM_DISTRO@
MACOSX_BUNDLE_NAME_BASE=@MACOSX_BUNDLE_NAME_BASE@ MACOSX_BUNDLE_NAME_BASE=@MACOSX_BUNDLE_NAME_BASE@
MACOSX_BUNDLE_ID_BASE=@MACOSX_BUNDLE_ID_BASE@ MACOSX_BUNDLE_ID_BASE=@MACOSX_BUNDLE_ID_BASE@
MACOSX_BUNDLE_BUILD_VERSION=@MACOSX_BUNDLE_BUILD_VERSION@
USERNAME:=@USERNAME@ USERNAME:=@USERNAME@
VENDOR_URL:=@VENDOR_URL@ VENDOR_URL:=@VENDOR_URL@
VENDOR_URL_BUG:=@VENDOR_URL_BUG@ VENDOR_URL_BUG:=@VENDOR_URL_BUG@

View File

@ -102,19 +102,19 @@ define SetupBuildLauncherBody
ifeq ($(call isTargetOs, macosx), true) ifeq ($(call isTargetOs, macosx), true)
ifeq ($$($1_MACOSX_PRIVILEGED), true) ifeq ($$($1_MACOSX_PRIVILEGED), true)
$1_PLIST_SRC_FILE := Info-privileged.plist $1_PLIST_EXTRA := <key>SecTaskAccess</key><string>allowed</string>
else
$1_PLIST_SRC_FILE := Info-cmdline.plist
endif endif
$1_PLIST_FILE := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$1/Info.plist $1_PLIST_FILE := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$1/Info.plist
$$(eval $$(call SetupTextFileProcessing, BUILD_PLIST_$1, \ $$(eval $$(call SetupTextFileProcessing, BUILD_PLIST_$1, \
SOURCE_FILES := $$(TOPDIR)/src/java.base/macosx/native/launcher/$$($1_PLIST_SRC_FILE), \ SOURCE_FILES := $(TOPDIR)/make/data/bundle/cmdline-Info.plist, \
OUTPUT_FILE := $$($1_PLIST_FILE), \ OUTPUT_FILE := $$($1_PLIST_FILE), \
REPLACEMENTS := \ REPLACEMENTS := \
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).$(VERSION_SHORT).$1 ; \ @@ID@@ => $(MACOSX_BUNDLE_ID_BASE).$1 ; \
@@VERSION@@ => $(VERSION_NUMBER) ; \ @@VERSION@@ => $(VERSION_NUMBER) ; \
@@BUILD_VERSION@@ => $(MACOSX_BUNDLE_BUILD_VERSION) ; \
@@EXTRA@@ => $$($1_PLIST_EXTRA), \
)) ))
$1_LDFLAGS += -sectcreate __TEXT __info_plist $$($1_PLIST_FILE) $1_LDFLAGS += -sectcreate __TEXT __info_plist $$($1_PLIST_FILE)
@ -187,6 +187,10 @@ define SetupBuildLauncherBody
$$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, java, /libjava) \ $$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, java, /libjava) \
$$($1_WINDOWS_JLI_LIB) $$($1_WINDOWS_JLI_LIB)
endif endif
ifeq ($(call isTargetOs, macosx), true)
$$(BUILD_LAUNCHER_$1): $$($1_PLIST_FILE)
endif
endef endef
################################################################################ ################################################################################

View File

@ -1339,13 +1339,17 @@ var versionArgs = function(input, common) {
"--with-version-pre=" + version_numbers.get("DEFAULT_PROMOTED_VERSION_PRE"), "--with-version-pre=" + version_numbers.get("DEFAULT_PROMOTED_VERSION_PRE"),
"--without-version-opt"); "--without-version-opt");
} else if (input.build_type == "ci") { } else if (input.build_type == "ci") {
var optString = input.build_id_data.ciBuildNumber; var ciBuildNumber = input.build_id_data.ciBuildNumber;
var preString = input.build_id_data.projectName; var preString = input.build_id_data.projectName;
if (preString == "jdk") { if (preString == "jdk") {
preString = version_numbers.get("DEFAULT_PROMOTED_VERSION_PRE"); preString = version_numbers.get("DEFAULT_PROMOTED_VERSION_PRE");
} }
args = concat(args, "--with-version-pre=" + preString, args = concat(args, "--with-version-pre=" + preString,
"--with-version-opt=" + optString); "--with-version-opt=" + ciBuildNumber);
if (input.target_os == "macosx") {
args = concat(args, "--with-macosx-bundle-build-version="
+ common.build_number + "." + ciBuildNumber);
}
} else { } else {
args = concat(args, "--with-version-opt=" + common.build_id); args = concat(args, "--with-version-opt=" + common.build_id);
} }

View File

@ -17,11 +17,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>BNDL</string> <string>BNDL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0</string> <string>@@VERSION@@</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>@@VERSION@@</string> <string>@@BUILD_VERSION@@</string>
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<string>The application is requesting access to the microphone.</string> <string>The application is requesting access to the microphone.</string>
<key>JavaVM</key> <key>JavaVM</key>
@ -33,9 +33,9 @@
<key>JVMMinimumFrameworkVersion</key> <key>JVMMinimumFrameworkVersion</key>
<string>13.2.9</string> <string>13.2.9</string>
<key>JVMMinimumSystemVersion</key> <key>JVMMinimumSystemVersion</key>
<string>10.6.0</string> <string>@@MACOSX_VERSION_MIN@@</string>
<key>JVMPlatformVersion</key> <key>JVMPlatformVersion</key>
<string>@@PLATFORM_VERSION@@</string> <string>@@VERSION@@</string>
<key>JVMVendor</key> <key>JVMVendor</key>
<string>@@VENDOR@@</string> <string>@@VENDOR@@</string>
<key>JVMVersion</key> <key>JVMVersion</key>

View File

@ -17,11 +17,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>BNDL</string> <string>BNDL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0</string> <string>@@VERSION@@</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>@@VERSION@@</string> <string>@@BUILD_VERSION@@</string>
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<string>The application is requesting access to the microphone.</string> <string>The application is requesting access to the microphone.</string>
<key>JavaVM</key> <key>JavaVM</key>
@ -29,9 +29,9 @@
<key>JVMMinimumFrameworkVersion</key> <key>JVMMinimumFrameworkVersion</key>
<string>13.2.9</string> <string>13.2.9</string>
<key>JVMMinimumSystemVersion</key> <key>JVMMinimumSystemVersion</key>
<string>10.6.0</string> <string>@@MACOSX_VERSION_MIN@@</string>
<key>JVMPlatformVersion</key> <key>JVMPlatformVersion</key>
<string>@@PLATFORM_VERSION@@</string> <string>@@VERSION@@</string>
<key>JVMVendor</key> <key>JVMVendor</key>
<string>@@VENDOR@@</string> <string>@@VENDOR@@</string>
<key>JVMVersion</key> <key>JVMVersion</key>

View File

@ -7,10 +7,11 @@
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>@@VERSION@@</string> <string>@@VERSION@@</string>
<key>CFBundleVersion</key>
<string>@@BUILD_VERSION@@</string>
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<string>The application is requesting access to the microphone.</string> <string>The application is requesting access to the microphone.</string>
@@EXTRA@@
</dict> </dict>
</plist> </plist>

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>@@ID@@</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>OpenJDK Command</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>@@VERSION@@</string>
<key>SecTaskAccess</key>
<string>allowed</string>
</dict>
</plist>