Adding stuff into livedata.yaml needs _two_ rounds of config generation #4514
This commit is contained in:
parent
7dcc85a597
commit
6e405c9e0c
|
@ -4,8 +4,9 @@ echo "This batch files reads rusefi_enums.h and produces auto_generated_enums.*
|
|||
|
||||
rm gen_enum_to_string.log
|
||||
|
||||
java -DSystemOut.name=logs/gen_java_enum -cp ../java_tools/enum2string.jar com.rusefi.ToJavaEnum -enumInputFile console/binary/generated/live_data_ids.h -outputPath ../java_console/io/src/main/java/com/rusefi/enums
|
||||
[ $? -eq 0 ] || { echo "ERROR generating live data ids"; exit 1; }
|
||||
# todo: remove me soon, UsageReader generates java by itself now!
|
||||
#java -DSystemOut.name=logs/gen_java_enum -cp ../java_tools/enum2string.jar com.rusefi.ToJavaEnum -enumInputFile console/binary/generated/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=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; }
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.rusefi.ldmp;
|
||||
|
||||
import com.devexperts.logging.Logging;
|
||||
import com.rusefi.EnumToString;
|
||||
import com.rusefi.InvokeReader;
|
||||
import com.rusefi.ReaderState;
|
||||
import com.rusefi.output.*;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
|
@ -10,6 +12,7 @@ import java.io.FileReader;
|
|||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -174,12 +177,17 @@ public class UsagesReader {
|
|||
}
|
||||
|
||||
private void writeFiles() throws IOException {
|
||||
try (FileWriter fw = new FileWriter("console/binary/generated/live_data_ids.h")) {
|
||||
String liveDataIdsHeader = "console/binary/generated/live_data_ids.h";
|
||||
try (FileWriter fw = new FileWriter(liveDataIdsHeader)) {
|
||||
fw.write(enumContent.toString());
|
||||
}
|
||||
|
||||
try (FileWriter fw = new FileWriter("console/binary/generated/live_data_fragments.h")) {
|
||||
fw.write(fragmentsContent.toString());
|
||||
}
|
||||
|
||||
String outputPath = "../java_console/io/src/main/java/com/rusefi/enums";
|
||||
InvokeReader request = new InvokeReader(outputPath, Collections.singletonList(liveDataIdsHeader));
|
||||
EnumToString.handleRequest(request);
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue