OPEN-7: allow specification of the config-file with env var AUTOBUILD_CONFIG_FILE
Review Request #140 - Created Feb. 6, 2011 and submitted
Oz Linden | Reviewers | ||
viewer | |||
open-7 | |||
None | autobuild |
This change allows the environment variable AUTOBUILD_CONFIG_FILE to specify a default config-file, so that the precedence becomes: 1. the --config-file command line option 2. the environment variable AUTOBUILD_CONFIG_FILE 3. "autobuild.xml" It also adds an info-level (--verbose) display of the config file name that is being loaded, and a warning level display if the config file does not exist.
Manually tested with and without the command line option, and with and without the environment variable set: confirmed that the correct file name is used per the precedence above. Confirmed that the new logging works correctly.
Diff revision 1 (Latest)
- autobuild/autobuild_tool_build.py:
- autobuild/autobuild_tool_configure.py:
- autobuild/autobuild_tool_edit.py:
- autobuild/autobuild_tool_install.py:
- autobuild/autobuild_tool_installables.py:
- autobuild/autobuild_tool_manifest.py:
- autobuild/autobuild_tool_package.py:
- autobuild/autobuild_tool_print.py:
- autobuild/autobuild_tool_uninstall.py:
- autobuild/configfile.py:
autobuild/autobuild_tool_build.py | |||
---|---|---|---|
Revision 9ee2db08d677 | New Change | ||
... | 52 lines hidden [Expand] | ||
class BuildError(AutobuildError): |
|||
53 | 53 | ||
54 |
class AutobuildTool(autobuild_base.AutobuildBase): |
54 |
class AutobuildTool(autobuild_base.AutobuildBase): |
55 |
def get_details(self): |
55 |
def get_details(self): |
56 |
return dict(name=self.name_from_file(__file__), |
56 |
return dict(name=self.name_from_file(__file__), |
57 |
description="Builds platform targets.") |
57 |
description="Builds platform targets.") |
58 | 58 | ||
59 |
def register(self, parser): |
59 |
def register(self, parser): |
60 |
parser.add_argument('--config-file', |
60 |
parser.add_argument('--config-file', |
61 |
dest='config_file', |
61 |
dest='config_file', |
62 |
default=configfile.AUTOBUILD_CONFIG_FILE, |
62 |
default=configfile.AUTOBUILD_CONFIG_FILE, |
63 | help="") |
63 | help='(defaults to $AUTOBUILD_CONFIG_FILE or "autobuild.xml")') |
64 |
parser.add_argument('--no-configure', |
64 |
parser.add_argument('--no-configure', |
65 |
dest='do_not_configure', |
65 |
dest='do_not_configure', |
66 |
default=False, |
66 |
default=False, |
67 |
action="store_true", |
67 |
action="store_true", |
68 |
help="do not configure before building") |
68 |
help="do not configure before building") |
69 |
parser.add_argument('build_extra_arguments', nargs="*", metavar='OPT', |
69 |
parser.add_argument('build_extra_arguments', nargs="*", metavar='OPT', |
70 |
help="an option to pass to the build command" ) |
70 |
help="an option to pass to the build command" ) |
71 |
parser.add_argument('--all','-a',dest='all', default=False, action="store_true", |
71 |
parser.add_argument('--all','-a',dest='all', default=False, action="store_true", |
72 |
help="build all configurations") |
72 |
help="build all configurations") |
73 |
parser.add_argument('--configuration', '-c', nargs='?', action="append", dest='configurations', |
73 |
parser.add_argument('--configuration', '-c', nargs='?', action="append", dest='configurations', |
... | 76 lines hidden [Expand] |
autobuild/autobuild_tool_configure.py | |
---|---|
Revision 9ee2db08d677 | New Change |
autobuild/autobuild_tool_edit.py | |
---|---|
Revision 9ee2db08d677 | New Change |
autobuild/autobuild_tool_install.py | |
---|---|
Revision 9ee2db08d677 | New Change |
autobuild/autobuild_tool_installables.py | |
---|---|
Revision 9ee2db08d677 | New Change |
autobuild/autobuild_tool_manifest.py | |
---|---|
Revision 9ee2db08d677 | New Change |
autobuild/autobuild_tool_package.py | |
---|---|
Revision 9ee2db08d677 | New Change |
autobuild/autobuild_tool_print.py | |
---|---|
Revision 9ee2db08d677 | New Change |
autobuild/autobuild_tool_uninstall.py | |
---|---|
Revision 9ee2db08d677 | New Change |
autobuild/configfile.py | |
---|---|
Revision 9ee2db08d677 | New Change |
- autobuild/autobuild_tool_build.py:
- autobuild/autobuild_tool_configure.py:
- autobuild/autobuild_tool_edit.py:
- autobuild/autobuild_tool_install.py:
- autobuild/autobuild_tool_installables.py:
- autobuild/autobuild_tool_manifest.py:
- autobuild/autobuild_tool_package.py:
- autobuild/autobuild_tool_print.py:
- autobuild/autobuild_tool_uninstall.py:
- autobuild/configfile.py:
Other reviews