mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Convert core to library for easier testing
This commit is contained in:
parent
8d87d81f49
commit
6c0a0efd5b
3 changed files with 28 additions and 22 deletions
|
|
@ -6,6 +6,10 @@ description = "A tool to create robust Roblox projects"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://github.com/LPGhatguy/rojo"
|
repository = "https://github.com/LPGhatguy/rojo"
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
name = "rojo_core"
|
||||||
|
path = "src/lib.rs"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "rojo"
|
name = "rojo"
|
||||||
path = "src/bin.rs"
|
path = "src/bin.rs"
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,11 @@
|
||||||
#[macro_use] extern crate serde_derive;
|
|
||||||
#[macro_use] extern crate rouille;
|
|
||||||
#[macro_use] extern crate clap;
|
#[macro_use] extern crate clap;
|
||||||
#[macro_use] extern crate lazy_static;
|
|
||||||
extern crate notify;
|
|
||||||
extern crate rand;
|
|
||||||
extern crate serde;
|
|
||||||
extern crate serde_json;
|
|
||||||
extern crate regex;
|
|
||||||
|
|
||||||
pub mod rbx_session;
|
extern crate rojo_core;
|
||||||
pub mod id;
|
|
||||||
pub mod web;
|
|
||||||
pub mod core;
|
|
||||||
pub mod project;
|
|
||||||
pub mod pathext;
|
|
||||||
pub mod vfs;
|
|
||||||
pub mod rbx;
|
|
||||||
pub mod middleware;
|
|
||||||
pub mod middlewares;
|
|
||||||
pub mod commands;
|
|
||||||
|
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::process;
|
use std::process;
|
||||||
|
|
||||||
use pathext::canonicalish;
|
use rojo_core::pathext::canonicalish;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let matches = clap_app!(rojo =>
|
let matches = clap_app!(rojo =>
|
||||||
|
|
@ -61,7 +43,7 @@ fn main() {
|
||||||
let project_path = Path::new(sub_matches.value_of("PATH").unwrap_or("."));
|
let project_path = Path::new(sub_matches.value_of("PATH").unwrap_or("."));
|
||||||
let full_path = canonicalish(project_path);
|
let full_path = canonicalish(project_path);
|
||||||
|
|
||||||
commands::init(&full_path);
|
rojo_core::commands::init(&full_path);
|
||||||
},
|
},
|
||||||
("serve", sub_matches) => {
|
("serve", sub_matches) => {
|
||||||
let sub_matches = sub_matches.unwrap();
|
let sub_matches = sub_matches.unwrap();
|
||||||
|
|
@ -84,7 +66,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
commands::serve(&project_path, verbose, port);
|
rojo_core::commands::serve(&project_path, verbose, port);
|
||||||
},
|
},
|
||||||
("pack", _) => {
|
("pack", _) => {
|
||||||
eprintln!("'rojo pack' is not yet implemented!");
|
eprintln!("'rojo pack' is not yet implemented!");
|
||||||
|
|
|
||||||
20
server/src/lib.rs
Normal file
20
server/src/lib.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
#[macro_use] extern crate serde_derive;
|
||||||
|
#[macro_use] extern crate rouille;
|
||||||
|
#[macro_use] extern crate lazy_static;
|
||||||
|
extern crate notify;
|
||||||
|
extern crate rand;
|
||||||
|
extern crate serde;
|
||||||
|
extern crate serde_json;
|
||||||
|
extern crate regex;
|
||||||
|
|
||||||
|
pub mod rbx_session;
|
||||||
|
pub mod id;
|
||||||
|
pub mod web;
|
||||||
|
pub mod core;
|
||||||
|
pub mod project;
|
||||||
|
pub mod pathext;
|
||||||
|
pub mod vfs;
|
||||||
|
pub mod rbx;
|
||||||
|
pub mod middleware;
|
||||||
|
pub mod middlewares;
|
||||||
|
pub mod commands;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue