Added back anchor

This commit is contained in:
nathan 2017-07-29 11:51:58 +02:00
parent d437e60f7f
commit dfc83774f5
2 changed files with 26 additions and 1 deletions

View File

@ -96,6 +96,7 @@ class BuildVersion {
private IncrementingVersion original;
private IncrementingVersion current;
private IncrementingVersion anchored;
private File readme;
private List<File> sourceFiles = new ArrayList<File>();
@ -496,4 +497,20 @@ class BuildVersion {
String toString() {
return this.current.toString();
}
/**
* Anchored means that
* - anchored = original
* - original = copy of current, so reading files, etc, work AFTER the version was changed, but are not modified any further
*/
public
void anchor() {
this.anchored = this.original;
this.original = new IncrementingVersion(this.current);
}
public
Version getAnchored() {
return this.anchored;
}
}

View File

@ -37,7 +37,15 @@ class OutputFile {
if (version != null) {
// is the ORIG version part of the filename?
// TWO situations, it can be anchored OR normal
final String original = version.getOriginal().toString();
final String original;
if (version.getAnchored() != null) {
original = version.getAnchored()
.toString();
}
else {
original = version.getOriginal()
.toString();
}
if (cleanedName.endsWith(original)) {
// have to replace ORIG with current