mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:17:36 +00:00
DevTools/HackStudio: Add verify_make_is_installed()
This commit is contained in:
parent
31fc1990fa
commit
00075afb07
2 changed files with 12 additions and 0 deletions
|
@ -40,6 +40,7 @@ ErrorOr<void> ProjectBuilder::build(StringView active_file)
|
|||
}
|
||||
|
||||
if (m_is_serenity == IsSerenityRepo::No) {
|
||||
TRY(verify_make_is_installed());
|
||||
TRY(m_terminal->run_command("make"));
|
||||
return {};
|
||||
}
|
||||
|
@ -65,6 +66,7 @@ ErrorOr<void> ProjectBuilder::run(StringView active_file)
|
|||
}
|
||||
|
||||
if (m_is_serenity == IsSerenityRepo::No) {
|
||||
TRY(verify_make_is_installed());
|
||||
TRY(m_terminal->run_command("make run"));
|
||||
return {};
|
||||
}
|
||||
|
@ -102,6 +104,7 @@ ErrorOr<void> ProjectBuilder::update_active_file(StringView active_file)
|
|||
|
||||
ErrorOr<void> ProjectBuilder::build_serenity_component()
|
||||
{
|
||||
TRY(verify_make_is_installed());
|
||||
TRY(m_terminal->run_command(String::formatted("make {}", m_serenity_component_name), build_directory(), TerminalWrapper::WaitForExit::Yes, "Make failed"sv));
|
||||
return {};
|
||||
}
|
||||
|
@ -255,6 +258,14 @@ ErrorOr<void> ProjectBuilder::verify_cmake_is_installed()
|
|||
return Error::from_string_literal("CMake port is not installed"sv);
|
||||
}
|
||||
|
||||
ErrorOr<void> ProjectBuilder::verify_make_is_installed()
|
||||
{
|
||||
auto res = Core::command("make --version", {});
|
||||
if (!res.is_error() && res.value().exit_code == 0)
|
||||
return {};
|
||||
return Error::from_string_literal("Make port is not installed"sv);
|
||||
}
|
||||
|
||||
String ProjectBuilder::build_directory() const
|
||||
{
|
||||
return LexicalPath::join(m_project_root, "Build"sv).string();
|
||||
|
|
|
@ -47,6 +47,7 @@ private:
|
|||
static void for_each_library_dependencies(Function<void(String, Vector<StringView>)>);
|
||||
static ErrorOr<String> component_name(StringView cmake_file_path);
|
||||
static ErrorOr<void> verify_cmake_is_installed();
|
||||
static ErrorOr<void> verify_make_is_installed();
|
||||
|
||||
String m_project_root;
|
||||
Project const& m_project;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue