making variable names just a bit less specific
This commit is contained in:
parent
8af5ae0152
commit
35ec353c15
|
@ -175,8 +175,8 @@ public class ConfigDefinition {
|
||||||
|
|
||||||
ParseState parseState = new ParseState(state.enumsReader);
|
ParseState parseState = new ParseState(state.enumsReader);
|
||||||
// Add the variable for the config signature
|
// Add the variable for the config signature
|
||||||
long crc32 = IoUtil2.getCrc32(state.inputFiles);
|
long uniqueId = IoUtil2.getCrc32(state.inputFiles);
|
||||||
IoUtil2.signatureHash(state, parseState, tsInputFileFolder, crc32);
|
SignatureConsumer.storeUniqueBuildId(state, parseState, tsInputFileFolder, uniqueId);
|
||||||
|
|
||||||
ExtraUtil.handleFiringOrder(firingEnumFileName, state.variableRegistry, parseState);
|
ExtraUtil.handleFiringOrder(firingEnumFileName, state.variableRegistry, parseState);
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ public class ConfigDefinition {
|
||||||
|
|
||||||
VariableRegistry tmpRegistry = new VariableRegistry();
|
VariableRegistry tmpRegistry = new VariableRegistry();
|
||||||
// store the CRC32 as a built-in variable
|
// store the CRC32 as a built-in variable
|
||||||
tmpRegistry.register(SIGNATURE_HASH, "" + crc32);
|
tmpRegistry.register(SIGNATURE_HASH, "" + uniqueId);
|
||||||
tmpRegistry.readPrependValues(signaturePrependFile);
|
tmpRegistry.readPrependValues(signaturePrependFile);
|
||||||
state.destinations.add(new SignatureConsumer(signatureDestination, tmpRegistry));
|
state.destinations.add(new SignatureConsumer(signatureDestination, tmpRegistry));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package com.rusefi;
|
package com.rusefi;
|
||||||
|
|
||||||
import com.rusefi.newparse.ParseState;
|
|
||||||
import com.rusefi.newparse.parsing.Definition;
|
|
||||||
import com.rusefi.util.SystemOut;
|
import com.rusefi.util.SystemOut;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
|
@ -59,13 +57,4 @@ public class IoUtil2 {
|
||||||
return crc32;
|
return crc32;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void signatureHash(ReaderState state, ParseState parseState, String tsPath, long crc32) {
|
|
||||||
// store the CRC32 as a built-in variable
|
|
||||||
|
|
||||||
// nasty trick - do not insert signature into live data files
|
|
||||||
if (tsPath != null) {
|
|
||||||
parseState.addDefinition(state.variableRegistry,
|
|
||||||
ConfigDefinition.SIGNATURE_HASH, Long.toString(crc32), Definition.OverwritePolicy.NotAllowed);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package com.rusefi.output;
|
package com.rusefi.output;
|
||||||
|
|
||||||
import com.rusefi.*;
|
import com.rusefi.*;
|
||||||
|
import com.rusefi.newparse.ParseState;
|
||||||
|
import com.rusefi.newparse.parsing.Definition;
|
||||||
import com.rusefi.util.SystemOut;
|
import com.rusefi.util.SystemOut;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -18,6 +20,16 @@ public class SignatureConsumer implements ConfigurationConsumer {
|
||||||
this.registry = registry;
|
this.registry = registry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void storeUniqueBuildId(ReaderState state, ParseState parseState, String tsPath, long uniqueId) {
|
||||||
|
// store a hash as a built-in variable
|
||||||
|
|
||||||
|
// nasty trick - do not insert signature into live data files
|
||||||
|
if (tsPath != null) {
|
||||||
|
parseState.addDefinition(state.variableRegistry,
|
||||||
|
ConfigDefinition.SIGNATURE_HASH, Long.toString(uniqueId), Definition.OverwritePolicy.NotAllowed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleEndStruct(ReaderState readerState, ConfigStructure structure) throws IOException {
|
public void handleEndStruct(ReaderState readerState, ConfigStructure structure) throws IOException {
|
||||||
ExtraUtil.writeDefinesToFile(registry, destHeader, "by SignatureConsumer");
|
ExtraUtil.writeDefinesToFile(registry, destHeader, "by SignatureConsumer");
|
||||||
|
|
Loading…
Reference in New Issue