Hi,
i would like to add a new function to the sdk, this means increasing the sdk version.
I have found some problems i would like to discuss.
I think we should (and i think we are using) use semantic versioning scheme:
https://semver.org/According to my understanding we have "shiftet" the scheme by one and are not using the "patch" number.:
PLUGIN_SDK_VERSION_MINOR -> patch version (internal changes, probably behaviour changes)
PLUGIN_SDK_VERSION_MAJOR -> minor version (adding functions)
PLUGIN_SDK_VERSION_RELEASE -> major version (removing functions, non backwards compatible interface changes)
So adding new features should be covered by incrementing the PLUGIN_SDK_VERSION_MAJOR. This should allow all plugins to still be usable without recompiling.
Our current implementation does not allow me to change any version number and still use old compiled plugins.
The check is performed in pluginmanager.cpp:700
if (major != PLUGIN_SDK_VERSION_MAJOR ||
minor != PLUGIN_SDK_VERSION_MINOR ||
release != PLUGIN_SDK_VERSION_RELEASE)
{
// wrong version: in this case, inform the user...
wxString fmt;
fmt.Printf(_("SDK version mismatch for %s (%d.%d.%d). Expecting %d.%d.%d"),
name.c_str(),
major,
minor,
release,
PLUGIN_SDK_VERSION_MAJOR,
PLUGIN_SDK_VERSION_MINOR,
PLUGIN_SDK_VERSION_RELEASE);
Manager::Get()->GetLogManager()->LogError(fmt);
return;
}
I think this is wrong and the PLUGIN_SDK_VERSION_MINOR and PLUGIN_SDK_VERSION_MAJOR check should be a ">" check. So if we add functions old plugins should still be working without problems.
Removing functions or changing the interface of functions should result in increase of the major version. Here we can perform an = check because no backwards compatibility
any comments?