mirror of
https://github.com/arsenetar/dupeguru.git
synced 2024-10-31 22:05:58 +00:00
Moved cocoa packaging logic that is common to all HS apps into hscommon.build.
This commit is contained in:
parent
45c8291645
commit
4200f2a090
25
package.py
25
package.py
@ -14,31 +14,22 @@ import json
|
|||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
from hscommon.plat import ISWINDOWS, ISLINUX
|
from hscommon.plat import ISWINDOWS, ISLINUX
|
||||||
from hscommon.build import (build_dmg, add_to_pythonpath, print_and_do, copy_packages,
|
from hscommon.build import (add_to_pythonpath, print_and_do, copy_packages, build_debian_changelog,
|
||||||
build_debian_changelog, copy_qt_plugins, get_module_version, filereplace, copy)
|
copy_qt_plugins, get_module_version, filereplace, copy, setup_package_argparser,
|
||||||
|
package_cocoa_app_in_dmg)
|
||||||
|
|
||||||
def parse_args():
|
def parse_args():
|
||||||
parser = ArgumentParser()
|
parser = ArgumentParser()
|
||||||
parser.add_argument('--sign', dest='sign_identity',
|
setup_package_argparser(parser)
|
||||||
help="Sign app under specified identity before packaging (OS X only)")
|
return parser.parse_args()
|
||||||
args = parser.parse_args()
|
|
||||||
return args
|
|
||||||
|
|
||||||
def package_cocoa(edition, sign_identity):
|
def package_cocoa(edition, args):
|
||||||
app_path = {
|
app_path = {
|
||||||
'se': 'cocoa/se/dupeGuru.app',
|
'se': 'cocoa/se/dupeGuru.app',
|
||||||
'me': 'cocoa/me/dupeGuru ME.app',
|
'me': 'cocoa/me/dupeGuru ME.app',
|
||||||
'pe': 'cocoa/pe/dupeGuru PE.app',
|
'pe': 'cocoa/pe/dupeGuru PE.app',
|
||||||
}[edition]
|
}[edition]
|
||||||
# Rather than signing our app in XCode during the build phase, we sign it during the package
|
package_cocoa_app_in_dmg(app_path, '.', args)
|
||||||
# phase because running the app before packaging can modify it and we want to be sure to have
|
|
||||||
# a valid signature.
|
|
||||||
if sign_identity:
|
|
||||||
sign_identity = "Developer ID Application: {}".format(sign_identity)
|
|
||||||
print_and_do('codesign --force --sign "{}" "{}"'.format(sign_identity, app_path))
|
|
||||||
else:
|
|
||||||
print("WARNING: packaging an unsigned application")
|
|
||||||
build_dmg(app_path, '.')
|
|
||||||
|
|
||||||
def package_windows(edition, dev):
|
def package_windows(edition, dev):
|
||||||
if not ISWINDOWS:
|
if not ISWINDOWS:
|
||||||
@ -127,7 +118,7 @@ def main():
|
|||||||
dev = conf['dev']
|
dev = conf['dev']
|
||||||
print("Packaging dupeGuru {0} with UI {1}".format(edition.upper(), ui))
|
print("Packaging dupeGuru {0} with UI {1}".format(edition.upper(), ui))
|
||||||
if ui == 'cocoa':
|
if ui == 'cocoa':
|
||||||
package_cocoa(edition, args.sign_identity)
|
package_cocoa(edition, args)
|
||||||
elif ui == 'qt':
|
elif ui == 'qt':
|
||||||
if ISWINDOWS:
|
if ISWINDOWS:
|
||||||
package_windows(edition, dev)
|
package_windows(edition, dev)
|
||||||
|
Loading…
Reference in New Issue
Block a user