aboutsummaryrefslogtreecommitdiff
path: root/src/Conf.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-11-03 06:11:09 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-03 06:11:09 +0100
commit1a6c67af3851748a0a604e3b3e99bd63f3f576a0 (patch)
treecdf4c0fe3ede4c4b966941a6bb3dd0af6ca0a769 /src/Conf.cpp
parent396598030927a8e531bd68ba3b382f86645af6c6 (diff)
Remove ability to use git projects as dependencies. Users can add them as git submodules instead
Diffstat (limited to 'src/Conf.cpp')
-rw-r--r--src/Conf.cpp82
1 files changed, 0 insertions, 82 deletions
diff --git a/src/Conf.cpp b/src/Conf.cpp
index 74c311c..12421e0 100644
--- a/src/Conf.cpp
+++ b/src/Conf.cpp
@@ -649,11 +649,6 @@ namespace sibs
{
//delete dependency;
}
-
- for(GitDependency *dependency : gitDependencies)
- {
- //delete dependency;
- }
*/
}
@@ -1112,83 +1107,6 @@ namespace sibs
dependency->version = dependencyVersionResult.unwrap();
packageListDependencies.emplace_back(dependency);
}
- else if(value.isObject())
- {
- enum class DepType
- {
- NONE,
- GIT
- };
-
- DepType depType = DepType::NONE;
- for(auto it : value.asObject())
- {
- DepType fieldDepType = DepType::NONE;
- if(it.first == "git" || it.first == "branch" || it.first == "revision")
- fieldDepType = DepType::GIT;
-
- if(fieldDepType == DepType::NONE)
- {
- string errMsg = "Invalid dependency object field \"";
- errMsg += it.first;
- errMsg += "\"";
- throw ParserException(errMsg);
- }
-
- if(depType != DepType::NONE && fieldDepType != depType)
- {
- switch(depType)
- {
- case DepType::GIT:
- {
- string errMsg = "Invalid dependency object field \"";
- errMsg += it.first;
- errMsg += "\" is invalid for a git dependency";
- throw ParserException(errMsg);
- }
- default:
- throw ParserException("Invalid dependency object");
- }
- }
- depType = fieldDepType;
- }
-
- switch(depType)
- {
- case DepType::GIT:
- {
- auto gitIt = value.asObject().find("git");
- if(gitIt == value.asObject().end())
- {
- throw ParserException("Required field \"git\" is missing from git dependency. Expected an url to location of git repository");
- }
-
- auto branchIt = value.asObject().find("branch");
- string branch;
- if(branchIt == value.asObject().end())
- branch = "master";
- else
- branch = string(branchIt->second.data, branchIt->second.size);
-
- auto revisionIt = value.asObject().find("revision");
- string revision;
- if(revisionIt == value.asObject().end())
- revision = "HEAD";
- else
- revision = string(revisionIt->second.data, revisionIt->second.size);
-
- GitDependency *dependency = new GitDependency();
- dependency->name = string(name.data, name.size);
- dependency->url = string(gitIt->second.data, gitIt->second.size);
- dependency->branch = branch;
- dependency->revision = revision;
- gitDependencies.emplace_back(dependency);
- break;
- }
- default:
- throw ParserException("Invalid dependency object");
- }
- }
else
throw ParserException("Expected field under dependencies to be a single value or an object, was a list");
}