Suggested fix for OPEN-45
Review Request #215 - Created March 17, 2011 and submitted
Alain Linden | Reviewers | ||
viewer | |||
OPEN-45 | oz.linden, boroondas.gupte | ||
None | autobuild |
Suggested fix for OPEN-45. I'd like to decouple Executable as much as possible from assumptions and state of autobuild. To that end I added an optional argument to the __str__ method to accept an options list to insert into the command string. The command string generated by __call__ and __str__ is now identical. Incidentally I made the environment an optional argument to __call__ to make it more general and decouple it a little more from the rest of autobuild.
autobuild/autobuild_tool_build.py | |||
---|---|---|---|
Revision abc1014d5ad6 | New Change | ||
... | 139 lines hidden [Expand] | ||
def _build_a_configuration(config, build_configuration, extra_arguments, dry_run=False): |
|||
140 |
parent_build = None |
140 |
parent_build = None |
141 |
if build_configuration.build is not None: |
141 |
if build_configuration.build is not None: |
142 |
build_executable = copy.copy(build_configuration.build) |
142 |
build_executable = copy.copy(build_configuration.build) |
143 |
build_executable.parent = parent_build |
143 |
build_executable.parent = parent_build |
144 |
elif parent_build is not None: |
144 |
elif parent_build is not None: |
145 |
logger.info('no build executable defined; falling back to parent') |
145 |
logger.info('no build executable defined; falling back to parent') |
146 |
build_executable = parent_build |
146 |
build_executable = parent_build |
147 |
else: |
147 |
else: |
148 |
logger.info('no build executable defined; doing nothing') |
148 |
logger.info('no build executable defined; doing nothing') |
149 |
return 0 |
149 |
return 0 |
150 | logger.info('executing build command %s', build_executable) |
150 | logger.info('executing build command %s', build_executable.__str__(extra_arguments)) |
151 |
if not dry_run: |
151 |
if not dry_run: |
152 | return build_executable(extra_arguments) |
152 | return build_executable(extra_arguments, common.get_autobuild_environment()) |
153 |
else: |
153 |
else: |
154 |
return 0 |
154 |
return 0 |
autobuild/autobuild_tool_configure.py | |
---|---|
Revision abc1014d5ad6 | New Change |
autobuild/common.py | |
---|---|
Revision abc1014d5ad6 | New Change |
autobuild/executable.py | |
---|---|
Revision abc1014d5ad6 | New Change |
Other reviews