Browse Source

Automatically set Core plugin version to Rack app version.

tags/v2.6.1
Andrew Belt 1 month ago
parent
commit
81a16ade0e
3 changed files with 6 additions and 3 deletions
  1. +0
    -1
      Core.json
  2. +4
    -0
      src/plugin.cpp
  3. +2
    -2
      src/plugin/Plugin.cpp

+ 0
- 1
Core.json View File

@@ -1,7 +1,6 @@
{ {
"slug": "Core", "slug": "Core",
"name": "VCV Core", "name": "VCV Core",
"version": "2.6.0",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"author": "VCV", "author": "VCV",
"brand": "VCV", "brand": "VCV",


+ 4
- 0
src/plugin.cpp View File

@@ -133,7 +133,11 @@ static Plugin* loadPlugin(std::string path) {
INFO("Loading plugin from %s", path.c_str()); INFO("Loading plugin from %s", path.c_str());


Plugin* plugin = new Plugin; Plugin* plugin = new Plugin;

try { try {
if (path == "")
plugin->version = APP_VERSION;

// Set plugin path // Set plugin path
plugin->path = (path == "") ? asset::systemDir : path; plugin->path = (path == "") ? asset::systemDir : path;




+ 2
- 2
src/plugin/Plugin.cpp View File

@@ -48,10 +48,10 @@ void Plugin::fromJson(json_t* rootJ) {
json_t* versionJ = json_object_get(rootJ, "version"); json_t* versionJ = json_object_get(rootJ, "version");
if (versionJ) if (versionJ)
version = json_string_value(versionJ); version = json_string_value(versionJ);
if (!string::startsWith(version, APP_VERSION_MAJOR + "."))
throw Exception("Plugin version %s does not match Rack ABI version %s", version.c_str(), APP_VERSION_MAJOR.c_str());
if (version == "") if (version == "")
throw Exception("No plugin version"); throw Exception("No plugin version");
if (!string::startsWith(version, APP_VERSION_MAJOR + "."))
throw Exception("Plugin version %s does not match Rack ABI version %s", version.c_str(), APP_VERSION_MAJOR.c_str());


// name // name
json_t* nameJ = json_object_get(rootJ, "name"); json_t* nameJ = json_object_get(rootJ, "name");


Loading…
Cancel
Save