diff --git a/tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/cli/CodeGeneratorCommand.java b/tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/cli/CodeGeneratorCommand.java index e051077b..e27a2d73 100644 --- a/tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/cli/CodeGeneratorCommand.java +++ b/tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/cli/CodeGeneratorCommand.java @@ -1,5 +1,6 @@ package com.thecoderscorner.menu.editorui.cli; +import com.thecoderscorner.embedcontrol.core.service.DatabaseAppDataStore; import com.thecoderscorner.embedcontrol.core.service.TcMenuFormPersistence; import com.thecoderscorner.embedcontrol.core.util.DataException; import com.thecoderscorner.menu.domain.state.MenuTree; @@ -96,7 +97,7 @@ public Integer call() { if(verbose) System.out.format("Gen: %s: %s\n", level, s); }); var enabledFormObjects = project.getOptions().getListOfEmbeddedForms().stream() - .map(form -> getFirstByNameAndUuid(project, form)).toList(); + .map(form -> getFirstByNameAndUuid(appContext.getEcDataStore(), project, form)).toList(); codeGen.startConversion(location, plugins, project.getMenuTree(), Collections.emptyList(), project.getOptions(), getLocaleHandler(location), enabledFormObjects); @@ -111,10 +112,11 @@ public Integer call() { } } - private TcMenuFormPersistence getFirstByNameAndUuid(MenuTreeWithCodeOptions project, String formName) { + private TcMenuFormPersistence getFirstByNameAndUuid(DatabaseAppDataStore dataStore, MenuTreeWithCodeOptions project, + String formName) { var uuid = project.getOptions().getApplicationUUID().toString(); try { - return MenuEditorApp.getContext().getAppContext().getEcDataStore().getUtilities() + return dataStore.getUtilities() .queryRecords(TcMenuFormPersistence.class, "FORM_UUID=? and FORM_NAME=?", uuid, formName) .stream().findFirst().orElseThrow(); } catch (DataException e) { diff --git a/tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/generator/plugin/DefaultXmlPluginLoader.java b/tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/generator/plugin/DefaultXmlPluginLoader.java index 7118a55a..cd8d0206 100644 --- a/tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/generator/plugin/DefaultXmlPluginLoader.java +++ b/tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/generator/plugin/DefaultXmlPluginLoader.java @@ -108,11 +108,11 @@ public void reload() { } private Path findPluginDir() { - if("Y".equals(System.getProperty("devlog"))) { + if(System.getProperty("override.core.plugin.dir") != null) { + return Path.of(System.getProperty("override.core.plugin.dir")); + } else if("Y".equals(System.getProperty("devlog"))) { // Developer mode assume home directory is the tcMenuGenerator directory. return Path.of(System.getProperty("user.dir")).getParent().resolve("xmlPlugins"); - } else if(System.getProperty("override.core.plugin.dir") != null) { - return Path.of(System.getProperty("override.core.plugin.dir")); } else { // packaged mode, plugins are stored within the application itself, in the ../app directory. int tries = 0;