- added support for args in Builder trait
- added is_lib arg for compiler to produce non-main assembly outputs - updated templates to use include_str
This commit is contained in:
@@ -5,7 +5,7 @@ edition.workspace = true
|
||||
authors.workspace = true
|
||||
|
||||
[[bin]]
|
||||
name = "assembler"
|
||||
name = "dsa-a"
|
||||
path = "src/main.rs"
|
||||
|
||||
[lib]
|
||||
|
||||
@@ -58,6 +58,7 @@ impl From<AssembleError> for BuildError {
|
||||
|
||||
impl Builder for Assembler {
|
||||
type Output = Vec<u8>;
|
||||
type Args = ();
|
||||
|
||||
fn logs(&self) -> Vec<String> {
|
||||
self.logs_rx.logs()
|
||||
@@ -78,7 +79,7 @@ impl Builder for Assembler {
|
||||
}
|
||||
|
||||
/// Start the compilation process in a separate thread
|
||||
fn start(&mut self) {
|
||||
fn start(&mut self, args: ()) {
|
||||
if self.is_running {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ fn main() {
|
||||
let output_path = &args[4];
|
||||
|
||||
let mut engine = Assembler::new(PathBuf::from(input_path));
|
||||
engine.start();
|
||||
engine.start(());
|
||||
let result = engine.output().expect("assembler failed.");
|
||||
|
||||
if let Err(e) = fs::write(output_path, result) {
|
||||
|
||||
Reference in New Issue
Block a user