Release: use independent component repositories
This commit is contained in:
1 parent
2fba7d2dea
commit
8f7ae36e0f
5 files changed
+47
-7
No files matched your search
+7
-2
@@ -4,7 +4,10 @@
|
||||
# and implements IPluginInterface with the reusable VoidTeamspeak client.
|
||||
|
||||
cmake_minimum_required(VERSION 4.0.0)
|
||||
project(EchoionStandalone VERSION 1.0.7 LANGUAGES CXX)
|
||||
if(NOT DEFINED ECHOION_PRODUCT_VERSION)
|
||||
set(ECHOION_PRODUCT_VERSION 0.0.0)
|
||||
endif()
|
||||
project(EchoionStandalone VERSION "${ECHOION_PRODUCT_VERSION}" LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 26)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
@@ -105,7 +108,7 @@ set_target_properties(EchoionStandalone PROPERTIES
|
||||
|
||||
install(TARGETS EchoionStandalone RUNTIME DESTINATION bin)
|
||||
|
||||
if(BUILD_TESTS)
|
||||
if(BUILD_TESTS AND TARGET EchoionCore)
|
||||
add_executable(echoion_core_loader_reload_tests
|
||||
tests/test_core_loader_reload.cpp)
|
||||
target_link_libraries(echoion_core_loader_reload_tests PRIVATE
|
||||
@@ -116,7 +119,9 @@ if(BUILD_TESTS)
|
||||
add_dependencies(echoion_core_loader_reload_tests EchoionCore)
|
||||
add_test(NAME echoion_core_loader_reload_tests
|
||||
COMMAND echoion_core_loader_reload_tests)
|
||||
endif()
|
||||
|
||||
if(BUILD_TESTS)
|
||||
add_executable(echoion_standalone_message_tests
|
||||
tests/test_message_chunker.cpp
|
||||
src/MessageChunker.cpp
|
||||
|
||||
@@ -97,4 +97,14 @@ namespace Echoion::Standalone
|
||||
class Impl;
|
||||
std::unique_ptr<Impl> impl_;
|
||||
};
|
||||
|
||||
using UpdateControlHandler = std::function<Api::Result<std::string>(
|
||||
const std::string&, const std::string&)>;
|
||||
|
||||
// Keep the service alive for the complete duration of an in-flight host
|
||||
// control request. StandaloneClientInterface intentionally invokes a copied
|
||||
// handler outside its mutex, so clearing the registered handler cannot
|
||||
// cancel a callback which has already started.
|
||||
[[nodiscard]] UpdateControlHandler
|
||||
bindUpdateService(std::shared_ptr<UpdateService> service);
|
||||
} // namespace Echoion::Standalone
|
||||
@@ -3162,6 +3162,15 @@ namespace Echoion::Standalone
|
||||
return impl_->handle(method, requestJson);
|
||||
}
|
||||
|
||||
UpdateControlHandler bindUpdateService(std::shared_ptr<UpdateService> service)
|
||||
{
|
||||
return [service = std::move(service)](
|
||||
const std::string& method,
|
||||
const std::string& requestJson) {
|
||||
return service->handle(method, requestJson);
|
||||
};
|
||||
}
|
||||
|
||||
Api::Result<ManagedCoreStartupSelection>
|
||||
selectManagedCoreForStartup(const std::filesystem::path& stateDirectory,
|
||||
const std::filesystem::path& bundledCore,
|
||||
|
||||
+2
-5
@@ -720,7 +720,7 @@ int main(int argc, char** argv)
|
||||
|
||||
const auto updaterExecutable =
|
||||
runningExecutable->parent_path() / "echoion-updater";
|
||||
auto updateService = std::make_unique<Echoion::Standalone::UpdateService>(
|
||||
auto updateService = std::make_shared<Echoion::Standalone::UpdateService>(
|
||||
Echoion::Standalone::UpdateService::Options{
|
||||
.configPath = cfgPath,
|
||||
.stateDirectory = stateDirectory,
|
||||
@@ -784,10 +784,7 @@ int main(int argc, char** argv)
|
||||
updateService.reset();
|
||||
} else {
|
||||
interface->setHostControlHandler(
|
||||
[service = updateService.get()](const std::string& method,
|
||||
const std::string& request) {
|
||||
return service->handle(method, request);
|
||||
});
|
||||
Echoion::Standalone::bindUpdateService(updateService));
|
||||
}
|
||||
|
||||
core->triggerAutoConnect();
|
||||
|
||||
@@ -250,6 +250,25 @@ int main()
|
||||
};
|
||||
|
||||
TemporaryTree tree;
|
||||
{
|
||||
auto ownedService =
|
||||
std::make_shared<Echoion::Standalone::UpdateService>(
|
||||
Echoion::Standalone::UpdateService::Options{},
|
||||
Echoion::Standalone::UpdateService::Hooks{});
|
||||
std::weak_ptr<Echoion::Standalone::UpdateService> observedService =
|
||||
ownedService;
|
||||
auto handler =
|
||||
Echoion::Standalone::bindUpdateService(ownedService);
|
||||
ownedService.reset();
|
||||
check(!observedService.expired(),
|
||||
"host control handler did not retain UpdateService");
|
||||
check(handler("updates.getStatus", "{}").has_value(),
|
||||
"retained UpdateService handler could not serve status");
|
||||
handler = {};
|
||||
check(observedService.expired(),
|
||||
"cleared host control handler retained UpdateService");
|
||||
}
|
||||
|
||||
const auto startupState = tree.path() / "startup-state";
|
||||
const auto bundledStartupCore =
|
||||
tree.path() / "startup-runtime" / "lib" / "Echoion.ts";
|
||||
|
||||
Reference in new issue
Block a user