Skip to content

When processing #@script, register module with ModuleService #331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.scijava.Priority;
import org.scijava.log.LogService;
import org.scijava.module.ModuleInfo;
import org.scijava.module.ModuleService;
import org.scijava.plugin.Parameter;
import org.scijava.plugin.Plugin;

Expand Down Expand Up @@ -95,7 +96,7 @@
*
* @author Curtis Rueden
*/
@Plugin(type = ScriptProcessor.class)
@Plugin(type = ScriptProcessor.class, priority=Priority.HIGH)
public class ScriptDirectiveScriptProcessor extends DirectiveScriptProcessor {

public ScriptDirectiveScriptProcessor() {
Expand All @@ -104,6 +105,9 @@ public ScriptDirectiveScriptProcessor() {

@Parameter
private LogService log;

@Parameter
private ModuleService moduleService;

// -- Internal DirectiveScriptProcessor methods --

Expand All @@ -114,6 +118,7 @@ protected String process(final String directive,
for (final String k : attrs.keySet()) {
assignAttribute(k == null ? "name" : k, attrs.get(k));
}
moduleService.addModule(info()); // TODO how to handle duplicate names?
return "";
}

Expand Down