moved tasks to tasks namespace

added python tool
This commit is contained in:
isanae
2020-12-03 17:44:52 -05:00
parent faaeacedb1
commit 2f4cd56276
37 changed files with 139 additions and 81 deletions
+2 -1
View File
@@ -54,7 +54,8 @@ clipp::group cmake_command::do_group()
int cmake_command::do_run()
{
auto t = modorganizer::create_cmake_tool(fs::path(utf8_to_utf16(path_)));
auto t = tasks::modorganizer::create_cmake_tool(
fs::path(utf8_to_utf16(path_)));
t.generator(gen_);
t.cmd(cmd_);
+7 -3
View File
@@ -2,11 +2,15 @@
#include "../utility/enum.h"
namespace mob::tasks
{
class modorganizer;
}
namespace mob
{
class task;
class modorganizer;
class url;
// base class for all commands
@@ -258,10 +262,10 @@ private:
std::string pr_;
std::string github_token_;
std::pair<const modorganizer*, std::string> parse_pr(
std::pair<const tasks::modorganizer*, std::string> parse_pr(
const std::string& pr) const;
pr_info get_pr_info(const modorganizer* task, const std::string& pr);
pr_info get_pr_info(const tasks::modorganizer* task, const std::string& pr);
std::vector<pr_command::pr_info> get_matching_prs(
const std::string& repo_pr);
+5 -5
View File
@@ -255,15 +255,15 @@ std::vector<fs::path> git_command::get_repos() const
std::vector<fs::path> v;
// usvfs
if (fs::exists(usvfs::source_path()))
v.push_back(usvfs::source_path());
if (fs::exists(tasks::usvfs::source_path()))
v.push_back(tasks::usvfs::source_path());
// ncc
if (fs::exists(ncc::source_path()))
v.push_back(ncc::source_path());
if (fs::exists(tasks::ncc::source_path()))
v.push_back(tasks::ncc::source_path());
const auto super = modorganizer::super_path();
const auto super = tasks::modorganizer::super_path();
// all directories in super except for those starting with a dot
if (fs::exists(super))
+13 -12
View File
@@ -79,7 +79,7 @@ int pr_command::do_run()
return 1;
}
std::pair<const modorganizer*, std::string> pr_command::parse_pr(
std::pair<const tasks::modorganizer*, std::string> pr_command::parse_pr(
const std::string& pr) const
{
if (pr.empty())
@@ -99,7 +99,7 @@ std::pair<const modorganizer*, std::string> pr_command::parse_pr(
if (!task)
return {};
const auto* mo_task = dynamic_cast<const modorganizer*>(task);
const auto* mo_task = dynamic_cast<const tasks::modorganizer*>(task);
if (!mo_task)
{
u8cerr << "only modorganizer tasks are supported\n";
@@ -123,7 +123,7 @@ int pr_command::pull()
{
for (auto&& pr : okay_prs)
{
const auto* task = dynamic_cast<const modorganizer*>(
const auto* task = dynamic_cast<const tasks::modorganizer*>(
find_one_task(pr.repo));
if (!task)
@@ -136,7 +136,7 @@ int pr_command::pull()
git::fetch(
task->this_source_path(),
task->git_url().string(),
::fmt::format("pull/{}/head", pr.number));
fmt::format("pull/{}/head", pr.number));
git::checkout(task->this_source_path(), "FETCH_HEAD");
}
@@ -171,7 +171,7 @@ int pr_command::revert()
{
for (auto&& pr : okay_prs)
{
const auto* task = dynamic_cast<const modorganizer*>(
const auto* task = dynamic_cast<const tasks::modorganizer*>(
find_one_task(pr.repo));
if (!task)
@@ -229,11 +229,11 @@ std::vector<pr_command::pr_info> pr_command::search_prs(
"https://api.github.com/search/issues?per_page=100&q="
"is:pr+org:{org:}+author:{author:}+is:open+head:{branch:}";
const auto search_url = ::fmt::format(
const auto search_url = fmt::format(
pattern,
::fmt::arg("org", org),
::fmt::arg("author", author),
::fmt::arg("branch", branch));
fmt::arg("org", org),
fmt::arg("author", author),
fmt::arg("branch", branch));
u8cout << "search url is " << search_url << "\n";
@@ -292,7 +292,7 @@ std::vector<pr_command::pr_info> pr_command::search_prs(
}
pr_command::pr_info pr_command::get_pr_info(
const modorganizer* task, const std::string& pr)
const tasks::modorganizer* task, const std::string& pr)
{
nlohmann::json json;
@@ -302,7 +302,7 @@ pr_command::pr_info pr_command::get_pr_info(
return {};
}
const url u(::fmt::format(
const url u(fmt::format(
"https://api.github.com/repos/{}/{}/pulls/{}",
task->org(), task->repo(), pr));
@@ -359,7 +359,8 @@ std::vector<pr_command::pr_info> pr_command::validate_prs(
}
else
{
const auto* mo_task = dynamic_cast<const modorganizer*>(tasks[0]);
const auto* mo_task =
dynamic_cast<const tasks::modorganizer*>(tasks[0]);
if (!mo_task)
{
+10 -7
View File
@@ -68,15 +68,15 @@ void release_command::make_src()
std::vector<fs::path> files;
std::size_t total_size = 0;
if (!fs::exists(modorganizer::super_path()))
if (!fs::exists(tasks::modorganizer::super_path()))
{
gcx().bail_out(context::generic,
"modorganizer super path not found: {}",
modorganizer::super_path());
tasks::modorganizer::super_path());
}
// build list list
walk_dir(modorganizer::super_path(), files, ignore_re, total_size);
walk_dir(tasks::modorganizer::super_path(), files, ignore_re, total_size);
// should be below 20MB
const std::size_t max_expected_size = 20 * 1024 * 1024;
@@ -95,7 +95,7 @@ void release_command::make_src()
}
op::archive_from_files(gcx(),
files, modorganizer::super_path(), out);
files, tasks::modorganizer::super_path(), out);
}
void release_command::make_installer()
@@ -328,7 +328,7 @@ void release_command::check_repos_for_branch()
tp.add([this, t, &failed]
{
const auto* o = dynamic_cast<const modorganizer*>(t);
const auto* o = dynamic_cast<const tasks::modorganizer*>(t);
if (!git::branch_exists(o->git_url(), branch_))
{
@@ -381,7 +381,10 @@ void release_command::prepare()
if (rc_path_.empty())
{
rc_path_ =
modorganizer::super_path() / "modorganizer" / "src" / "version.rc";
tasks::modorganizer::super_path()
/ "modorganizer"
/ "src"
/ "version.rc";
}
// getting version from rc or exe
@@ -484,7 +487,7 @@ std::string release_command::version_from_exe() const
// using the first language in the list to get FileVersion
const auto* lcp = static_cast<LANGANDCODEPAGE*>(value_pointer);
const auto sub_block = ::fmt::format(
const auto sub_block = fmt::format(
L"\\StringFileInfo\\{:04x}{:04x}\\FileVersion",
lcp->wLanguage, lcp->wCodePage);
+1 -1
View File
@@ -182,7 +182,7 @@ void tx_command::do_build()
if (fs::exists(root / ".tx") && fs::exists(root / "translations"))
root = root / "translations";
translations::projects ps(root);
tasks::translations::projects ps(root);
fs::path dest = dest_;
op::create_directories(gcx(), dest, op::unsafe);
+1 -1
View File
@@ -1051,7 +1051,7 @@ fs::path find_iscc()
for (int v : {5, 6, 7, 8})
{
const fs::path inno = ::fmt::format("inno setup {}", v);
const fs::path inno = fmt::format("inno setup {}", v);
for (fs::path pf : {paths::pf_x86(), paths::pf_x64()})
{
+1 -1
View File
@@ -200,7 +200,7 @@ private:
try
{
const std::string utf8 = ::fmt::format(
const std::string utf8 = fmt::format(
f,
details::converter<std::decay_t<Args>>::convert(
std::forward<Args>(args))...);
+3 -1
View File
@@ -13,6 +13,8 @@ namespace mob
void add_tasks()
{
using namespace tasks;
// add new tasks here
//
// top level tasks are run sequentially, tasks added to a parallel_tasks will
@@ -41,7 +43,7 @@ void add_tasks()
.add_task<nmm>();
add_task<parallel_tasks>(false)
.add_task<python>()
.add_task<tasks::python>()
.add_task<boost>()
.add_task<boost_di>()
.add_task<lz4>()
+1 -1
View File
@@ -2,7 +2,7 @@
#include "tasks.h"
#include "../core/process.h"
namespace mob
namespace mob::tasks
{
boost::boost()
+1 -1
View File
@@ -1,7 +1,7 @@
#include "pch.h"
#include "tasks.h"
namespace mob
namespace mob::tasks
{
boost_di::boost_di()
+1 -1
View File
@@ -1,7 +1,7 @@
#include "pch.h"
#include "tasks.h"
namespace mob
namespace mob::tasks
{
bzip2::bzip2()
+1 -1
View File
@@ -1,7 +1,7 @@
#include "pch.h"
#include "tasks.h"
namespace mob
namespace mob::tasks
{
explorerpp::explorerpp()
+1 -1
View File
@@ -1,7 +1,7 @@
#include "pch.h"
#include "tasks.h"
namespace mob
namespace mob::tasks
{
fmt::fmt()
+1 -1
View File
@@ -1,7 +1,7 @@
#include "pch.h"
#include "tasks.h"
namespace mob
namespace mob::tasks
{
gtest::gtest()
+1 -1
View File
@@ -1,7 +1,7 @@
#include "pch.h"
#include "tasks.h"
namespace mob
namespace mob::tasks
{
installer::installer()
+1 -1
View File
@@ -1,7 +1,7 @@
#include "pch.h"
#include "tasks.h"
namespace mob
namespace mob::tasks
{
libbsarch::libbsarch()
+1 -1
View File
@@ -1,7 +1,7 @@
#include "pch.h"
#include "tasks.h"
namespace mob
namespace mob::tasks
{
libffi::libffi()
+1 -1
View File
@@ -1,7 +1,7 @@
#include "pch.h"
#include "tasks.h"
namespace mob
namespace mob::tasks
{
libloot::libloot()
+1 -1
View File
@@ -1,7 +1,7 @@
#include "pch.h"
#include "tasks.h"
namespace mob
namespace mob::tasks
{
licenses::licenses()

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