diff --git a/osdk/builder.py b/osdk/builder.py index aec51ad..21e6eda 100644 --- a/osdk/builder.py +++ b/osdk/builder.py @@ -76,8 +76,8 @@ def gen(out: TextIO, context: Context): writer.newline() -def build(componentSpec: str, targetSpec: str) -> str: - context = contextFor(targetSpec) +def build(componentSpec: str, targetSpec: str, props: Props = {}) -> str: + context = contextFor(targetSpec, props) target = context.target shell.mkdir(context.builddir()) diff --git a/osdk/context.py b/osdk/context.py index d3fd46e..f84c5d3 100644 --- a/osdk/context.py +++ b/osdk/context.py @@ -186,7 +186,7 @@ def instanciate(componentSpec: str, components: list[ComponentManifest], target: context: dict = {} -def contextFor(targetSpec: str) -> Context: +def contextFor(targetSpec: str, props: Props = {}) -> Context: if targetSpec in context: return context[targetSpec] @@ -198,6 +198,8 @@ def contextFor(targetSpec: str) -> Context: targetEls[0] = "host-" + shell.uname().machine target = loadTarget(targetEls[0]) + target.props |= props + components = loadAllComponents() components = filterDisabled(components, target) @@ -221,7 +223,6 @@ def contextFor(targetSpec: str) -> Context: for component in components: for toolSpec in component.tools: tool = component.tools[toolSpec] - tools[toolSpec].args += tool.args instances = cast(list[ComponentInstance], list(filter(lambda e: e != None, map(lambda c: instanciate(