Move the files for the binary into a separate folder

This commit is contained in:
Karol Belina 2021-06-06 11:42:59 +02:00
parent 97e9e6936c
commit ff52946943
12 changed files with 10 additions and 7 deletions

View File

@ -1,3 +1,3 @@
{
"rust-analyzer.cargo.allFeatures": true,
"rust-analyzer.cargo.features": ["bin"],
}

2
Cargo.lock generated
View File

@ -38,7 +38,7 @@ dependencies = [
[[package]]
name = "ruxnasm"
version = "0.1.2"
version = "0.1.3"
dependencies = [
"codespan-reporting",
"test-case",

View File

@ -1,6 +1,6 @@
[package]
name = "ruxnasm"
version = "0.1.2"
version = "0.1.3"
authors = ["Karol Belina <karolbelina@gmail.com>"]
edition = "2018"
description = "Alternative Uxntal assembler focused on error reporting"
@ -9,14 +9,17 @@ repository = "https://github.com/karolbelina/ruxnasm"
license = "MIT"
keywords = ["assembler", "uxn", "uxntal"]
categories = ["command-line-utilities", "compilers"]
exclude = [".github", ".vscode"]
exclude = [".github", ".vscode", "docs"]
[[bin]]
name = "ruxnasm"
required-features = ["codespan-reporting"]
required-features = ["bin"]
[features]
default = ["codespan-reporting"]
default = ["bin"]
# Feature required for the Ruxnasm binary. Should be disabled when depending on
# Ruxnasm as a library.
bin = ["codespan-reporting"]
[dependencies]
codespan-reporting = { version = "0.11.1", optional = true }

View File

@ -56,7 +56,7 @@ pub fn assemble(source: impl AsRef<str>) -> Result<Vec<u8>>
The library is available on [crates.io](https://crates.io/crates/ruxnasm) and can be included in your Cargo-enabled project like this:
```toml
[dependencies]
ruxnasm = "*"
ruxnasm = { version = "*", default-features = false } # Disable the default "bin" feature
```
and then used in your code like this:
```rust