Phillip Smyth pushed to branch mandatory_suffix at BuildStream / buildstream
Commits:
-
25584157
by Phillip Smyth at 2018-11-22T12:01:04Z
1 changed file:
Changes:
... | ... | @@ -97,7 +97,13 @@ class Loader(): |
97 | 97 |
# Returns: The toplevel LoadElement
|
98 | 98 |
def load(self, targets, rewritable=False, ticker=None, fetch_subprojects=False):
|
99 | 99 |
|
100 |
+ invalid_file_extension = False
|
|
101 |
+ invalid_files = []
|
|
100 | 102 |
for filename in targets:
|
103 |
+ if not filename.endswith(".bst"):
|
|
104 |
+ invalid_file_extension = True
|
|
105 |
+ invalid_files.append(filename)
|
|
106 |
+ |
|
101 | 107 |
if os.path.isabs(filename):
|
102 | 108 |
# XXX Should this just be an assertion ?
|
103 | 109 |
# Expect that the caller gives us the right thing at least ?
|
... | ... | @@ -106,6 +112,13 @@ class Loader(): |
106 | 112 |
"path to the base project directory: {}"
|
107 | 113 |
.format(filename, self._basedir))
|
108 | 114 |
|
115 |
+ if invalid_file_extension:
|
|
116 |
+ raise LoadError(LoadErrorReason.INVALID_DATA,
|
|
117 |
+ "Target elements '{}' do not have expected file extension `.bst`\n"
|
|
118 |
+ "Improperly named elements will not be discoverable by commands"
|
|
119 |
+ .format(invalid_files))
|
|
120 |
+ |
|
121 |
+ |
|
109 | 122 |
# First pass, recursively load files and populate our table of LoadElements
|
110 | 123 |
#
|
111 | 124 |
deps = []
|