Add serial version
This commit is contained in:
parent
9d7264891c
commit
cb24914793
@ -68,6 +68,7 @@ public class SourcesGenerator {
|
|||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(SourcesGenerator.class);
|
private static final Logger logger = LoggerFactory.getLogger(SourcesGenerator.class);
|
||||||
private static final boolean OVERRIDE_ALL_NULLABLE_METHODS = false;
|
private static final boolean OVERRIDE_ALL_NULLABLE_METHODS = false;
|
||||||
|
private static final String SERIAL_VERSION = "1";
|
||||||
|
|
||||||
private final DataModel dataModel;
|
private final DataModel dataModel;
|
||||||
|
|
||||||
@ -113,18 +114,20 @@ public class SourcesGenerator {
|
|||||||
var curHash = dataModel.computeHash();
|
var curHash = dataModel.computeHash();
|
||||||
if (Files.isRegularFile(hashPath) && Files.isReadable(hashPath)) {
|
if (Files.isRegularFile(hashPath) && Files.isReadable(hashPath)) {
|
||||||
var lines = Files.readAllLines(hashPath, StandardCharsets.UTF_8);
|
var lines = Files.readAllLines(hashPath, StandardCharsets.UTF_8);
|
||||||
if (lines.size() >= 5) {
|
if (lines.size() >= 6) {
|
||||||
var prevBasePackageName = lines.get(0);
|
var prevBasePackageName = lines.get(0);
|
||||||
var prevRecordBuilders = lines.get(1);
|
var prevRecordBuilders = lines.get(1);
|
||||||
var prevHash = lines.get(2);
|
var prevHash = lines.get(2);
|
||||||
var prevDeepCheckBeforeCreatingNewEqualInstances = lines.get(3);
|
var prevDeepCheckBeforeCreatingNewEqualInstances = lines.get(3);
|
||||||
var prevGenerateOldSerializers = lines.get(4);
|
var prevGenerateOldSerializers = lines.get(4);
|
||||||
|
var prevSerialVersion = lines.get(5);
|
||||||
|
|
||||||
if (!force
|
if (!force
|
||||||
&& prevBasePackageName.equals(basePackageName)
|
&& prevBasePackageName.equals(basePackageName)
|
||||||
&& (prevRecordBuilders.equalsIgnoreCase("true") == useRecordBuilders)
|
&& (prevRecordBuilders.equalsIgnoreCase("true") == useRecordBuilders)
|
||||||
&& (prevDeepCheckBeforeCreatingNewEqualInstances.equalsIgnoreCase("true") == deepCheckBeforeCreatingNewEqualInstances)
|
&& (prevDeepCheckBeforeCreatingNewEqualInstances.equalsIgnoreCase("true") == deepCheckBeforeCreatingNewEqualInstances)
|
||||||
&& (prevGenerateOldSerializers.equalsIgnoreCase("true") == generateOldSerializers)
|
&& (prevGenerateOldSerializers.equalsIgnoreCase("true") == generateOldSerializers)
|
||||||
|
&& (prevSerialVersion.equals(SERIAL_VERSION))
|
||||||
&& prevHash.equals(Integer.toString(curHash))) {
|
&& prevHash.equals(Integer.toString(curHash))) {
|
||||||
logger.info("Skipped sources generation because it didn't change");
|
logger.info("Skipped sources generation because it didn't change");
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user