Add package.py

with other minor fixes
This commit is contained in:
Virgil Dupras 2017-03-11 20:44:18 -05:00
parent 08eac3844e
commit cdb14d7e5f
6 changed files with 32 additions and 8 deletions

1
.gitignore vendored
View File

@ -10,6 +10,5 @@ __pycache__
/cocoa/autogen
/locale
/run.py
/cocoa/*/Info.plist
/cocoa/*/build

View File

@ -34,4 +34,7 @@ env : | $(submodules_target) reqs
build:
./env/bin/python build.py
.PHONY : reqs build all
run:
./env/bin/python run.py
.PHONY : reqs build run all

View File

@ -152,10 +152,6 @@ def build_cocoa(dev):
resources = [image_path, 'cocoa/dsa_pub.pem', 'build/dg_cocoa.py', 'build/help']
app.copy_resources(*resources, use_symlinks=dev)
app.copy_frameworks('build/Python')
print("Creating the run.py file")
tmpl = open('cocoa/run_template.py', 'rt').read()
run_contents = tmpl.replace('{{app_path}}', app.dest)
open('run.py', 'wt').write(run_contents)
def build_help():
print("Generating Help")

@ -1 +1 @@
Subproject commit f51f94e03db3c36468bc40200679f098a0346a62
Subproject commit 245ed0ddecd0fad4a8e8dab3be07d319c14b1514

26
package.py Normal file
View File

@ -0,0 +1,26 @@
# Copyright 2017 Virgil Dupras
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from argparse import ArgumentParser
from hscommon.build import setup_package_argparser, package_cocoa_app_in_dmg
def parse_args():
parser = ArgumentParser()
setup_package_argparser(parser)
return parser.parse_args()
def package_cocoa(args):
app_path = 'build/dupeGuru.app'
package_cocoa_app_in_dmg(app_path, '.', args)
def main():
args = parse_args()
print("Packaging dupeGuru with UI cocoa")
package_cocoa(args)
if __name__ == '__main__':
main()

View File

@ -4,7 +4,7 @@ import sys
import os
def main():
return os.system('open "{{app_path}}"')
return os.system('open "build/dupeGuru.app"')
if __name__ == '__main__':
sys.exit(main())