Skip to content

Commit

Permalink
Make rbx_reflector library
Browse files Browse the repository at this point in the history
  • Loading branch information
DervexDev committed Jun 6, 2024
1 parent f6007d5 commit bd37407
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 11 deletions.
5 changes: 4 additions & 1 deletion rbx_reflector/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ authors = ["Micah Hinckley (@nezuo)"]
repository = "https://github.com/rojo-rbx/rbx-dom/"
license = "MIT"
edition = "2021"
publish = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
name = "rbx_reflector"
path = "src/lib.rs"

[dependencies]
rbx_dom_weak = { path = "../rbx_dom_weak" }
rbx_reflection = { path = "../rbx_reflection" }
Expand Down
8 changes: 4 additions & 4 deletions rbx_reflector/src/cli/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod defaults_place;
mod dump;
mod generate;
mod values;
pub(crate) mod defaults_place;
pub(crate) mod dump;
pub(crate) mod generate;
pub(crate) mod values;

use clap::Parser;

Expand Down
35 changes: 35 additions & 0 deletions rbx_reflector/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
use std::path::PathBuf;

use cli::defaults_place::StudioInfo;

mod api_dump;
pub mod cli;
mod defaults;
mod patches;

pub fn defaults_place(api_dump: PathBuf, output: PathBuf) -> anyhow::Result<StudioInfo> {
cli::defaults_place::DefaultsPlaceSubcommand { api_dump, output }.run()
}

pub fn dump(output: PathBuf) -> anyhow::Result<()> {
cli::dump::DumpSubcommand { output }.run()
}

pub fn generate(
patches: Option<PathBuf>,
output: Vec<PathBuf>,
no_pretty: bool,
human_readable: bool,
) -> anyhow::Result<()> {
cli::generate::GenerateSubcommand {
patches,
output,
no_pretty,
human_readable,
}
.run()
}

pub fn values(output: PathBuf) -> anyhow::Result<()> {
cli::values::ValuesSubcommand { output }.run()
}
7 changes: 1 addition & 6 deletions rbx_reflector/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
mod api_dump;
mod cli;
mod defaults;
mod patches;

use clap::Parser;

use crate::cli::Args;
use rbx_reflector::cli::Args;

fn main() {
let args = Args::parse();
Expand Down

0 comments on commit bd37407

Please sign in to comment.