refactor: auto generate Info.plist to avoid bumping during releases (#18849)
This commit is contained in:
parent
0af3548b55
commit
ccd15fc12e
6 changed files with 15 additions and 23 deletions
13
BUILD.gn
13
BUILD.gn
|
@ -687,7 +687,7 @@ if (is_mac) {
|
||||||
|
|
||||||
electron_version = read_file("ELECTRON_VERSION", "trim string")
|
electron_version = read_file("ELECTRON_VERSION", "trim string")
|
||||||
extra_substitutions = [
|
extra_substitutions = [
|
||||||
"ATOM_BUNDLE_ID=$electron_mac_bundle_id.framework",
|
"ELECTRON_BUNDLE_ID=$electron_mac_bundle_id.framework",
|
||||||
"ELECTRON_VERSION=$electron_version",
|
"ELECTRON_VERSION=$electron_version",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -738,7 +738,8 @@ if (is_mac) {
|
||||||
sources += [ "atom/common/atom_constants.cc" ]
|
sources += [ "atom/common/atom_constants.cc" ]
|
||||||
include_dirs = [ "." ]
|
include_dirs = [ "." ]
|
||||||
info_plist = "atom/renderer/resources/mac/Info.plist"
|
info_plist = "atom/renderer/resources/mac/Info.plist"
|
||||||
extra_substitutions = [ "ATOM_BUNDLE_ID=$electron_mac_bundle_id.helper" ]
|
extra_substitutions =
|
||||||
|
[ "ELECTRON_BUNDLE_ID=$electron_mac_bundle_id.helper" ]
|
||||||
ldflags = [
|
ldflags = [
|
||||||
"-rpath",
|
"-rpath",
|
||||||
"@executable_path/../../..",
|
"@executable_path/../../..",
|
||||||
|
@ -779,7 +780,7 @@ if (is_mac) {
|
||||||
libs = [ "AppKit.framework" ]
|
libs = [ "AppKit.framework" ]
|
||||||
info_plist = "atom/app/resources/mac/loginhelper-Info.plist"
|
info_plist = "atom/app/resources/mac/loginhelper-Info.plist"
|
||||||
extra_substitutions =
|
extra_substitutions =
|
||||||
[ "ATOM_BUNDLE_ID=$electron_mac_bundle_id.loginhelper" ]
|
[ "ELECTRON_BUNDLE_ID=$electron_mac_bundle_id.loginhelper" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
bundle_data("electron_login_helper_app") {
|
bundle_data("electron_login_helper_app") {
|
||||||
|
@ -851,7 +852,11 @@ if (is_mac) {
|
||||||
deps += [ ":electron_login_helper_app" ]
|
deps += [ ":electron_login_helper_app" ]
|
||||||
}
|
}
|
||||||
info_plist = "atom/browser/resources/mac/Info.plist"
|
info_plist = "atom/browser/resources/mac/Info.plist"
|
||||||
extra_substitutions = [ "ATOM_BUNDLE_ID=$electron_mac_bundle_id" ]
|
electron_version = read_file("ELECTRON_VERSION", "trim string")
|
||||||
|
extra_substitutions = [
|
||||||
|
"ELECTRON_BUNDLE_ID=$electron_mac_bundle_id",
|
||||||
|
"ELECTRON_VERSION=$electron_version",
|
||||||
|
]
|
||||||
ldflags = [
|
ldflags = [
|
||||||
"-rpath",
|
"-rpath",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${ATOM_BUNDLE_ID}</string>
|
<string>${ELECTRON_BUNDLE_ID}</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${ATOM_BUNDLE_ID}</string>
|
<string>${ELECTRON_BUNDLE_ID}</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
|
@ -17,9 +17,9 @@
|
||||||
<key>CFBundleIconFile</key>
|
<key>CFBundleIconFile</key>
|
||||||
<string>electron.icns</string>
|
<string>electron.icns</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>7.0.0-nightly.20190616</string>
|
<string>${ELECTRON_VERSION}</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>7.0.0-nightly.20190616</string>
|
<string>${ELECTRON_VERSION}</string>
|
||||||
<key>LSApplicationCategoryType</key>
|
<key>LSApplicationCategoryType</key>
|
||||||
<string>public.app-category.developer-tools</string>
|
<string>public.app-category.developer-tools</string>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${ATOM_BUNDLE_ID}</string>
|
<string>${ELECTRON_BUNDLE_ID}</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${ATOM_BUNDLE_ID}</string>
|
<string>${ELECTRON_BUNDLE_ID}</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
|
|
|
@ -56,7 +56,6 @@ async function main () {
|
||||||
// update all version-related files
|
// update all version-related files
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
updateVersion(version),
|
updateVersion(version),
|
||||||
updateInfoPlist(version),
|
|
||||||
updatePackageJSON(version),
|
updatePackageJSON(version),
|
||||||
updateVersionH(components),
|
updateVersionH(components),
|
||||||
updateWinRC(components)
|
updateWinRC(components)
|
||||||
|
@ -119,18 +118,6 @@ async function updatePackageJSON (version) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// update CFBundle version information and overwrite pre-existing file
|
|
||||||
// TODO(codebytere): provide these version fields at GN build time
|
|
||||||
async function updateInfoPlist (version) {
|
|
||||||
const filePath = path.resolve(__dirname, '..', 'atom', 'browser', 'resources', 'mac', 'Info.plist')
|
|
||||||
const file = plist.parse(await readFile(filePath, { encoding: 'utf8' }))
|
|
||||||
|
|
||||||
file.CFBundleVersion = version
|
|
||||||
file.CFBundleShortVersionString = version
|
|
||||||
|
|
||||||
await writeFile(filePath, plist.build(file))
|
|
||||||
}
|
|
||||||
|
|
||||||
// push bump commit to release branch
|
// push bump commit to release branch
|
||||||
async function commitVersionBump (version) {
|
async function commitVersionBump (version) {
|
||||||
const gitDir = path.resolve(__dirname, '..')
|
const gitDir = path.resolve(__dirname, '..')
|
||||||
|
|
Loading…
Reference in a new issue