mirror of
https://github.com/ModOrganizer2/mob.git
synced 2026-07-27 14:07:05 -07:00
added git_url_prefix
This commit is contained in:
@@ -13,6 +13,7 @@ mo_branch = master
|
||||
no_pull = false
|
||||
ignore_ts = false
|
||||
revert_ts = false
|
||||
git_url_prefix = https://github.com/
|
||||
git_shallow = true
|
||||
git_username =
|
||||
git_email =
|
||||
|
||||
@@ -29,7 +29,7 @@ void boost_di::do_fetch()
|
||||
instrument<times::fetch>([&]
|
||||
{
|
||||
run_tool(task_conf().make_git()
|
||||
.url(make_github_url("boost-experimental", "di"))
|
||||
.url(task_conf().make_git_url("boost-experimental", "di"))
|
||||
.branch("cpp14")
|
||||
.root(source_path()));
|
||||
});
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ void gtest::do_fetch()
|
||||
instrument<times::fetch>([&]
|
||||
{
|
||||
run_tool(task_conf().make_git()
|
||||
.url(make_github_url("google", "googletest"))
|
||||
.url(task_conf().make_git_url("google", "googletest"))
|
||||
.branch(version())
|
||||
.root(source_path()));
|
||||
});
|
||||
|
||||
@@ -29,7 +29,7 @@ void libffi::do_fetch()
|
||||
instrument<times::fetch>([&]
|
||||
{
|
||||
run_tool(task_conf().make_git()
|
||||
.url(make_github_url("python","cpython-bin-deps"))
|
||||
.url(task_conf().make_git_url("python","cpython-bin-deps"))
|
||||
.branch("libffi")
|
||||
.root(source_path()));
|
||||
});
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ void lz4::fetch_from_source()
|
||||
instrument<times::fetch>([&]
|
||||
{
|
||||
run_tool(task_conf().make_git()
|
||||
.url(make_github_url("lz4","lz4"))
|
||||
.url(task_conf().make_git_url("lz4","lz4"))
|
||||
.branch(version())
|
||||
.root(source_path()));
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ void modorganizer::do_fetch()
|
||||
instrument<times::fetch>([&]
|
||||
{
|
||||
run_tool(task_conf().make_git()
|
||||
.url(make_github_url(task_conf().mo_org(), repo_))
|
||||
.url(task_conf().make_git_url(task_conf().mo_org(), repo_))
|
||||
.branch(task_conf().mo_branch())
|
||||
.root(this_source_path()));
|
||||
});
|
||||
@@ -109,7 +109,7 @@ void modorganizer::do_build_and_install()
|
||||
{
|
||||
git_submodule_adder::instance().queue(std::move(
|
||||
task_conf().make_git(git::ops::add_submodule)
|
||||
.url(make_github_url(task_conf().mo_org(), repo_))
|
||||
.url(task_conf().make_git_url(task_conf().mo_org(), repo_))
|
||||
.branch(task_conf().mo_branch())
|
||||
.submodule_name(name())
|
||||
.root(super_path())));
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ void ncc::do_fetch()
|
||||
instrument<times::fetch>([&]
|
||||
{
|
||||
run_tool(task_conf().make_git()
|
||||
.url(make_github_url(task_conf().mo_org(), "modorganizer-NCC"))
|
||||
.url(task_conf().make_git_url(task_conf().mo_org(), "modorganizer-NCC"))
|
||||
.branch(task_conf().mo_branch())
|
||||
.root(source_path()));
|
||||
});
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ void nmm::do_fetch()
|
||||
instrument<times::fetch>([&]
|
||||
{
|
||||
run_tool(task_conf().make_git()
|
||||
.url(make_github_url("Nexus-Mods", "Nexus-Mod-Manager"))
|
||||
.url(task_conf().make_git_url("Nexus-Mods", "Nexus-Mod-Manager"))
|
||||
.branch(version())
|
||||
.root(source_path()));
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ void python::fetch_from_source()
|
||||
instrument<times::fetch>([&]
|
||||
{
|
||||
run_tool(task_conf().make_git()
|
||||
.url(make_github_url("python", "cpython"))
|
||||
.url(task_conf().make_git_url("python", "cpython"))
|
||||
.branch(version())
|
||||
.root(source_path()));
|
||||
});
|
||||
|
||||
@@ -29,7 +29,7 @@ void spdlog::do_fetch()
|
||||
instrument<times::fetch>([&]
|
||||
{
|
||||
run_tool(task_conf().make_git()
|
||||
.url(make_github_url("gabime", "spdlog"))
|
||||
.url(task_conf().make_git_url("gabime", "spdlog"))
|
||||
.branch(version())
|
||||
.root(source_path()));
|
||||
});
|
||||
|
||||
@@ -230,6 +230,11 @@ bool task_conf_holder::ignore_ts()const
|
||||
return conf::bool_option_by_name(task_.names(), "ignore_ts");
|
||||
}
|
||||
|
||||
std::string task_conf_holder::git_url_prefix() const
|
||||
{
|
||||
return conf::option_by_name(task_.names(), "git_url_prefix");
|
||||
}
|
||||
|
||||
bool task_conf_holder::git_shallow() const
|
||||
{
|
||||
return conf::bool_option_by_name(task_.names(), "git_shallow");
|
||||
@@ -298,6 +303,12 @@ git task_conf_holder::make_git(git::ops o) const
|
||||
return g;
|
||||
}
|
||||
|
||||
std::string task_conf_holder::make_git_url(
|
||||
const std::string& org, const std::string& repo) const
|
||||
{
|
||||
return git_url_prefix() + org + "/" + repo + ".git";
|
||||
}
|
||||
|
||||
|
||||
std::array<std::string, 7> time_names()
|
||||
{
|
||||
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
bool no_pull() const;
|
||||
bool revert_ts() const;
|
||||
bool ignore_ts()const;
|
||||
std::string git_url_prefix() const;
|
||||
bool git_shallow() const;
|
||||
std::string git_user() const;
|
||||
std::string git_email() const;
|
||||
@@ -50,6 +51,9 @@ public:
|
||||
|
||||
git make_git(git::ops o=git::ops::none) const;
|
||||
|
||||
std::string make_git_url(
|
||||
const std::string& org, const std::string& repo) const;
|
||||
|
||||
private:
|
||||
const task& task_;
|
||||
};
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ void usvfs::fetch_from_source()
|
||||
instrument<times::fetch>([&]
|
||||
{
|
||||
run_tool(task_conf().make_git()
|
||||
.url(make_github_url(task_conf().mo_org(), "usvfs"))
|
||||
.url(task_conf().make_git_url(task_conf().mo_org(), "usvfs"))
|
||||
.branch(version())
|
||||
.root(source_path()));
|
||||
});
|
||||
|
||||
@@ -286,11 +286,6 @@ void mob_assertion_failed(
|
||||
DebugBreak();
|
||||
}
|
||||
|
||||
url make_github_url(const std::string& org, const std::string& repo)
|
||||
{
|
||||
return "https://github.com/" + org + "/" + repo + ".git";
|
||||
}
|
||||
|
||||
url make_prebuilt_url(const std::string& filename)
|
||||
{
|
||||
return
|
||||
|
||||
@@ -290,7 +290,6 @@ enum class arch
|
||||
};
|
||||
|
||||
|
||||
url make_github_url(const std::string& org, const std::string& repo);
|
||||
url make_prebuilt_url(const std::string& filename);
|
||||
url make_appveyor_artifact_url(
|
||||
arch a, const std::string& project, const std::string& filename);
|
||||
|
||||
Reference in New Issue
Block a user