mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-11-30 14:48:09 +03:00
plumb the isolated compile script into Buck
This commit is contained in:
parent
ceaff7bfd3
commit
6fbc1ed76b
4
prelude-nri/elm/BUCK
Normal file
4
prelude-nri/elm/BUCK
Normal file
@ -0,0 +1,4 @@
|
||||
export_file(
|
||||
name = "isolated_compile.py",
|
||||
visibility = ["PUBLIC"],
|
||||
)
|
@ -1,8 +1,9 @@
|
||||
ElmToolchainInfo = provider(fields=[
|
||||
"elm",
|
||||
"isolated_compile",
|
||||
])
|
||||
|
||||
def _system_elm_toolchain_impl(_ctx) -> [[DefaultInfo.type, ElmToolchainInfo.type]]:
|
||||
def _system_elm_toolchain_impl(ctx) -> [[DefaultInfo.type, ElmToolchainInfo.type]]:
|
||||
"""
|
||||
An Elm toolchain that assumes the current environment has all the binaries
|
||||
it needs in PATH.
|
||||
@ -11,13 +12,16 @@ def _system_elm_toolchain_impl(_ctx) -> [[DefaultInfo.type, ElmToolchainInfo.typ
|
||||
DefaultInfo(),
|
||||
ElmToolchainInfo(
|
||||
elm = RunInfo(args = ["elm"]),
|
||||
isolated_compile = ctx.attrs._isolated_compile,
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
system_elm_toolchain = rule(
|
||||
impl = _system_elm_toolchain_impl,
|
||||
attrs = {},
|
||||
attrs = {
|
||||
"_isolated_compile": attrs.dep(default="prelude-nri//elm:isolated_compile.py"),
|
||||
},
|
||||
is_toolchain_rule = True,
|
||||
)
|
||||
|
||||
@ -30,6 +34,7 @@ def _elm_toolchain_impl(ctx: "context") -> [[DefaultInfo.type, ElmToolchainInfo.
|
||||
DefaultInfo(),
|
||||
ElmToolchainInfo(
|
||||
elm = ctx.attrs.elm[RunInfo],
|
||||
isolated_compile = ctx.attrs._isolated_compile,
|
||||
),
|
||||
]
|
||||
|
||||
@ -37,6 +42,7 @@ elm_toolchain = rule(
|
||||
impl = _elm_toolchain_impl,
|
||||
attrs = {
|
||||
"elm": attrs.dep(providers = [RunInfo]),
|
||||
"_isolated_compile": attrs.dep(default="prelude-nri//elm:isolated_compile.py"),
|
||||
},
|
||||
is_toolchain_rule = True,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user