Export stable C ABI and add component releases
This commit is contained in:
5 files changed
+137
-22
No files matched your search
+68
-17
@@ -1,5 +1,6 @@
|
||||
#include <echoion/api/module/Module.hpp>
|
||||
#include <echoion/api/module/LegacyModuleAbi.hpp>
|
||||
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
|
||||
@@ -10,6 +11,7 @@ namespace Echoion::CoreModule
|
||||
class LifecycleModule final : public Void::Plugin::IModule
|
||||
{
|
||||
public:
|
||||
|
||||
[[nodiscard]] std::string_view name() const noexcept override
|
||||
{
|
||||
return "EchoionCore";
|
||||
@@ -26,36 +28,85 @@ namespace Echoion::CoreModule
|
||||
{
|
||||
static const Void::Plugin::ModuleDescriptor descriptor{
|
||||
.module_id = "EchoionCore",
|
||||
.component_version = {
|
||||
.major = ECHOION_COMPONENT_VERSION_MAJOR,
|
||||
.minor = ECHOION_COMPONENT_VERSION_MINOR,
|
||||
.patch = ECHOION_COMPONENT_VERSION_PATCH,
|
||||
.pre_release = {},
|
||||
.build = {},
|
||||
},
|
||||
.abi_hash =
|
||||
"sha256:b421d9e3dc304c5bc31c8fd2d2fc52f62f9055aa90eef8d072c9c99e3b461a20",
|
||||
.component_version =
|
||||
{
|
||||
.major = ECHOION_COMPONENT_VERSION_MAJOR,
|
||||
.minor = ECHOION_COMPONENT_VERSION_MINOR,
|
||||
.patch = ECHOION_COMPONENT_VERSION_PATCH,
|
||||
.pre_release = {},
|
||||
.build = {},
|
||||
},
|
||||
.abi_hash = "sha256:"
|
||||
"9cb668e2a502dcfe02d145ed63635d63619732d77ff57496858343"
|
||||
"82705e8d21",
|
||||
.abi_contract = Void::Json::object({
|
||||
{"schemaVersion", 1},
|
||||
{"contractId", "echoion.module.core"},
|
||||
{"descriptor", "Void::Plugin::ModuleDescriptor"},
|
||||
{"descriptor", "echoion_module_descriptor_v1"},
|
||||
}),
|
||||
.dependencies = {
|
||||
.dependencies =
|
||||
{
|
||||
.module_id = "EchoionApi",
|
||||
.version_range = "^2.0.0",
|
||||
.abi_hash = "sha256:336492a52097dd12f222bb6d9acab19e8eb6a502eab45bb78127bce6d733fbd3",
|
||||
{
|
||||
.module_id = "EchoionApi",
|
||||
.version_range = "^2.0.0",
|
||||
.abi_hash = "sha256:"
|
||||
"d50293d345a97e52f9844088bdd42277f566bc815a"
|
||||
"21b7636d3e053f06c6c113",
|
||||
},
|
||||
},
|
||||
},
|
||||
.activation_policy = Void::Plugin::ActivationPolicy::Reloadable,
|
||||
.create = createCoreModule,
|
||||
};
|
||||
return descriptor;
|
||||
}
|
||||
|
||||
const echoion_module_descriptor_v1& coreModuleAbiDescriptor()
|
||||
{
|
||||
using Bridge = Api::Module::LegacyModuleAbi<createCoreModule>;
|
||||
static const echoion_module_dependency_v1 dependencies[]{
|
||||
{
|
||||
.struct_size = sizeof(echoion_module_dependency_v1),
|
||||
.component_id = Api::Module::Detail::stringView("EchoionApi"),
|
||||
.version_range =
|
||||
Api::Module::Detail::stringView(">=2.0.0 <3.0.0"),
|
||||
.abi_hash = Api::Module::Detail::stringView(
|
||||
"sha256:"
|
||||
"d50293d345a97e52f9844088bdd42277f566bc815a21b7636d3e053f06"
|
||||
"c6c113"),
|
||||
.optional = 0,
|
||||
.reserved_bytes = {},
|
||||
},
|
||||
};
|
||||
static const echoion_module_descriptor_v1 descriptor{
|
||||
.struct_size = sizeof(echoion_module_descriptor_v1),
|
||||
.abi_version = ECHOION_MODULE_ABI_VERSION,
|
||||
.component_id = Api::Module::Detail::stringView("EchoionCore"),
|
||||
.version_major = ECHOION_COMPONENT_VERSION_MAJOR,
|
||||
.version_minor = ECHOION_COMPONENT_VERSION_MINOR,
|
||||
.version_patch = ECHOION_COMPONENT_VERSION_PATCH,
|
||||
.version_prerelease = {},
|
||||
.abi_hash = Api::Module::Detail::stringView(
|
||||
"sha256:"
|
||||
"9cb668e2a502dcfe02d145ed63635d63619732d77ff5749685834382705e8d"
|
||||
"21"),
|
||||
.dependencies = dependencies,
|
||||
.dependency_count = std::size(dependencies),
|
||||
.activation_policy = ECHOION_ACTIVATION_RELOADABLE_V1,
|
||||
.api = &Bridge::api,
|
||||
.reserved = {},
|
||||
};
|
||||
return descriptor;
|
||||
}
|
||||
} // namespace Echoion::CoreModule
|
||||
|
||||
extern "C" ECHOION_MODULE_EXPORT const Void::Plugin::ModuleDescriptor*
|
||||
echoion_module_query()
|
||||
echoion_module_query()
|
||||
{
|
||||
return &Echoion::CoreModule::coreModuleDescriptor();
|
||||
}
|
||||
|
||||
extern "C" ECHOION_MODULE_ABI_EXPORT const echoion_module_descriptor_v1*
|
||||
echoion_module_abi_query()
|
||||
{
|
||||
return &Echoion::CoreModule::coreModuleAbiDescriptor();
|
||||
}
|
||||
Reference in new issue
Block a user