рефакторинг. вынес в обобщенную часть бд, но еще не все

This commit is contained in:
2024-10-08 01:30:25 +03:00
parent d0c08a2c7e
commit 18ceb04325
91 changed files with 442 additions and 456 deletions

View File

@@ -1,7 +1,6 @@
package GlobalData.Makefile;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common.Utils.TextLog;
import Common_old.Utils.Utils;
import GlobalData.Compiler.Compiler;
@@ -26,10 +25,10 @@ public class Makefile extends ModuleAnchestor {
return Current.HasMachine() && (machine_id == Current.getMachine().id);
}
public LinkedHashMap<LanguageName, Module> getActiveModules() {
return Global.db.getByFKAndGroupBy(this, Module.class, "language", LanguageName.class).values().stream().filter(Module::isSelected).collect(Collectors.toMap(module -> module.language, module -> module, (a, b) -> b, LinkedHashMap::new));
return CommonUtils.db.getByFKAndGroupBy(this, Module.class, "language", LanguageName.class).values().stream().filter(Module::isSelected).collect(Collectors.toMap(module -> module.language, module -> module, (a, b) -> b, LinkedHashMap::new));
}
public LinkedHashMap<LanguageName, Module> getModules() {
return Global.db.getByFKAndGroupBy(this, Module.class, "language", LanguageName.class);
return CommonUtils.db.getByFKAndGroupBy(this, Module.class, "language", LanguageName.class);
}
public String Generate(db_project_info project, boolean useFilesOrder, LinkedHashMap<LanguageName, Module> modules) throws Exception {
Compiler linker = getCompiler();
@@ -160,7 +159,7 @@ public class Makefile extends ModuleAnchestor {
//todo возможно улучшить
//https://habr.com/ru/post/211751/
public Machine getMachine() {
return Global.db.getById(Machine.class, machine_id);
return CommonUtils.db.getById(Machine.class, machine_id);
}
public boolean DependsToCompiler(Compiler compiler) {
if (compiler_id == compiler.id) return true;