Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit 02857c2

Browse files
committedAug 28, 2020
8252145: Unify Info.plist files with correct version strings
Reviewed-by: ihse, serb
1 parent fa036c8 commit 02857c2

File tree

9 files changed

+91
-74
lines changed

9 files changed

+91
-74
lines changed
 

‎make/MacBundles.gmk

+10-11
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,8 @@ ifeq ($(call isTargetOs, macosx), true)
3838

3939
MACOSX_PLIST_SRC := $(TOPDIR)/make/data/bundle
4040

41-
BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(VERSION_SHORT)
4241
BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(VERSION_SHORT)
4342
BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(VERSION_STRING)
44-
BUNDLE_PLATFORM_VERSION := $(VERSION_FEATURE).$(VERSION_INTERIM)
45-
BUNDLE_VERSION := $(VERSION_NUMBER)
4643
ifeq ($(COMPANY_NAME), N/A)
4744
BUNDLE_VENDOR := UNDEFINED
4845
else
@@ -75,24 +72,26 @@ ifeq ($(call isTargetOs, macosx), true)
7572
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist, \
7673
OUTPUT_FILE := $(JDK_MACOSX_CONTENTS_DIR)/Info.plist, \
7774
REPLACEMENTS := \
78-
@@ID@@ => $(BUNDLE_ID).jdk ; \
75+
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).jdk ; \
7976
@@NAME@@ => $(BUNDLE_NAME) ; \
8077
@@INFO@@ => $(BUNDLE_INFO) ; \
81-
@@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \
82-
@@VERSION@@ => $(BUNDLE_VERSION) ; \
83-
@@VENDOR@@ => $(BUNDLE_VENDOR) , \
78+
@@VERSION@@ => $(VERSION_NUMBER) ; \
79+
@@BUILD_VERSION@@ => $(MACOSX_BUNDLE_BUILD_VERSION) ; \
80+
@@VENDOR@@ => $(BUNDLE_VENDOR) ; \
81+
@@MACOSX_VERSION_MIN@@ => $(MACOSX_VERSION_MIN) , \
8482
))
8583

8684
$(eval $(call SetupTextFileProcessing, BUILD_JRE_PLIST, \
8785
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JRE-Info.plist, \
8886
OUTPUT_FILE := $(JRE_MACOSX_CONTENTS_DIR)/Info.plist, \
8987
REPLACEMENTS := \
90-
@@ID@@ => $(BUNDLE_ID).jre ; \
88+
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).jre ; \
9189
@@NAME@@ => $(BUNDLE_NAME) ; \
9290
@@INFO@@ => $(BUNDLE_INFO) ; \
93-
@@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \
94-
@@VERSION@@ => $(BUNDLE_VERSION) ; \
95-
@@VENDOR@@ => $(BUNDLE_VENDOR) , \
91+
@@VERSION@@ => $(VERSION_NUMBER) ; \
92+
@@BUILD_VERSION@@ => $(BUNDLE_BUILD_VERSION) ; \
93+
@@VENDOR@@ => $(BUNDLE_VENDOR) ; \
94+
@@MACOSX_VERSION_MIN@@ => $(MACOSX_VERSION_MIN) , \
9695
))
9796

9897
$(SUPPORT_OUTPUTDIR)/images/_jdk_bundle_attribute_set: $(COPY_JDK_IMAGE)

‎make/autoconf/jdk-version.m4

+54-28
Original file line numberDiff line numberDiff line change
@@ -67,34 +67,6 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
6767
AC_SUBST(JDK_RC_PLATFORM_NAME)
6868
AC_SUBST(HOTSPOT_VM_DISTRO)
6969
70-
# Set the MACOSX Bundle Name base
71-
AC_ARG_WITH(macosx-bundle-name-base, [AS_HELP_STRING([--with-macosx-bundle-name-base],
72-
[Set the MacOSX Bundle Name base. This is the base name for calculating MacOSX Bundle Names.
73-
@<:@not specified@:>@])])
74-
if test "x$with_macosx_bundle_name_base" = xyes; then
75-
AC_MSG_ERROR([--with-macosx-bundle-name-base must have a value])
76-
elif [ ! [[ $with_macosx_bundle_name_base =~ ^[[:print:]]*$ ]] ]; then
77-
AC_MSG_ERROR([--with-macosx-bundle-name-base contains non-printing characters: $with_macosx_bundle_name_base])
78-
elif test "x$with_macosx_bundle_name_base" != x; then
79-
# Set MACOSX_BUNDLE_NAME_BASE to the configured value.
80-
MACOSX_BUNDLE_NAME_BASE="$with_macosx_bundle_name_base"
81-
fi
82-
AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
83-
84-
# Set the MACOSX Bundle ID base
85-
AC_ARG_WITH(macosx-bundle-id-base, [AS_HELP_STRING([--with-macosx-bundle-id-base],
86-
[Set the MacOSX Bundle ID base. This is the base ID for calculating MacOSX Bundle IDs.
87-
@<:@not specified@:>@])])
88-
if test "x$with_macosx_bundle_id_base" = xyes; then
89-
AC_MSG_ERROR([--with-macosx-bundle-id-base must have a value])
90-
elif [ ! [[ $with_macosx_bundle_id_base =~ ^[[:print:]]*$ ]] ]; then
91-
AC_MSG_ERROR([--with-macosx-bundle-id-base contains non-printing characters: $with_macosx_bundle_id_base])
92-
elif test "x$with_macosx_bundle_id_base" != x; then
93-
# Set MACOSX_BUNDLE_ID_BASE to the configured value.
94-
MACOSX_BUNDLE_ID_BASE="$with_macosx_bundle_id_base"
95-
fi
96-
AC_SUBST(MACOSX_BUNDLE_ID_BASE)
97-
9870
# Set the JDK RC name
9971
AC_ARG_WITH(jdk-rc-name, [AS_HELP_STRING([--with-jdk-rc-name],
10072
[Set JDK RC name. This is used for FileDescription and ProductName properties
@@ -502,6 +474,60 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
502474
VENDOR_VERSION_STRING="$with_vendor_version_string"
503475
fi
504476
477+
# Set the MACOSX Bundle Name base
478+
AC_ARG_WITH(macosx-bundle-name-base, [AS_HELP_STRING([--with-macosx-bundle-name-base],
479+
[Set the MacOSX Bundle Name base. This is the base name for calculating MacOSX Bundle Names.
480+
@<:@not specified@:>@])])
481+
if test "x$with_macosx_bundle_name_base" = xyes; then
482+
AC_MSG_ERROR([--with-macosx-bundle-name-base must have a value])
483+
elif [ ! [[ $with_macosx_bundle_name_base =~ ^[[:print:]]*$ ]] ]; then
484+
AC_MSG_ERROR([--with-macosx-bundle-name-base contains non-printing characters: $with_macosx_bundle_name_base])
485+
elif test "x$with_macosx_bundle_name_base" != x; then
486+
# Set MACOSX_BUNDLE_NAME_BASE to the configured value.
487+
MACOSX_BUNDLE_NAME_BASE="$with_macosx_bundle_name_base"
488+
fi
489+
AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
490+
491+
# Set the MACOSX Bundle ID base
492+
AC_ARG_WITH(macosx-bundle-id-base, [AS_HELP_STRING([--with-macosx-bundle-id-base],
493+
[Set the MacOSX Bundle ID base. This is the base ID for calculating MacOSX Bundle IDs.
494+
@<:@not specified@:>@])])
495+
if test "x$with_macosx_bundle_id_base" = xyes; then
496+
AC_MSG_ERROR([--with-macosx-bundle-id-base must have a value])
497+
elif [ ! [[ $with_macosx_bundle_id_base =~ ^[[:print:]]*$ ]] ]; then
498+
AC_MSG_ERROR([--with-macosx-bundle-id-base contains non-printing characters: $with_macosx_bundle_id_base])
499+
elif test "x$with_macosx_bundle_id_base" != x; then
500+
# Set MACOSX_BUNDLE_ID_BASE to the configured value.
501+
MACOSX_BUNDLE_ID_BASE="$with_macosx_bundle_id_base"
502+
else
503+
# If using the default value, append the VERSION_PRE if there is one
504+
# to make it possible to tell official builds apart from developer builds
505+
if test "x$VERSION_PRE" != x; then
506+
MACOSX_BUNDLE_ID_BASE="$MACOSX_BUNDLE_ID_BASE-$VERSION_PRE"
507+
fi
508+
fi
509+
AC_SUBST(MACOSX_BUNDLE_ID_BASE)
510+
511+
# Set the MACOSX CFBundleVersion field
512+
AC_ARG_WITH(macosx-bundle-build-version, [AS_HELP_STRING([--with-macosx-bundle-build-version],
513+
[Set the MacOSX Bundle CFBundleVersion field. This key is a machine-readable
514+
string composed of one to three period-separated integers and should represent the
515+
build version. Defaults to the build number.])])
516+
if test "x$with_macosx_bundle_build_version" = xyes; then
517+
AC_MSG_ERROR([--with-macosx-bundle-build-version must have a value])
518+
elif [ ! [[ $with_macosx_bundle_build_version =~ ^[0-9\.]*$ ]] ]; then
519+
AC_MSG_ERROR([--with-macosx-bundle-build-version contains non numbers and periods: $with_macosx_bundle_build_version])
520+
elif test "x$with_macosx_bundle_build_version" != x; then
521+
MACOSX_BUNDLE_BUILD_VERSION="$with_macosx_bundle_build_version"
522+
else
523+
MACOSX_BUNDLE_BUILD_VERSION="$VERSION_BUILD"
524+
# If VERSION_OPT consists of only numbers and periods, add it.
525+
if [ [[ $VERSION_OPT =~ ^[0-9\.]+$ ]] ]; then
526+
MACOSX_BUNDLE_BUILD_VERSION+=".$VERSION_OPT"
527+
fi
528+
fi
529+
AC_SUBST(MACOSX_BUNDLE_BUILD_VERSION)
530+
505531
# We could define --with flags for these, if really needed
506532
VERSION_CLASSFILE_MAJOR="$DEFAULT_VERSION_CLASSFILE_MAJOR"
507533
VERSION_CLASSFILE_MINOR="$DEFAULT_VERSION_CLASSFILE_MINOR"

‎make/autoconf/spec.gmk.in

+1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ COMPANY_NAME:=@COMPANY_NAME@
170170
HOTSPOT_VM_DISTRO:=@HOTSPOT_VM_DISTRO@
171171
MACOSX_BUNDLE_NAME_BASE=@MACOSX_BUNDLE_NAME_BASE@
172172
MACOSX_BUNDLE_ID_BASE=@MACOSX_BUNDLE_ID_BASE@
173+
MACOSX_BUNDLE_BUILD_VERSION=@MACOSX_BUNDLE_BUILD_VERSION@
173174
USERNAME:=@USERNAME@
174175
VENDOR_URL:=@VENDOR_URL@
175176
VENDOR_URL_BUG:=@VENDOR_URL_BUG@

‎make/common/modules/LauncherCommon.gmk

+9-5
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,19 @@ define SetupBuildLauncherBody
102102

103103
ifeq ($(call isTargetOs, macosx), true)
104104
ifeq ($$($1_MACOSX_PRIVILEGED), true)
105-
$1_PLIST_SRC_FILE := Info-privileged.plist
106-
else
107-
$1_PLIST_SRC_FILE := Info-cmdline.plist
105+
$1_PLIST_EXTRA := <key>SecTaskAccess</key><string>allowed</string>
108106
endif
109107

110108
$1_PLIST_FILE := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$1/Info.plist
111109

112110
$$(eval $$(call SetupTextFileProcessing, BUILD_PLIST_$1, \
113-
SOURCE_FILES := $$(TOPDIR)/src/java.base/macosx/native/launcher/$$($1_PLIST_SRC_FILE), \
111+
SOURCE_FILES := $(TOPDIR)/make/data/bundle/cmdline-Info.plist, \
114112
OUTPUT_FILE := $$($1_PLIST_FILE), \
115113
REPLACEMENTS := \
116-
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).$(VERSION_SHORT).$1 ; \
114+
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).$1 ; \
117115
@@VERSION@@ => $(VERSION_NUMBER) ; \
116+
@@BUILD_VERSION@@ => $(MACOSX_BUNDLE_BUILD_VERSION) ; \
117+
@@EXTRA@@ => $$($1_PLIST_EXTRA), \
118118
))
119119

120120
$1_LDFLAGS += -sectcreate __TEXT __info_plist $$($1_PLIST_FILE)
@@ -187,6 +187,10 @@ define SetupBuildLauncherBody
187187
$$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, java, /libjava) \
188188
$$($1_WINDOWS_JLI_LIB)
189189
endif
190+
191+
ifeq ($(call isTargetOs, macosx), true)
192+
$$(BUILD_LAUNCHER_$1): $$($1_PLIST_FILE)
193+
endif
190194
endef
191195

192196
################################################################################

‎make/conf/jib-profiles.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1339,13 +1339,17 @@ var versionArgs = function(input, common) {
13391339
"--with-version-pre=" + version_numbers.get("DEFAULT_PROMOTED_VERSION_PRE"),
13401340
"--without-version-opt");
13411341
} else if (input.build_type == "ci") {
1342-
var optString = input.build_id_data.ciBuildNumber;
1342+
var ciBuildNumber = input.build_id_data.ciBuildNumber;
13431343
var preString = input.build_id_data.projectName;
13441344
if (preString == "jdk") {
13451345
preString = version_numbers.get("DEFAULT_PROMOTED_VERSION_PRE");
13461346
}
13471347
args = concat(args, "--with-version-pre=" + preString,
1348-
"--with-version-opt=" + optString);
1348+
"--with-version-opt=" + ciBuildNumber);
1349+
if (input.target_os == "macosx") {
1350+
args = concat(args, "--with-macosx-bundle-build-version="
1351+
+ common.build_number + "." + ciBuildNumber);
1352+
}
13491353
} else {
13501354
args = concat(args, "--with-version-opt=" + common.build_id);
13511355
}

‎make/data/bundle/JDK-Info.plist

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<key>CFBundlePackageType</key>
1818
<string>BNDL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.0</string>
20+
<string>@@VERSION@@</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>@@VERSION@@</string>
24+
<string>@@BUILD_VERSION@@</string>
2525
<key>NSMicrophoneUsageDescription</key>
2626
<string>The application is requesting access to the microphone.</string>
2727
<key>JavaVM</key>
@@ -33,9 +33,9 @@
3333
<key>JVMMinimumFrameworkVersion</key>
3434
<string>13.2.9</string>
3535
<key>JVMMinimumSystemVersion</key>
36-
<string>10.6.0</string>
36+
<string>@@MACOSX_VERSION_MIN@@</string>
3737
<key>JVMPlatformVersion</key>
38-
<string>@@PLATFORM_VERSION@@</string>
38+
<string>@@VERSION@@</string>
3939
<key>JVMVendor</key>
4040
<string>@@VENDOR@@</string>
4141
<key>JVMVersion</key>

‎make/data/bundle/JRE-Info.plist

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@
1717
<key>CFBundlePackageType</key>
1818
<string>BNDL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.0</string>
20+
<string>@@VERSION@@</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>@@VERSION@@</string>
24+
<string>@@BUILD_VERSION@@</string>
2525
<key>NSMicrophoneUsageDescription</key>
2626
<string>The application is requesting access to the microphone.</string>
2727
<key>JavaVM</key>
2828
<dict>
2929
<key>JVMMinimumFrameworkVersion</key>
3030
<string>13.2.9</string>
3131
<key>JVMMinimumSystemVersion</key>
32-
<string>10.6.0</string>
32+
<string>@@MACOSX_VERSION_MIN@@</string>
3333
<key>JVMPlatformVersion</key>
34-
<string>@@PLATFORM_VERSION@@</string>
34+
<string>@@VERSION@@</string>
3535
<key>JVMVendor</key>
3636
<string>@@VENDOR@@</string>
3737
<key>JVMVersion</key>

‎src/java.base/macosx/native/launcher/Info-cmdline.plist ‎make/data/bundle/cmdline-Info.plist

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
<key>CFBundleInfoDictionaryVersion</key>
88
<string>6.0</string>
99
<key>CFBundleShortVersionString</key>
10-
<string>1.0</string>
11-
<key>CFBundleVersion</key>
1210
<string>@@VERSION@@</string>
11+
<key>CFBundleVersion</key>
12+
<string>@@BUILD_VERSION@@</string>
1313
<key>NSMicrophoneUsageDescription</key>
1414
<string>The application is requesting access to the microphone.</string>
15+
@@EXTRA@@
1516
</dict>
1617
</plist>

‎src/java.base/macosx/native/launcher/Info-privileged.plist

-18
This file was deleted.

0 commit comments

Comments
 (0)
This repository has been archived.