only: refactoring: moving stuff to confirm loose coupling
This commit is contained in:
parent
36e714bab7
commit
c9c8417aed
|
@ -11,11 +11,11 @@ public class FileSystemBoardInputsImpl extends FileSystemBoardInputsReaderImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Writer getBoardNamesWriter() throws IOException {
|
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
|
@Override
|
||||||
public Writer getOutputsWriter() throws IOException {
|
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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,14 +13,14 @@ import java.util.List;
|
||||||
import static com.devexperts.logging.Logging.getLogging;
|
import static com.devexperts.logging.Logging.getLogging;
|
||||||
|
|
||||||
public abstract class FileSystemBoardInputsReaderImpl implements BoardInputs {
|
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;
|
protected final String boardName;
|
||||||
private final List<File> boardYamlFiles;
|
private final List<File> boardYamlFiles;
|
||||||
public static String PREFIX = "";
|
public static String PREFIX = "";
|
||||||
|
|
||||||
public FileSystemBoardInputsReaderImpl(String boardName) {
|
public FileSystemBoardInputsReaderImpl(String boardName) {
|
||||||
this.boardName = boardName;
|
this.boardName = boardName;
|
||||||
String dirPath = boardName + PinoutLogic.CONNECTORS;
|
String dirPath = boardName + PinoutLogicConstants.CONNECTORS;
|
||||||
File dirName = new File(dirPath);
|
File dirName = new File(dirPath);
|
||||||
FilenameFilter filter = (f, name) -> name.endsWith(".yaml");
|
FilenameFilter filter = (f, name) -> name.endsWith(".yaml");
|
||||||
File[] boardYamlFilesArray = dirName.listFiles(filter);
|
File[] boardYamlFilesArray = dirName.listFiles(filter);
|
||||||
|
@ -53,7 +53,7 @@ public abstract class FileSystemBoardInputsReaderImpl implements BoardInputs {
|
||||||
public List<String> getInputFiles() {
|
public List<String> getInputFiles() {
|
||||||
List<String> result = new ArrayList<>();
|
List<String> result = new ArrayList<>();
|
||||||
for (File yamlFile : boardYamlFiles) {
|
for (File yamlFile : boardYamlFiles) {
|
||||||
result.add(boardName + PinoutLogic.CONNECTORS + File.separator + yamlFile.getName());
|
result.add(boardName + PinoutLogicConstants.CONNECTORS + File.separator + yamlFile.getName());
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
package com.rusefi.pinout;
|
||||||
|
|
||||||
|
public class PinoutLogicConstants {
|
||||||
|
static final String CONNECTORS = "/connectors";
|
||||||
|
}
|
Loading…
Reference in New Issue