mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2024-11-24 21:01:59 +00:00
build script: do checkout only when commit is specified
This commit is contained in:
parent
dee8cdeed1
commit
af348b9a6a
1 changed files with 5 additions and 8 deletions
13
build.py
13
build.py
|
@ -41,9 +41,8 @@ class Configuration(object):
|
|||
|
||||
self.target = None
|
||||
self.xcode = False
|
||||
self.commit = None
|
||||
self.checkout_commit = None
|
||||
self.generate = True
|
||||
self.checkout = True
|
||||
self.rebuild_prefix = False
|
||||
|
||||
self.source_path = None
|
||||
|
@ -86,9 +85,8 @@ def create_configuration(args: list):
|
|||
parser = argparse.ArgumentParser(description='*ZDoom binary dependencies for macOS')
|
||||
parser.add_argument('target', choices=targets.keys(), help='target to build')
|
||||
parser.add_argument('--xcode', action='store_true', help='generate Xcode project instead of build')
|
||||
parser.add_argument('--commit', help='target\'s source code commit or tag to checkout')
|
||||
parser.add_argument('--checkout-commit', help='target\'s source code commit or tag to checkout')
|
||||
parser.add_argument('--skip-generate', action='store_true', help='do not generate build environment')
|
||||
parser.add_argument('--skip-checkout', action='store_true', help='do not touch target\'s source code')
|
||||
parser.add_argument('--rebuild-prefix', action='store_true', help='rebuild prefix path')
|
||||
parser.add_argument('--source-path', help='path to target\'s source code')
|
||||
parser.add_argument('--build-path', help='target build path')
|
||||
|
@ -98,9 +96,8 @@ def create_configuration(args: list):
|
|||
config = Configuration()
|
||||
config.target = targets[arguments.target]
|
||||
config.xcode = arguments.xcode
|
||||
config.commit = arguments.commit
|
||||
config.checkout_commit = arguments.checkout_commit
|
||||
config.generate = not arguments.skip_generate
|
||||
config.checkout = not arguments.skip_checkout
|
||||
config.rebuild_prefix = arguments.rebuild_prefix
|
||||
|
||||
config.source_path = arguments.source_path
|
||||
|
@ -152,8 +149,8 @@ def prepare_source(config: Configuration):
|
|||
args = ('git', 'clone', config.target.url, config.source_path)
|
||||
subprocess.check_call(args, cwd=config.root_path)
|
||||
|
||||
if config.checkout:
|
||||
args = ['git', 'checkout', config.commit and config.commit or 'master']
|
||||
if config.checkout_commit:
|
||||
args = ['git', 'checkout', config.checkout_commit]
|
||||
subprocess.check_call(args, cwd=config.source_path)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue