mirror of
https://github.com/ModOrganizer2/mob.git
synced 2026-07-27 14:07:05 -07:00
83 lines
1.3 KiB
C++
83 lines
1.3 KiB
C++
#include "pch.h"
|
|
#include "tasks.h"
|
|
|
|
namespace mob
|
|
{
|
|
|
|
ncc::ncc()
|
|
: basic_task("ncc")
|
|
{
|
|
}
|
|
|
|
std::string ncc::version()
|
|
{
|
|
return {};
|
|
}
|
|
|
|
bool ncc::prebuilt()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
fs::path ncc::source_path()
|
|
{
|
|
return paths::build() / "NexusClientCli";
|
|
}
|
|
|
|
void ncc::do_clean(clean c)
|
|
{
|
|
instrument<times::clean>([&]
|
|
{
|
|
if (is_set(c, clean::reclone))
|
|
{
|
|
git::delete_directory(cx(), source_path());
|
|
return;
|
|
}
|
|
|
|
if (is_set(c, clean::rebuild))
|
|
run_tool(create_msbuild_tool(msbuild::clean));
|
|
});
|
|
}
|
|
|
|
void ncc::do_fetch()
|
|
{
|
|
instrument<times::fetch>([&]
|
|
{
|
|
run_tool(task_conf().make_git()
|
|
.url(task_conf().make_git_url(task_conf().mo_org(), "modorganizer-NCC"))
|
|
.branch(task_conf().mo_branch())
|
|
.root(source_path()));
|
|
});
|
|
}
|
|
|
|
void ncc::do_build_and_install()
|
|
{
|
|
instrument<times::build>([&]
|
|
{
|
|
run_tool(msbuild()
|
|
.solution(source_path() / "NexusClient.sln")
|
|
.targets({"NexusClientCLI"})
|
|
.platform("Any CPU"));
|
|
});
|
|
|
|
instrument<times::install>([&]
|
|
{
|
|
const auto publish = source_path() / "publish.bat";
|
|
|
|
run_tool(process_runner(process()
|
|
.binary(publish)
|
|
.stderr_level(context::level::trace)
|
|
.arg(paths::install_bin())));
|
|
});
|
|
}
|
|
|
|
msbuild ncc::create_msbuild_tool(msbuild::ops o)
|
|
{
|
|
return std::move(msbuild(o)
|
|
.solution(source_path() / "NexusClient.sln")
|
|
.targets({"NexusClientCLI"})
|
|
.platform("Any CPU"));
|
|
}
|
|
|
|
} // namespace
|