From c9c8417aedcc75b99e584c3f0fd7ad9722994ba9 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Sat, 25 Nov 2023 11:29:24 -0500 Subject: [PATCH] only: refactoring: moving stuff to confirm loose coupling --- .../java/com/rusefi/pinout/FileSystemBoardInputsImpl.java | 4 ++-- .../src/main/java/com/rusefi/EnumPair.java | 0 .../src/main/java/com/rusefi/PinType.java | 0 .../src/main/java/com/rusefi/pinout/BoardInputs.java | 0 .../com/rusefi/pinout/FileSystemBoardInputsReaderImpl.java | 6 +++--- .../main/java/com/rusefi/pinout/PinoutLogicConstants.java | 5 +++++ 6 files changed, 10 insertions(+), 5 deletions(-) rename java_tools/{configuration_definition => configuration_definition_base}/src/main/java/com/rusefi/EnumPair.java (100%) rename java_tools/{configuration_definition => configuration_definition_base}/src/main/java/com/rusefi/PinType.java (100%) rename java_tools/{configuration_definition => configuration_definition_base}/src/main/java/com/rusefi/pinout/BoardInputs.java (100%) rename java_tools/{configuration_definition => configuration_definition_base}/src/main/java/com/rusefi/pinout/FileSystemBoardInputsReaderImpl.java (90%) create mode 100644 java_tools/configuration_definition_base/src/main/java/com/rusefi/pinout/PinoutLogicConstants.java diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/pinout/FileSystemBoardInputsImpl.java b/java_tools/configuration_definition/src/main/java/com/rusefi/pinout/FileSystemBoardInputsImpl.java index 7b5abcd3f4..5e9eefc60a 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/pinout/FileSystemBoardInputsImpl.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/pinout/FileSystemBoardInputsImpl.java @@ -11,11 +11,11 @@ public class FileSystemBoardInputsImpl extends FileSystemBoardInputsReaderImpl { @Override public Writer getBoardNamesWriter() throws IOException { - return new FileWriter(boardName + PinoutLogic.CONNECTORS + File.separator + "generated_ts_name_by_pin.cpp"); + return new FileWriter(boardName + PinoutLogicConstants.CONNECTORS + File.separator + "generated_ts_name_by_pin.cpp"); } @Override public Writer getOutputsWriter() throws IOException { - return new FileWriter(boardName + PinoutLogic.CONNECTORS + File.separator + "generated_outputs.h"); + return new FileWriter(boardName + PinoutLogicConstants.CONNECTORS + File.separator + "generated_outputs.h"); } } diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/EnumPair.java b/java_tools/configuration_definition_base/src/main/java/com/rusefi/EnumPair.java similarity index 100% rename from java_tools/configuration_definition/src/main/java/com/rusefi/EnumPair.java rename to java_tools/configuration_definition_base/src/main/java/com/rusefi/EnumPair.java diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/PinType.java b/java_tools/configuration_definition_base/src/main/java/com/rusefi/PinType.java similarity index 100% rename from java_tools/configuration_definition/src/main/java/com/rusefi/PinType.java rename to java_tools/configuration_definition_base/src/main/java/com/rusefi/PinType.java diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/pinout/BoardInputs.java b/java_tools/configuration_definition_base/src/main/java/com/rusefi/pinout/BoardInputs.java similarity index 100% rename from java_tools/configuration_definition/src/main/java/com/rusefi/pinout/BoardInputs.java rename to java_tools/configuration_definition_base/src/main/java/com/rusefi/pinout/BoardInputs.java diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/pinout/FileSystemBoardInputsReaderImpl.java b/java_tools/configuration_definition_base/src/main/java/com/rusefi/pinout/FileSystemBoardInputsReaderImpl.java similarity index 90% rename from java_tools/configuration_definition/src/main/java/com/rusefi/pinout/FileSystemBoardInputsReaderImpl.java rename to java_tools/configuration_definition_base/src/main/java/com/rusefi/pinout/FileSystemBoardInputsReaderImpl.java index 3c7d4f97d8..5f18880ab8 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/pinout/FileSystemBoardInputsReaderImpl.java +++ b/java_tools/configuration_definition_base/src/main/java/com/rusefi/pinout/FileSystemBoardInputsReaderImpl.java @@ -13,14 +13,14 @@ import java.util.List; import static com.devexperts.logging.Logging.getLogging; public abstract class FileSystemBoardInputsReaderImpl implements BoardInputs { - private static final Logging log = getLogging(FileSystemBoardInputsImpl.class); + private static final Logging log = getLogging(FileSystemBoardInputsReaderImpl.class); protected final String boardName; private final List boardYamlFiles; public static String PREFIX = ""; public FileSystemBoardInputsReaderImpl(String boardName) { this.boardName = boardName; - String dirPath = boardName + PinoutLogic.CONNECTORS; + String dirPath = boardName + PinoutLogicConstants.CONNECTORS; File dirName = new File(dirPath); FilenameFilter filter = (f, name) -> name.endsWith(".yaml"); File[] boardYamlFilesArray = dirName.listFiles(filter); @@ -53,7 +53,7 @@ public abstract class FileSystemBoardInputsReaderImpl implements BoardInputs { public List getInputFiles() { List result = new ArrayList<>(); for (File yamlFile : boardYamlFiles) { - result.add(boardName + PinoutLogic.CONNECTORS + File.separator + yamlFile.getName()); + result.add(boardName + PinoutLogicConstants.CONNECTORS + File.separator + yamlFile.getName()); } return result; } diff --git a/java_tools/configuration_definition_base/src/main/java/com/rusefi/pinout/PinoutLogicConstants.java b/java_tools/configuration_definition_base/src/main/java/com/rusefi/pinout/PinoutLogicConstants.java new file mode 100644 index 0000000000..444c8607fb --- /dev/null +++ b/java_tools/configuration_definition_base/src/main/java/com/rusefi/pinout/PinoutLogicConstants.java @@ -0,0 +1,5 @@ +package com.rusefi.pinout; + +public class PinoutLogicConstants { + static final String CONNECTORS = "/connectors"; +}