Skip to content

Commit 2c4e7c2

Browse files
committed
Add support for plugins rather than executables
1 parent 8e0a64c commit 2c4e7c2

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

Framework/Core/include/Framework/DataProcessorInfo.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ struct DataProcessorInfo {
2525
/// Name of the associated DataProcessorSpec
2626
std::string name = "Unknown";
2727
/// The executable name of the program which holds the DataProcessorSpec
28-
std::string executable = "/bin/false";
28+
std::string executable = "";
29+
/// The plugin spec of the plugin which holds the DataProcessorSpec
30+
std::string plugin = "";
2931
/// The argument passed on the command line for this DataProcessorSpec
3032
std::vector<std::string> cmdLineArgs = {};
3133
/// The workflow options which are available for the associated DataProcessorSpec

Framework/Core/src/WorkflowSerializationHelpers.cxx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ struct WorkflowImporter : public rapidjson::BaseReaderHandler<rapidjson::UTF8<>,
9191
IN_DATAPROCESSOR_INFO,
9292
IN_DATAPROCESSOR_INFO_NAME,
9393
IN_DATAPROCESSOR_INFO_EXECUTABLE,
94+
IN_DATAPROCESSOR_INFO_PLUGIN,
9495
IN_DATAPROCESSOR_INFO_ARGS,
9596
IN_DATAPROCESSOR_INFO_ARG,
9697
IN_DATAPROCESSOR_INFO_CHANNELS,
@@ -263,6 +264,9 @@ struct WorkflowImporter : public rapidjson::BaseReaderHandler<rapidjson::UTF8<>,
263264
case State::IN_DATAPROCESSOR_INFO_EXECUTABLE:
264265
s << "IN_DATAPROCESSOR_INFO_EXECUTABLE";
265266
break;
267+
case State::IN_DATAPROCESSOR_INFO_PLUGIN:
268+
s << "IN_DATAPROCESSOR_INFO_PLUGIN";
269+
break;
266270
case State::IN_DATAPROCESSOR_INFO_ARGS:
267271
s << "IN_DATAPROCESSOR_INFO_ARGS";
268272
break;
@@ -706,6 +710,8 @@ struct WorkflowImporter : public rapidjson::BaseReaderHandler<rapidjson::UTF8<>,
706710
push(State::IN_DATAPROCESSOR_INFO_NAME);
707711
} else if (in(State::IN_DATAPROCESSOR_INFO) && strncmp(str, "executable", length) == 0) {
708712
push(State::IN_DATAPROCESSOR_INFO_EXECUTABLE);
713+
} else if (in(State::IN_DATAPROCESSOR_INFO) && strncmp(str, "plugin", length) == 0) {
714+
push(State::IN_DATAPROCESSOR_INFO_PLUGIN);
709715
} else if (in(State::IN_DATAPROCESSOR_INFO) && strncmp(str, "cmdLineArgs", length) == 0) {
710716
push(State::IN_DATAPROCESSOR_INFO_ARGS);
711717
} else if (in(State::IN_DATAPROCESSOR_INFO) && strncmp(str, "workflowOptions", length) == 0) {
@@ -732,6 +738,9 @@ struct WorkflowImporter : public rapidjson::BaseReaderHandler<rapidjson::UTF8<>,
732738
} else if (in(State::IN_DATAPROCESSOR_INFO_EXECUTABLE)) {
733739
assert(metadata.size());
734740
metadata.back().executable = s;
741+
} else if (in(State::IN_DATAPROCESSOR_INFO_PLUGIN)) {
742+
assert(metadata.size());
743+
metadata.back().plugin = s;
735744
} else if (in(State::IN_INPUT_BINDING)) {
736745
binding = s;
737746
} else if (in(State::IN_INPUT_ORIGIN)) {
@@ -1254,8 +1263,14 @@ void WorkflowSerializationHelpers::dump(std::ostream& out,
12541263
w.StartObject();
12551264
w.Key("name");
12561265
w.String(info.name.c_str());
1257-
w.Key("executable");
1258-
w.String(info.executable.c_str());
1266+
if (!info.executable.empty()) {
1267+
w.Key("executable");
1268+
w.String(info.executable.c_str());
1269+
}
1270+
if (!info.plugin.empty()) {
1271+
w.Key("plugin");
1272+
w.String(info.plugin.c_str());
1273+
}
12591274
w.Key("cmdLineArgs");
12601275
w.StartArray();
12611276
for (auto& arg : info.cmdLineArgs) {

0 commit comments

Comments
 (0)