-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref(daemon): resuse serde and lua for serialization
- Loading branch information
Showing
18 changed files
with
400 additions
and
446 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
use mlua::lua_module; | ||
use mlua::prelude::*; | ||
use xcodebase::daemon::Daemon; | ||
use xcodebase::daemon::*; | ||
|
||
#[lua_module] | ||
#[mlua::lua_module] | ||
fn libxcodebase(lua: &Lua) -> LuaResult<LuaTable> { | ||
let commands = lua.create_table()?; | ||
let module = lua.create_table()?; | ||
module.set("commands", commands)?; | ||
module.set("daemon", Daemon::lua(lua)?)?; | ||
Ok(module) | ||
let is_running = lua.create_function(Daemon::is_running)?; | ||
let ensure = lua.create_function(Daemon::ensure)?; | ||
let register = lua.create_function(Register::request)?; | ||
let drop = lua.create_function(Drop::request)?; | ||
let build = lua.create_function(Build::request)?; | ||
let project_info = lua.create_function(ProjectInfo::request)?; | ||
|
||
lua.create_table_from([ | ||
("is_running", is_running), | ||
("ensure", ensure), | ||
("register", register), | ||
("drop", drop), | ||
("build", build), | ||
("project_info", project_info), | ||
]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.