mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
Improved the cocoa build process.
--HG-- rename : cocoa/me/py/dg_cocoa.py => cocoa/me/dg_cocoa.py rename : cocoa/pe/py/dg_cocoa.py => cocoa/pe/dg_cocoa.py rename : cocoa/se/py/dg_cocoa.py => cocoa/se/dg_cocoa.py
This commit is contained in:
parent
d06ce0c748
commit
da194007fb
20
.hgignore
20
.hgignore
@ -1,19 +1,15 @@
|
||||
syntax: glob
|
||||
|
||||
.DS_Store
|
||||
*.pyc
|
||||
*.so
|
||||
conf.yaml
|
||||
cocoa/se/Info.plist
|
||||
cocoa/me/Info.plist
|
||||
cocoa/pe/Info.plist
|
||||
cocoa/se/build
|
||||
cocoa/me/build
|
||||
cocoa/pe/build
|
||||
cocoa/se/py/build
|
||||
cocoa/me/py/build
|
||||
cocoa/pe/py/build
|
||||
cocoa/se/py/dist
|
||||
cocoa/me/py/dist
|
||||
cocoa/pe/py/dist
|
||||
build
|
||||
core_pe/modules/block/block.c
|
||||
core_pe/modules/cache/cache.c
|
||||
cocoa/*/Info.plist
|
||||
cocoa/*/build
|
||||
cocoa/*/dg_cocoa.plugin
|
||||
qt/base/*_rc.py
|
||||
qt/base/*_ui.py
|
||||
qt/se/*_ui.py
|
||||
|
68
build.py
68
build.py
@ -11,10 +11,13 @@
|
||||
import sys
|
||||
import os
|
||||
import os.path as op
|
||||
import shutil
|
||||
|
||||
from setuptools import setup
|
||||
import yaml
|
||||
|
||||
from hsutil.build import move_testdata_out, put_testdata_back, add_to_pythonpath
|
||||
from hsdocgen import generate_help, filters
|
||||
from hsutil.build import add_to_pythonpath, print_and_do, build_all_qt_ui, copy_packages
|
||||
|
||||
def main():
|
||||
conf = yaml.load(open('conf.yaml'))
|
||||
@ -22,20 +25,17 @@ def main():
|
||||
ui = conf['ui']
|
||||
dev = conf['dev']
|
||||
print "Building dupeGuru {0} with UI {1}".format(edition.upper(), ui)
|
||||
add_to_pythonpath('.')
|
||||
if dev:
|
||||
print "Building in Dev mode"
|
||||
add_to_pythonpath('.')
|
||||
print "Generating Help"
|
||||
windows = sys.platform == 'win32'
|
||||
if edition == 'se':
|
||||
import help_se.gen
|
||||
help_se.gen.generate(windows=windows, force_render=not dev)
|
||||
elif edition == 'me':
|
||||
import help_me.gen
|
||||
help_me.gen.generate(windows=windows, force_render=not dev)
|
||||
elif edition == 'pe':
|
||||
import help_pe.gen
|
||||
help_pe.gen.generate(windows=windows, force_render=not dev)
|
||||
tix = filters.tixgen("https://hardcoded.lighthouseapp.com/projects/31699-dupeguru/tickets/{0}")
|
||||
help_dir = 'help_{0}'.format(edition)
|
||||
dest_dir = 'dupeguru_{0}_help'.format(edition) if edition != 'se' else 'dupeguru_help'
|
||||
help_basepath = op.abspath(help_dir)
|
||||
help_destpath = op.abspath(op.join(help_dir, dest_dir))
|
||||
generate_help.main(help_basepath, help_destpath, force_render=not dev, tix=tix, windows=windows)
|
||||
|
||||
print "Building dupeGuru"
|
||||
if edition == 'pe':
|
||||
@ -43,16 +43,44 @@ def main():
|
||||
os.system('python gen.py')
|
||||
os.chdir('..')
|
||||
if ui == 'cocoa':
|
||||
move_log = move_testdata_out()
|
||||
try:
|
||||
os.chdir(op.join('cocoa', edition))
|
||||
if not dev:
|
||||
print "Building help index"
|
||||
os.system('open /Developer/Applications/Utilities/Help\\ Indexer.app --args {0}'.format(help_destpath))
|
||||
|
||||
print "Building dg_cocoa.plugin"
|
||||
if op.exists('build'):
|
||||
shutil.rmtree('build')
|
||||
os.mkdir('build')
|
||||
if not dev:
|
||||
specific_packages = {
|
||||
'se': ['core_se'],
|
||||
'me': ['core_me', 'hsmedia'],
|
||||
'pe': ['core_pe'],
|
||||
}[edition]
|
||||
copy_packages(['core', 'hsutil'] + specific_packages, 'build')
|
||||
cocoa_project_path = 'cocoa/{0}'.format(edition)
|
||||
shutil.copy(op.join(cocoa_project_path, 'dg_cocoa.py'), 'build')
|
||||
os.chdir('build')
|
||||
script_args = ['py2app', '-A'] if dev else ['py2app']
|
||||
setup(
|
||||
script_args = script_args,
|
||||
plugin = ['dg_cocoa.py'],
|
||||
setup_requires = ['py2app'],
|
||||
)
|
||||
os.chdir('..')
|
||||
pluginpath = op.join(cocoa_project_path, 'dg_cocoa.plugin')
|
||||
if op.exists(pluginpath):
|
||||
shutil.rmtree(pluginpath)
|
||||
shutil.move('build/dist/dg_cocoa.plugin', pluginpath)
|
||||
if dev:
|
||||
os.system('python gen.py --dev')
|
||||
else:
|
||||
os.system('python gen.py')
|
||||
os.chdir(op.join('..', '..'))
|
||||
finally:
|
||||
put_testdata_back(move_log)
|
||||
# In alias mode, the tweakings we do to the pythonpath aren't counted in. We have to
|
||||
# manually put a .pth in the plugin
|
||||
pthpath = op.join(pluginpath, 'Contents/Resources/dev.pth')
|
||||
open(pthpath, 'w').write(op.abspath('.'))
|
||||
os.chdir(cocoa_project_path)
|
||||
print "Building the XCode project"
|
||||
os.system('xcodebuild')
|
||||
os.chdir('..')
|
||||
elif ui == 'qt':
|
||||
os.chdir(op.join('qt', edition))
|
||||
os.system('python gen.py')
|
||||
|
@ -88,7 +88,7 @@
|
||||
CE381C9509914ACE003581CE /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; };
|
||||
CE381C9A09914ADF003581CE /* ResultWindow.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = ResultWindow.m; sourceTree = SOURCE_ROOT; };
|
||||
CE381C9B09914ADF003581CE /* ResultWindow.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = ResultWindow.h; sourceTree = SOURCE_ROOT; };
|
||||
CE381CF509915304003581CE /* dg_cocoa.plugin */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dg_cocoa.plugin; path = py/dist/dg_cocoa.plugin; sourceTree = SOURCE_ROOT; };
|
||||
CE381CF509915304003581CE /* dg_cocoa.plugin */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dg_cocoa.plugin; path = dg_cocoa.plugin; sourceTree = SOURCE_ROOT; };
|
||||
CE3FBDD11094637800B72D77 /* DetailsPanel.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = DetailsPanel.xib; path = ../../base/xib/DetailsPanel.xib; sourceTree = "<group>"; };
|
||||
CE3FBDD21094637800B72D77 /* DirectoryPanel.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = DirectoryPanel.xib; path = ../../base/xib/DirectoryPanel.xib; sourceTree = "<group>"; };
|
||||
CE49DEF20FDFEB810098617B /* BRSingleLineFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BRSingleLineFormatter.h; path = ../../cocoalib/brsinglelineformatter/BRSingleLineFormatter.h; sourceTree = SOURCE_ROOT; };
|
||||
|
@ -1,41 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import os.path as op
|
||||
import os
|
||||
import shutil
|
||||
from optparse import OptionParser
|
||||
|
||||
def main(dev):
|
||||
if not dev:
|
||||
print "Building help index"
|
||||
help_path = op.abspath('../../help_me/dupeguru_me_help')
|
||||
os.system('open /Developer/Applications/Utilities/Help\\ Indexer.app --args {0}'.format(help_path))
|
||||
|
||||
print "Building dg_cocoa.plugin"
|
||||
if op.exists('py/build'):
|
||||
shutil.rmtree('py/build')
|
||||
if op.exists('py/dist'):
|
||||
shutil.rmtree('py/dist')
|
||||
|
||||
os.chdir('py')
|
||||
if dev:
|
||||
os.system('python -u setup.py py2app -A')
|
||||
else:
|
||||
os.system('python -u setup.py py2app')
|
||||
os.chdir('..')
|
||||
|
||||
print "Building the XCode project"
|
||||
os.system('xcodebuild')
|
||||
|
||||
if __name__ == '__main__':
|
||||
usage = "usage: %prog [options]"
|
||||
parser = OptionParser(usage=usage)
|
||||
parser.add_option('--dev', action='store_true', dest='dev', default=False,
|
||||
help="If this flag is set, will configure for dev builds.")
|
||||
(options, args) = parser.parse_args()
|
||||
main(options.dev)
|
@ -1,16 +0,0 @@
|
||||
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import os.path as op
|
||||
import sys
|
||||
sys.path.insert(0, op.abspath('../../..')) # for all cross-toolkit modules
|
||||
|
||||
from distutils.core import setup
|
||||
import py2app
|
||||
|
||||
setup(
|
||||
plugin = ['dg_cocoa.py'],
|
||||
)
|
@ -84,7 +84,7 @@
|
||||
CE381C9509914ACE003581CE /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; };
|
||||
CE381C9A09914ADF003581CE /* ResultWindow.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = ResultWindow.m; sourceTree = SOURCE_ROOT; };
|
||||
CE381C9B09914ADF003581CE /* ResultWindow.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = ResultWindow.h; sourceTree = SOURCE_ROOT; };
|
||||
CE381CF509915304003581CE /* dg_cocoa.plugin */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dg_cocoa.plugin; path = py/dist/dg_cocoa.plugin; sourceTree = SOURCE_ROOT; };
|
||||
CE381CF509915304003581CE /* dg_cocoa.plugin */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dg_cocoa.plugin; path = dg_cocoa.plugin; sourceTree = SOURCE_ROOT; };
|
||||
CE6044EA0FE6796200B71262 /* DetailsPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetailsPanel.h; path = ../base/DetailsPanel.h; sourceTree = SOURCE_ROOT; };
|
||||
CE6044EB0FE6796200B71262 /* DetailsPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DetailsPanel.m; path = ../base/DetailsPanel.m; sourceTree = SOURCE_ROOT; };
|
||||
CE68EE6509ABC48000971085 /* DirectoryPanel.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = DirectoryPanel.h; sourceTree = SOURCE_ROOT; };
|
||||
|
@ -1,41 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import os.path as op
|
||||
import os
|
||||
import shutil
|
||||
from optparse import OptionParser
|
||||
|
||||
def main(dev):
|
||||
if not dev:
|
||||
print "Building help index"
|
||||
help_path = op.abspath('../../help_pe/dupeguru_pe_help')
|
||||
os.system('open /Developer/Applications/Utilities/Help\\ Indexer.app --args {0}'.format(help_path))
|
||||
|
||||
print "Building dg_cocoa.plugin"
|
||||
if op.exists('py/build'):
|
||||
shutil.rmtree('py/build')
|
||||
if op.exists('py/dist'):
|
||||
shutil.rmtree('py/dist')
|
||||
|
||||
os.chdir('py')
|
||||
if dev:
|
||||
os.system('python -u setup.py py2app -A')
|
||||
else:
|
||||
os.system('python -u setup.py py2app')
|
||||
os.chdir('..')
|
||||
|
||||
print "Building the XCode project"
|
||||
os.system('xcodebuild')
|
||||
|
||||
if __name__ == '__main__':
|
||||
usage = "usage: %prog [options]"
|
||||
parser = OptionParser(usage=usage)
|
||||
parser.add_option('--dev', action='store_true', dest='dev', default=False,
|
||||
help="If this flag is set, will configure for dev builds.")
|
||||
(options, args) = parser.parse_args()
|
||||
main(options.dev)
|
@ -1,12 +0,0 @@
|
||||
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
from distutils.core import setup
|
||||
import py2app
|
||||
|
||||
setup(
|
||||
plugin = ['dg_cocoa.py'],
|
||||
)
|
@ -75,7 +75,7 @@
|
||||
CE381C9509914ACE003581CE /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; };
|
||||
CE381C9A09914ADF003581CE /* ResultWindow.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = ResultWindow.m; sourceTree = SOURCE_ROOT; };
|
||||
CE381C9B09914ADF003581CE /* ResultWindow.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = ResultWindow.h; sourceTree = SOURCE_ROOT; };
|
||||
CE381CF509915304003581CE /* dg_cocoa.plugin */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dg_cocoa.plugin; path = py/dist/dg_cocoa.plugin; sourceTree = SOURCE_ROOT; };
|
||||
CE381CF509915304003581CE /* dg_cocoa.plugin */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dg_cocoa.plugin; path = dg_cocoa.plugin; sourceTree = SOURCE_ROOT; };
|
||||
CE3A46F9109B212E002ABFD5 /* MainMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MainMenu.xib; path = ../base/xib/MainMenu.xib; sourceTree = "<group>"; };
|
||||
CE45579A0AE3BC2B005A9546 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = /Library/Frameworks/Sparkle.framework; sourceTree = "<absolute>"; };
|
||||
CE68EE6509ABC48000971085 /* DirectoryPanel.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = DirectoryPanel.h; sourceTree = SOURCE_ROOT; };
|
||||
|
@ -1,41 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import os.path as op
|
||||
import os
|
||||
import shutil
|
||||
from optparse import OptionParser
|
||||
|
||||
def main(dev):
|
||||
if not dev:
|
||||
print "Building help index"
|
||||
help_path = op.abspath('../../help_se/dupeguru_help')
|
||||
os.system('open /Developer/Applications/Utilities/Help\\ Indexer.app --args {0}'.format(help_path))
|
||||
|
||||
print "Building dg_cocoa.plugin"
|
||||
if op.exists('py/build'):
|
||||
shutil.rmtree('py/build')
|
||||
if op.exists('py/dist'):
|
||||
shutil.rmtree('py/dist')
|
||||
|
||||
os.chdir('py')
|
||||
if dev:
|
||||
os.system('python -u setup.py py2app -A')
|
||||
else:
|
||||
os.system('python -u setup.py py2app')
|
||||
os.chdir('..')
|
||||
|
||||
print "Building the XCode project"
|
||||
os.system('xcodebuild')
|
||||
|
||||
if __name__ == '__main__':
|
||||
usage = "usage: %prog [options]"
|
||||
parser = OptionParser(usage=usage)
|
||||
parser.add_option('--dev', action='store_true', dest='dev', default=False,
|
||||
help="If this flag is set, will configure for dev builds.")
|
||||
(options, args) = parser.parse_args()
|
||||
main(options.dev)
|
@ -1,18 +0,0 @@
|
||||
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
from distutils.core import setup
|
||||
import py2app
|
||||
|
||||
from hsutil.build import move_testdata_out, put_testdata_back
|
||||
|
||||
move_log = move_testdata_out()
|
||||
try:
|
||||
setup(
|
||||
plugin = ['dg_cocoa.py'],
|
||||
)
|
||||
finally:
|
||||
put_testdata_back(move_log)
|
@ -1,14 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import os.path as op
|
||||
from hsdocgen import generate_help, filters
|
||||
|
||||
def generate(windows=False, force_render=True):
|
||||
tix = filters.tixgen("https://hardcoded.lighthouseapp.com/projects/31699-dupeguru/tickets/{0}")
|
||||
basepath = op.dirname(__file__)
|
||||
generate_help.main(basepath, op.join(basepath, 'dupeguru_me_help'), force_render=force_render, tix=tix, windows=windows)
|
@ -1,14 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import os.path as op
|
||||
from hsdocgen import generate_help, filters
|
||||
|
||||
def generate(windows=False, force_render=True):
|
||||
tix = filters.tixgen("https://hardcoded.lighthouseapp.com/projects/31699-dupeguru/tickets/{0}")
|
||||
basepath = op.dirname(__file__)
|
||||
generate_help.main(basepath, op.join(basepath, 'dupeguru_pe_help'), force_render=force_render, tix=tix, windows=windows)
|
@ -1,15 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import os.path as op
|
||||
from hsdocgen import generate_help, filters
|
||||
|
||||
def generate(windows=False, force_render=True):
|
||||
tix = filters.tixgen("https://hardcoded.lighthouseapp.com/projects/31699-dupeguru/tickets/{0}")
|
||||
basepath = op.dirname(__file__)
|
||||
generate_help.main(basepath, op.join(basepath, 'dupeguru_help'), force_render=force_render, tix=tix, windows=windows)
|
||||
|
Loading…
x
Reference in New Issue
Block a user