lux_lib/rockspec/build/backend/
mod.rs1pub(crate) mod builtin;
4mod cmake;
5mod make;
6mod rust_binary;
7mod rust_mlua;
8mod treesitter;
9
10pub use builtin::{Builtin, Module, ModulePaths, ModuleSpec, ParseLuaModuleError};
11pub use cmake::CMake;
12pub use make::Make;
13pub use rust_binary::RustBinary;
14pub use rust_mlua::RustMlua;
15pub use treesitter::Treesitter;
16
17impl Default for Spec {
18 fn default() -> Self {
19 Self::Builtin(Builtin::default())
20 }
21}
22
23#[derive(Debug, PartialEq, Clone)]
30pub enum Spec {
31 Builtin(Builtin),
32 Make(Make),
33 CMake(CMake),
34 Command(Command),
35 LuaRock(String),
36 RustMlua(RustMlua),
37 RustBinary(RustBinary),
38 TreesitterParser(Treesitter),
39 Source,
45}
46
47impl Spec {
48 pub(crate) fn can_use_build_dependencies(&self) -> bool {
49 match self {
50 Self::Make(_) | Self::CMake(_) | Self::Command(_) | Self::LuaRock(_) => true,
51 Self::Builtin(_)
52 | Self::RustMlua(_)
53 | Self::RustBinary(_)
54 | Self::TreesitterParser(_)
55 | Self::Source => false,
56 }
57 }
58}
59
60#[derive(Debug, PartialEq, Clone)]
62pub struct Command {
63 pub build_command: Option<String>,
64 pub install_command: Option<String>,
65}