Move generation of Info.plist into its own function

This commit is contained in:
Kovid Goyal
2019-06-28 10:47:00 +05:30
parent c863116011
commit 241354ae52

View File

@@ -712,12 +712,8 @@ Categories=System;TerminalEmulator;
os.symlink(os.path.relpath(launcher, os.path.dirname(in_src_launcher)), in_src_launcher)
def create_macos_bundle_gunk(ddir):
def macos_info_plist():
import plistlib
logo_dir = os.path.abspath(os.path.join('logo', appname + '.iconset'))
with current_dir(ddir):
os.mkdir('Contents')
os.chdir('Contents')
VERSION = '.'.join(map(str, version))
pl = dict(
CFBundleDevelopmentRegion='English',
@@ -757,8 +753,16 @@ def create_macos_bundle_gunk(ddir):
},
],
)
return plistlib.dumps(pl)
def create_macos_bundle_gunk(ddir):
logo_dir = os.path.abspath(os.path.join('logo', appname + '.iconset'))
with current_dir(ddir):
os.mkdir('Contents')
os.chdir('Contents')
with open('Info.plist', 'wb') as fp:
plistlib.dump(pl, fp)
fp.write(macos_info_plist())
os.rename('../share', 'Resources')
os.rename('../bin', 'MacOS')
os.rename('../lib', 'Frameworks')