diff --git a/firmware/config/boards/subaru_eg33/config/gen_config.sh b/firmware/config/boards/subaru_eg33/config/gen_config.sh index a29b63100b..cd5557487d 100755 --- a/firmware/config/boards/subaru_eg33/config/gen_config.sh +++ b/firmware/config/boards/subaru_eg33/config/gen_config.sh @@ -18,7 +18,7 @@ source gen_config_common.sh echo "Using COMMON_GEN_CONFIG [$COMMON_GEN_CONFIG]" java \ - -DSystemOut.name=gen_config_subaru_eg33 \ + -DSystemOut.name=logs/gen_config_subaru_eg33 \ $COMMON_GEN_CONFIG \ -cache ${SHORT_BOARDNAME} \ -tool ${BOARD_DIR}/config/gen_config.sh \ diff --git a/firmware/config/boards/subaru_eg33/config/gen_enum_to_string.sh b/firmware/config/boards/subaru_eg33/config/gen_enum_to_string.sh index 7f0b21f443..9b9d20bc52 100755 --- a/firmware/config/boards/subaru_eg33/config/gen_enum_to_string.sh +++ b/firmware/config/boards/subaru_eg33/config/gen_enum_to_string.sh @@ -7,7 +7,7 @@ echo This batch files reads rusefi_enums.h and produces auto_generated_enums.* f BOARD=subaru_eg33 -java -DSystemOut.name=gen_enum_to_string \ +java -DSystemOut.name=logs/gen_enum_to_string \ -jar ../java_tools/enum2string.jar \ -inputPath . \ -outputPath config/boards/${BOARD}/config/controllers/algo \ diff --git a/firmware/gen_config_board.sh b/firmware/gen_config_board.sh index 9e1f03372e..c0215d6be0 100755 --- a/firmware/gen_config_board.sh +++ b/firmware/gen_config_board.sh @@ -46,7 +46,7 @@ source gen_config_common.sh echo "Using COMMON_GEN_CONFIG [$COMMON_GEN_CONFIG]" # work in progress: migrating to rusefi_${BUNDLE_NAME}.txt -java -DSystemOut.name=gen_config_board \ +java -DSystemOut.name=logs/gen_config_board \ $COMMON_GEN_CONFIG \ -romraider integration \ -tool gen_config.sh \ diff --git a/firmware/gen_enum_to_string.sh b/firmware/gen_enum_to_string.sh index efd0c926e2..2828a4a013 100755 --- a/firmware/gen_enum_to_string.sh +++ b/firmware/gen_enum_to_string.sh @@ -4,14 +4,14 @@ echo "This batch files reads rusefi_enums.h and produces auto_generated_enums.* rm gen_enum_to_string.log -java -DSystemOut.name=gen_java_enum -cp ../java_tools/enum2string.jar com.rusefi.ToJavaEnum -enumInputFile controllers/algo/live_data_ids.h -outputPath ../java_console/io/src/main/java/com/rusefi/enums +java -DSystemOut.name=logs/gen_java_enum -cp ../java_tools/enum2string.jar com.rusefi.ToJavaEnum -enumInputFile controllers/algo/live_data_ids.h -outputPath ../java_console/io/src/main/java/com/rusefi/enums [ $? -eq 0 ] || { echo "ERROR generating live data ids"; exit 1; } -java -DSystemOut.name=gen_java_enum -cp ../java_tools/enum2string.jar com.rusefi.ToJavaEnum -enumInputFile controllers/sensors/sensor_type.h -outputPath ../java_console/io/src/main/java/com/rusefi/enums +java -DSystemOut.name=logs/gen_java_enum -cp ../java_tools/enum2string.jar com.rusefi.ToJavaEnum -enumInputFile controllers/sensors/sensor_type.h -outputPath ../java_console/io/src/main/java/com/rusefi/enums [ $? -eq 0 ] || { echo "ERROR generating sensors"; exit 1; } -java -DSystemOut.name=gen_enum_to_string \ +java -DSystemOut.name=logs/gen_enum_to_string \ -jar ../java_tools/enum2string.jar \ -outputPath controllers/algo \ -generatedFile codes \ @@ -19,7 +19,7 @@ java -DSystemOut.name=gen_enum_to_string \ [ $? -eq 0 ] || { echo "ERROR generating obd_error_codes"; exit 1; } -java -DSystemOut.name=gen_enum_to_string \ +java -DSystemOut.name=logs/gen_enum_to_string \ -jar ../java_tools/enum2string.jar \ -outputPath controllers/algo \ -generatedFile commonenum \ @@ -29,14 +29,14 @@ java -DSystemOut.name=gen_enum_to_string \ # TODO: rearrange enums so that we have WAY less duplicated generated code? at the moment too many enums are generated 4 times -java -DSystemOut.name=gen_enum_to_string \ +java -DSystemOut.name=logs/gen_enum_to_string \ -jar ../java_tools/enum2string.jar \ -outputPath controllers/algo \ -enumInputFile controllers/algo/rusefi_hw_enums.h \ [ $? -eq 0 ] || { echo "ERROR generating hw_enums"; exit 1; } -java -DSystemOut.name=gen_enum_to_string \ +java -DSystemOut.name=logs/gen_enum_to_string \ -jar ../java_tools/enum2string.jar \ -outputPath controllers/sensors \ -generatedFile sensor \ diff --git a/firmware/gen_live_documentation.sh b/firmware/gen_live_documentation.sh index b367fe1c1d..49b8a4ae67 100755 --- a/firmware/gen_live_documentation.sh +++ b/firmware/gen_live_documentation.sh @@ -23,7 +23,7 @@ bash gen_live_documentation_one_file.sh wall_fuel_state WallFuelState.java contr bash gen_live_documentation_one_file.sh idle_state IdleState.java controllers/actuators [ $? -eq 0 ] || { echo "ERROR generating"; exit 1; } -java -DSystemOut.name=gen_live_documentation \ +java -DSystemOut.name=logs/gen_live_documentation \ -cp ../java_tools/ConfigDefinition.jar \ com.rusefi.ldmp.UsagesReader integration/LiveData.yaml [ $? -eq 0 ] || { echo "ERROR generating"; exit 1; } diff --git a/firmware/gen_live_documentation_one_file.sh b/firmware/gen_live_documentation_one_file.sh index 911053be0e..0d27e35385 100644 --- a/firmware/gen_live_documentation_one_file.sh +++ b/firmware/gen_live_documentation_one_file.sh @@ -14,7 +14,7 @@ meta_file_name=${meta_name}.txt header_file="${meta_name}_generated.h" -java -DSystemOut.name=gen_live_documentation \ +java -DSystemOut.name=logs/gen_live_documentation \ -jar ../java_tools/ConfigDefinition.jar \ -definition $folder/$meta_file_name \ -cache_zip_file tunerstudio/generated/cache.zip \ diff --git a/java_console/logging/src/main/java/com/rusefi/util/SystemOut.java b/java_console/logging/src/main/java/com/rusefi/util/SystemOut.java index c1a264f570..fdd80e70ac 100644 --- a/java_console/logging/src/main/java/com/rusefi/util/SystemOut.java +++ b/java_console/logging/src/main/java/com/rusefi/util/SystemOut.java @@ -1,5 +1,6 @@ package com.rusefi.util; +import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; @@ -27,6 +28,9 @@ public class SystemOut { return; String fileName = System.getProperty("SystemOut.name", "rusefi_tool") + LOG; System.out.println("Opening " + fileName); + File parentFile = new File(fileName).getParentFile(); + if (parentFile != null) + parentFile.mkdirs(); logFile = new PrintWriter(new FileWriter(fileName, true)); Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { @Override diff --git a/java_tools/ConfigDefinition.jar b/java_tools/ConfigDefinition.jar index b65bc49bb5..47e758add2 100644 Binary files a/java_tools/ConfigDefinition.jar and b/java_tools/ConfigDefinition.jar differ diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/test/BitParsingTest.java b/java_tools/configuration_definition/src/main/java/com/rusefi/test/BitParsingTest.java index b4881f1c39..66c01b72c5 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/test/BitParsingTest.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/test/BitParsingTest.java @@ -8,6 +8,7 @@ import org.junit.Test; import java.io.*; import java.util.Arrays; +import java.util.Collections; import static org.junit.Assert.assertTrue; @@ -30,7 +31,7 @@ public class BitParsingTest { writeContent(fieldsSection, new TsFileContent("", ""), createOutput(sw)); } }; - state.readBufferedReader(reader, Arrays.asList(javaFieldsConsumer)); + state.readBufferedReader(reader, Collections.singletonList(javaFieldsConsumer)); System.out.printf("start[" + sw + "]end");