Move most of the root package into a subcrate. (#1445)

This improves incremental build time when working on what was previously
the root package. For example, previously all plugins would be rebuilt
with a change to `src/commands/classified/external.rs`, but now only
`nu-cli` will have to be rebuilt (and anything that depends on it).
This commit is contained in:
Jason Gedge 2020-03-04 13:58:20 -05:00 committed by GitHub
parent c731a5b628
commit b2c5af457e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
210 changed files with 239 additions and 206 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
target

1
.gitignore vendored
View File

@ -4,6 +4,7 @@
history.txt
tests/fixtures/nuplayground
crates/*/target
# Debian/Ubuntu
debian/.debhelper/
debian/debhelper-build-stamp

85
Cargo.lock generated
View File

@ -2190,6 +2190,61 @@ dependencies = [
[[package]]
name = "nu"
version = "0.10.1"
dependencies = [
"clap",
"clipboard",
"crossterm 0.16.0",
"ctrlc",
"dunce",
"futures 0.3.3",
"log",
"nu-build",
"nu-cli",
"nu-errors",
"nu-macros",
"nu-parser",
"nu-plugin",
"nu-protocol",
"nu-source",
"nu-test-support",
"nu-value-ext",
"nu_plugin_average",
"nu_plugin_binaryview",
"nu_plugin_fetch",
"nu_plugin_inc",
"nu_plugin_match",
"nu_plugin_post",
"nu_plugin_ps",
"nu_plugin_shuffle",
"nu_plugin_str",
"nu_plugin_sum",
"nu_plugin_sys",
"nu_plugin_textview",
"nu_plugin_tree",
"onig_sys",
"pretty_assertions",
"pretty_env_logger 0.4.0",
"semver",
"serde 1.0.104",
"starship",
"syntect",
"toml 0.5.6",
"url",
]
[[package]]
name = "nu-build"
version = "0.10.0"
dependencies = [
"lazy_static 1.4.0",
"serde 1.0.104",
"serde_json",
"toml 0.5.6",
]
[[package]]
name = "nu-cli"
version = "0.10.0"
dependencies = [
"ansi_term 0.12.1",
"app_dirs",
@ -2203,8 +2258,6 @@ dependencies = [
"cfg-if",
"chrono",
"clap",
"clipboard",
"crossterm 0.16.0",
"csv",
"ctrlc",
"derive-new",
@ -2237,22 +2290,8 @@ dependencies = [
"nu-source",
"nu-test-support",
"nu-value-ext",
"nu_plugin_average",
"nu_plugin_binaryview",
"nu_plugin_fetch",
"nu_plugin_inc",
"nu_plugin_match",
"nu_plugin_post",
"nu_plugin_ps",
"nu_plugin_shuffle",
"nu_plugin_str",
"nu_plugin_sum",
"nu_plugin_sys",
"nu_plugin_textview",
"nu_plugin_tree",
"num-bigint",
"num-traits 0.2.11",
"onig_sys",
"parking_lot",
"pin-utils",
"pretty-hex",
@ -2265,7 +2304,6 @@ dependencies = [
"roxmltree",
"rusqlite",
"rustyline",
"semver",
"serde 1.0.104",
"serde-hjson 0.9.1",
"serde_bytes",
@ -2274,9 +2312,7 @@ dependencies = [
"serde_urlencoded",
"serde_yaml",
"shellexpand",
"starship",
"strip-ansi-escapes",
"syntect",
"tempfile",
"term",
"termcolor",
@ -2286,21 +2322,10 @@ dependencies = [
"typetag",
"umask",
"unicode-xid",
"url",
"users",
"which",
]
[[package]]
name = "nu-build"
version = "0.10.0"
dependencies = [
"lazy_static 1.4.0",
"serde 1.0.104",
"serde_json",
"toml 0.5.6",
]
[[package]]
name = "nu-errors"
version = "0.10.0"

View File

@ -13,34 +13,12 @@ documentation = "https://www.nushell.sh/book/"
exclude = ["images"]
[workspace]
members = [
"crates/nu-macros",
"crates/nu-errors",
"crates/nu-source",
"crates/nu_plugin_average",
"crates/nu_plugin_binaryview",
"crates/nu_plugin_fetch",
"crates/nu_plugin_inc",
"crates/nu_plugin_match",
"crates/nu_plugin_post",
"crates/nu_plugin_ps",
"crates/nu_plugin_shuffle",
"crates/nu_plugin_str",
"crates/nu_plugin_sum",
"crates/nu_plugin_sys",
"crates/nu_plugin_textview",
"crates/nu_plugin_tree",
"crates/nu-protocol",
"crates/nu-plugin",
"crates/nu-parser",
"crates/nu-value-ext",
"crates/nu-build"
]
members = ["crates/*/"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
nu-cli = { version = "0.10.0", path = "./crates/nu-cli" }
nu-source = { version = "0.10.0", path = "./crates/nu-source" }
nu-plugin = { version = "0.10.0", path = "./crates/nu-plugin" }
nu-protocol = { version = "0.10.0", path = "./crates/nu-protocol" }
@ -62,83 +40,29 @@ nu_plugin_textview = { version = "0.10.0", path = "./crates/nu_plugin_textview",
nu_plugin_tree = { version = "0.10.0", path = "./crates/nu_plugin_tree", optional=true }
nu-macros = { version = "0.10.0", path = "./crates/nu-macros" }
query_interface = "0.3.5"
typetag = "0.1.4"
rustyline = "6.0.0"
chrono = { version = "0.4.10", features = ["serde"] }
derive-new = "0.5.8"
prettytable-rs = "0.8.0"
itertools = "0.8.2"
ansi_term = "0.12.1"
nom = "5.0.1"
clipboard = { version = "0.5", optional = true }
crossterm = { version = "0.16.0", optional = true }
onig_sys = { version = "=69.1.0", optional = true }
semver = { version = "0.9.0", optional = true }
starship = { version = "0.35.1", optional = true }
syntect = { version = "3.2.0", optional = true }
url = { version = "2.1.1", optional = true }
clap = "2.33.0"
ctrlc = "3.1.3"
dunce = "1.0.0"
indexmap = { version = "1.3.2", features = ["serde-1"] }
byte-unit = "3.0.3"
base64 = "0.11"
futures = { version = "0.3", features = ["compat", "io-compat"] }
async-stream = "0.2"
futures_codec = "0.4"
num-traits = "0.2.11"
term = "0.5.2"
bytes = "0.4.12"
log = "0.4.8"
pretty_env_logger = "0.4.0"
serde = { version = "1.0.104", features = ["derive"] }
bson = { version = "0.14.0", features = ["decimal128"] }
serde_json = "1.0.47"
serde-hjson = "0.9.1"
serde_yaml = "0.8"
serde_bytes = "0.11.3"
getset = "0.0.9"
language-reporting = "0.4.0"
app_dirs = "1.2.1"
csv = "1.1"
[dev-dependencies]
pretty_assertions = "0.6.1"
nu-test-support = { version = "0.10.0", path = "./crates/nu-test-support" }
[build-dependencies]
toml = "0.5.6"
clap = "2.33.0"
git2 = { version = "0.11.0", default_features = false }
dirs = "2.0.2"
glob = "0.3.0"
ctrlc = "3.1.3"
roxmltree = "0.9.1"
nom_locate = "1.0.0"
nom-tracable = "0.4.1"
unicode-xid = "0.2.0"
serde_ini = "0.2.0"
pretty-hex = "0.1.1"
hex = "0.4"
tempfile = "3.1.0"
which = "3.1.0"
ichwh = "0.3"
textwrap = {version = "0.11.0", features = ["term_size"]}
shellexpand = "1.1.1"
pin-utils = "0.1.0-alpha.4"
num-bigint = { version = "0.2.6", features = ["serde"] }
bigdecimal = { version = "0.1.0", features = ["serde"] }
serde_urlencoded = "0.6.1"
trash = "1.0.0"
regex = "1"
cfg-if = "0.1"
strip-ansi-escapes = "0.1.0"
calamine = "0.16"
umask = "0.1"
futures-util = "0.3.4"
termcolor = "1.1.0"
natural = "0.3.0"
parking_lot = "0.10.0"
meval = "0.2"
clipboard = {version = "0.5", optional = true }
ptree = {version = "0.2" }
starship = { version = "0.35.1", optional = true}
syntect = {version = "3.2.0", optional = true }
onig_sys = {version = "=69.1.0", optional = true }
crossterm = {version = "0.16.0", optional = true}
url = {version = "2.1.1", optional = true}
semver = {version = "0.9.0", optional = true}
filesize = "0.1.0"
[target.'cfg(unix)'.dependencies]
users = "0.9"
serde = { version = "1.0.104", features = ["derive"] }
nu-build = { version = "0.10.0", path = "./crates/nu-build" }
[features]
# Test executables
@ -166,24 +90,6 @@ sum = ["nu_plugin_sum"]
trace = ["nu-parser/trace"]
tree = ["nu_plugin_tree"]
[dependencies.rusqlite]
version = "0.20.0"
features = ["bundled", "blob"]
[dev-dependencies]
pretty_assertions = "0.6.1"
nu-test-support = { version = "0.10.0", path = "./crates/nu-test-support" }
[build-dependencies]
toml = "0.5.6"
serde = { version = "1.0.104", features = ["derive"] }
nu-build = { version = "0.10.0", path = "./crates/nu-build" }
[lib]
name = "nu"
doctest = false
path = "src/lib.rs"
[[bin]]
name = "fail"
path = "crates/nu-test-support/src/bins/fail.rs"

99
crates/nu-cli/Cargo.toml Normal file
View File

@ -0,0 +1,99 @@
[package]
name = "nu-cli"
version = "0.10.0"
authors = ["Yehuda Katz <wycats@gmail.com>", "Jonathan Turner <jonathan.d.turner@gmail.com>", "Andrés N. Robalino <andres@androbtech.com>"]
description = "CLI for nushell"
edition = "2018"
[lib]
doctest = false
[dependencies]
nu-source = { version = "0.10.0", path = "../nu-source" }
nu-plugin = { version = "0.10.0", path = "../nu-plugin" }
nu-protocol = { version = "0.10.0", path = "../nu-protocol" }
nu-errors = { version = "0.10.0", path = "../nu-errors" }
nu-parser = { version = "0.10.0", path = "../nu-parser" }
nu-value-ext = { version = "0.10.0", path = "../nu-value-ext" }
nu-macros = { version = "0.10.0", path = "../nu-macros" }
nu-test-support = { version = "0.10.0", path = "../nu-test-support" }
ansi_term = "0.12.1"
app_dirs = "1.2.1"
async-stream = "0.2"
base64 = "0.11"
bigdecimal = { version = "0.1.0", features = ["serde"] }
bson = { version = "0.14.0", features = ["decimal128"] }
byte-unit = "3.0.3"
bytes = "0.4.12"
calamine = "0.16"
cfg-if = "0.1"
chrono = { version = "0.4.10", features = ["serde"] }
clap = "2.33.0"
csv = "1.1"
ctrlc = "3.1.3"
derive-new = "0.5.8"
dirs = "2.0.2"
dunce = "1.0.0"
filesize = "0.1.0"
futures = { version = "0.3", features = ["compat", "io-compat"] }
futures-util = "0.3.4"
futures_codec = "0.4"
getset = "0.0.9"
git2 = { version = "0.11.0", default_features = false }
glob = "0.3.0"
hex = "0.4"
ichwh = "0.3"
indexmap = { version = "1.3.2", features = ["serde-1"] }
itertools = "0.8.2"
language-reporting = "0.4.0"
log = "0.4.8"
meval = "0.2"
natural = "0.3.0"
nom = "5.0.1"
nom-tracable = "0.4.1"
nom_locate = "1.0.0"
num-bigint = { version = "0.2.6", features = ["serde"] }
num-traits = "0.2.11"
parking_lot = "0.10.0"
pin-utils = "0.1.0-alpha.4"
pretty-hex = "0.1.1"
pretty_env_logger = "0.4.0"
prettytable-rs = "0.8.0"
ptree = {version = "0.2" }
query_interface = "0.3.5"
regex = "1"
roxmltree = "0.9.1"
rustyline = "6.0.0"
serde = { version = "1.0.104", features = ["derive"] }
serde-hjson = "0.9.1"
serde_bytes = "0.11.3"
serde_ini = "0.2.0"
serde_json = "1.0.47"
serde_urlencoded = "0.6.1"
serde_yaml = "0.8"
shellexpand = "1.1.1"
strip-ansi-escapes = "0.1.0"
tempfile = "3.1.0"
term = "0.5.2"
termcolor = "1.1.0"
textwrap = {version = "0.11.0", features = ["term_size"]}
toml = "0.5.6"
trash = "1.0.0"
typetag = "0.1.4"
umask = "0.1"
unicode-xid = "0.2.0"
which = "3.1.0"
[target.'cfg(unix)'.dependencies]
users = "0.9"
[dependencies.rusqlite]
version = "0.20.0"
features = ["bundled", "blob"]
[dev-dependencies]
pretty_assertions = "0.6.1"
[build-dependencies]
nu-build = { version = "0.10.0", path = "../nu-build" }

View File

@ -93,44 +93,27 @@ fn load_plugin(path: &std::path::Path, context: &mut Context) -> Result<(), Shel
}
fn search_paths() -> Vec<std::path::PathBuf> {
use std::env;
let mut search_paths = Vec::new();
#[cfg(debug_assertions)]
{
// Use our debug plugins in debug mode
let mut path = std::path::PathBuf::from(".");
path.push("target");
path.push("debug");
if path.exists() {
search_paths.push(path);
// Automatically add path `nu` is in as a search path
if let Ok(exe_path) = env::current_exe() {
if let Some(exe_dir) = exe_path.parent() {
search_paths.push(exe_dir.to_path_buf());
}
}
#[cfg(not(debug_assertions))]
{
use std::env;
match env::var_os("PATH") {
Some(paths) => {
search_paths = env::split_paths(&paths).collect::<Vec<_>>();
search_paths.extend(env::split_paths(&paths).collect::<Vec<_>>());
}
None => println!("PATH is not defined in the environment."),
}
// Use our release plugins in release mode
let mut path = std::path::PathBuf::from(".");
path.push("target");
path.push("release");
if path.exists() {
search_paths.push(path);
}
}
// permit Nu finding and picking up development plugins
// if there are any first.
search_paths.reverse();
search_paths
}

Some files were not shown because too many files have changed in this diff Show More