Added build support for ME in the new waf script (but I haven't converted ME's pref panel to xibless yet).

--HG--
branch : xibless
This commit is contained in:
Virgil Dupras 2012-07-28 18:10:05 -04:00
parent 79e9251511
commit 903ecd9eae
4 changed files with 19 additions and 15 deletions

View File

@ -19,7 +19,7 @@ from setuptools import setup, Extension
from hscommon import sphinxgen
from hscommon.build import (add_to_pythonpath, print_and_do, copy_packages, filereplace,
get_module_version, move_all, copy_sysconfig_files_for_embed, copy_all, move, copy,
get_module_version, move_all, copy_sysconfig_files_for_embed, copy_all, move,
create_osx_app_structure)
from hscommon import loc
@ -66,7 +66,8 @@ def build_xibless(edition):
xibless.generate('cocoa/base/ui/details_panel.py', 'cocoa/autogen/DetailsPanel_UI', localizationTable='Localizable')
if edition == 'se':
xibless.generate('cocoa/se/ui/preferences_panel.py', 'cocoa/autogen/PreferencesPanel_UI', localizationTable='Localizable')
if edition == 'me':
xibless.generate('cocoa/se/ui/preferences_panel.py', 'cocoa/autogen/PreferencesPanel_UI', localizationTable='Localizable')
def build_cocoa(edition, dev):
ed = lambda s: s.format(edition)
@ -74,10 +75,8 @@ def build_cocoa(edition, dev):
build_cocoa_proxy_module()
build_cocoa_bridging_interfaces(edition)
print("Building the cocoa layer")
from pluginbuilder import copy_embeddable_python_dylib, get_python_header_folder, collect_dependencies
from pluginbuilder import copy_embeddable_python_dylib, collect_dependencies
copy_embeddable_python_dylib('build')
if not op.exists('build/PythonHeaders'):
os.symlink(get_python_header_folder(), 'build/PythonHeaders')
if not op.exists('build/py'):
os.mkdir('build/py')
cocoa_project_path = ed('cocoa/{}')
@ -103,21 +102,21 @@ def build_cocoa(edition, dev):
filereplace('InfoTemplate.plist', 'Info.plist', version=app_version)
print("Compiling with WAF")
os.chdir('..')
os.system('{0} waf configure && {0} waf'.format(sys.executable))
os.system('{0} waf configure --edition {1} && {0} waf'.format(sys.executable, edition))
os.chdir('..')
print("Creating the .app folder")
image_path = ed('cocoa/{}/dupeguru.icns')
resources = [image_path, 'cocoa/base/dsa_pub.pem', 'build/dg_cocoa.py',
'build/py', 'build/help'] + glob.glob('cocoa/base/*.lproj')
frameworks = ['build/Python', 'cocoalib/Sparkle.framework']
create_osx_app_structure('build/dupeGuru.app', 'cocoa/build/dupeGuru', ed('cocoa/{}/Info.plist'),
resources, frameworks, symlink_resources=dev)
print("Creating the run.py file")
app_path = {
'se': 'build/dupeGuru.app',
'me': 'build/dupeGuru\\ ME.app',
'pe': 'build/dupeGuru\\ PE.app',
'me': 'build/dupeGuru ME.app',
'pe': 'build/dupeGuru PE.app',
}[edition]
create_osx_app_structure(app_path, 'cocoa/build/dupeGuru', ed('cocoa/{}/Info.plist'),
resources, frameworks, symlink_resources=dev)
print("Creating the run.py file")
tmpl = open('run_template_cocoa.py', 'rt').read()
run_contents = tmpl.replace('{{app_path}}', app_path)
open('run.py', 'wt').write(run_contents)

View File

@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<string>dupeGuru</string>
<key>CFBundleHelpBookFolder</key>
<string>dupeguru_me_help</string>
<key>CFBundleHelpBookName</key>
@ -17,7 +17,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<string>dupeGuru ME</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>

View File

@ -8,8 +8,13 @@ out = 'build'
def options(opt):
opt.load('compiler_c python')
opt.add_option('--edition', default='se', help="dupeGuru edition to build (se, me pe)")
def configure(conf):
if conf.options.edition not in ('se', 'me', 'pe'):
conf.options.edition = 'se'
print("Building dupeGuru {}".format(conf.options.edition.upper()))
conf.env.DGEDITION = conf.options.edition
# We use clang to compile our app
conf.env.CC = 'clang'
# WAF has a "pyembed" feature allowing us to automatically find Python and compile by linking
@ -44,7 +49,7 @@ def build(ctx):
'controllers/HSColumns', 'controllers/HSGUIController', 'controllers/HSTable',
'controllers/HSOutline', 'controllers/HSPopUpList', 'controllers/HSSelectableList']
cocoalib_src = [cocoalib_node.find_node(usename + '.m') for usename in cocoalib_uses] + cocoalib_node.ant_glob('autogen/*.m')
project_folders = ['autogen', 'base', 'se']
project_folders = ['autogen', 'base', ctx.env.DGEDITION]
project_src = sum([ctx.srcnode.ant_glob('%s/*.m' % folder) for folder in project_folders], [])
# Compile

View File

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