summaryrefslogtreecommitdiff
path: root/tools/minicargo/manifest.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2019-11-03 15:49:54 +0800
committerJohn Hodge <tpg@mutabah.net>2019-11-03 15:49:54 +0800
commit0b2d92ce3e79f47ddf28be080245eca574828433 (patch)
treed14781233678425afd1c14ad228a458fa08d64df /tools/minicargo/manifest.cpp
parent9ebc54d62808d6e6fb8387f245344bcafc870293 (diff)
downloadmrust-0b2d92ce3e79f47ddf28be080245eca574828433.tar.gz
minicargo - Hack in workspace support (for `[patch]`)
Diffstat (limited to 'tools/minicargo/manifest.cpp')
-rw-r--r--tools/minicargo/manifest.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/minicargo/manifest.cpp b/tools/minicargo/manifest.cpp
index c385072d..58e70438 100644
--- a/tools/minicargo/manifest.cpp
+++ b/tools/minicargo/manifest.cpp
@@ -140,6 +140,17 @@ PackageManifest PackageManifest::load_from_toml(const ::std::string& path)
{
//rv.m_create_auto_bench = key_val.value.as_bool();
}
+ else if( key == "workspace" )
+ {
+ if( rv.m_workspace_manifest.is_valid() )
+ {
+ ::std::cerr << toml_file.lexer() << ": Duplicate workspace specification" << ::std::endl;
+ }
+ else
+ {
+ rv.m_workspace_manifest = key_val.value.as_string();
+ }
+ }
else
{
// Unknown value in `package`
@@ -292,7 +303,12 @@ PackageManifest PackageManifest::load_from_toml(const ::std::string& path)
}
else if( section == "workspace" )
{
- // TODO: Workspaces?
+ // NOTE: This will be parsed in full by other code?
+ if( ! rv.m_workspace_manifest.is_valid() )
+ {
+ // TODO: if the workspace was specified via `[package] workspace` then error
+ rv.m_workspace_manifest = rv.m_manifest_path;
+ }
}
// crates.io metadata
else if( section == "badges" )