def package(self, project, checkout):
tree = globals.trees.get(project, checkout, self)
- tree.build_dependencies()
- tree.build()
+ tree.build_dependencies(args.dry_run)
+ tree.build(args.dry_run)
return tree.call('package', tree.version), tree.git_commit
def test(self, tree, test):
"""test is the test case to run, or None"""
- tree.build_dependencies()
- tree.build()
+ tree.build_dependencies(args.dry_run)
+ tree.build(args.dry_run)
return tree.call('test', test)
def set(self, a, b):
for b in [32, 64]:
target = OSXSingleTarget(b, os.path.join(self.directory, '%d' % b))
tree = globals.trees.get(project, checkout, target)
- tree.build_dependencies()
- tree.build()
+ tree.build_dependencies(False)
+ tree.build(False)
tree = globals.trees.get(project, checkout, self)
with TreeDirectory(tree):
with TreeDirectory(self):
return self.cscript[function](self.target, *args)
- def build_dependencies(self, options=None):
+ def build_dependencies(self, dry_run, options=None):
if 'dependencies' in self.cscript:
if len(inspect.getargspec(self.cscript['dependencies']).args) == 2:
deps = self.call('dependencies', options)
# Make the options to pass in from the option_defaults of the thing
# we are building and any options specified by the parent.
- options = {}
+
if 'option_defaults' in dep.cscript:
- options = dep.cscript['option_defaults']()
- if len(d) > 2:
- for k, v in d[2].items():
- options[k] = v
+ for k, v in dep.cscript['option_defaults'].items():
+ options[k] = v
+
+ if len(d) > 2:
+ for k, v in d[2].items():
+ options[k] = v
- dep.build_dependencies(options)
- dep.build(options)
+ dep.build_dependencies(dry_run, options)
+ dep.build(dry_run, options)
- def build(self, options=None):
+ def build(self, dry_run, options=None):
if self.built:
return
variables = copy.copy(self.target.variables)
- if len(inspect.getargspec(self.cscript['build']).args) == 2:
- self.call('build', options)
- else:
- self.call('build')
+ if not dry_run:
+ if len(inspect.getargspec(self.cscript['build']).args) == 2:
+ self.call('build', options)
+ else:
+ self.call('build')
self.target.variables = variables
self.built = True
parser.add_argument('-w', '--work', help='override default work directory')
parser.add_argument('-g', '--git-prefix', help='override configured git prefix')
parser.add_argument('--test', help='name of test to run (with `test''), defaults to all')
+ parser.add_argument('-n', '--dry-run', help='run the process without building anything')
args = parser.parse_args()
# Override configured stuff
target = target_factory(args.target, args.debug, args.work)
tree = globals.trees.get(args.project, args.checkout, target)
- tree.build_dependencies()
- tree.build()
+ tree.build_dependencies(dry_run)
+ tree.build(dry_run)
if not args.keep:
target.cleanup()