[build] Return output from add_input call

Allow for dependency chaining in *.module files by returning the
expected output from a module.add_input() call.
This commit is contained in:
Justin C. Miller
2021-08-28 18:12:51 -07:00
parent 28068ed36d
commit 80f815c020
2 changed files with 15 additions and 6 deletions

View File

@@ -56,14 +56,15 @@ class Source:
self.__deps = deps
def __str__(self):
return "{} {}:{}:{}".format(self.action, self.output, self.name, self.input)
return self.input
@property
def action(self):
suffix = self.__path.suffix
return self.Actions.get(suffix)
def get_output(self, output_root):
@property
def output(self):
if not self.action:
return None
@@ -71,7 +72,7 @@ class Source:
if path is None:
path = self.action.output_of(self.__path)
return path and Source(output_root, path)
return path and Source("${module_dir}", path)
deps = property(lambda self: self.__deps)
name = property(lambda self: str(self.__path))