Skip to content

Commit

Permalink
Updated version to 1.7.5-SNAPSHOT.
Browse files Browse the repository at this point in the history
WIP fix for new Gradle maven-metadata.xml layout.
  • Loading branch information
gbevin committed Oct 19, 2023
1 parent 1a243ef commit 85f2c8f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 13 additions & 10 deletions src/main/java/rife/bld/dependencies/Xml2MavenMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class Xml2MavenMetadata extends Xml2Data implements MavenMetadata {

private StringBuilder characterData_ = null;

private boolean isSnapshot_ = false;
private String snapshotTimestamp_ = null;
private Integer snapshotBuildNumber_ = null;

Expand Down Expand Up @@ -67,16 +68,7 @@ public void endElement(String uri, String localName, String qName) {
case "version" -> versions_.add(VersionNumber.parse(characterData_.toString()));
case "timestamp" -> snapshotTimestamp_ = characterData_.toString();
case "buildNumber" -> snapshotBuildNumber_ = Integer.parseInt(characterData_.toString());
case "snapshot" -> {
if (!versions_.isEmpty()) {
var version = versions_.get(0);
var qualifier = VersionNumber.SNAPSHOT_QUALIFIER;
if (snapshotTimestamp_ != null && snapshotBuildNumber_ != null) {
qualifier = snapshotTimestamp_ + "-" + snapshotBuildNumber_;
}
snapshot_ = new VersionNumber(version.major(), version.minor(), version.revision(), qualifier);
}
}
case "snapshot" -> isSnapshot_ = true;
}

characterData_ = null;
Expand All @@ -88,6 +80,17 @@ public void endElement(String uri, String localName, String qName) {

public void endDocument()
throws SAXException {
if (isSnapshot_) {
if (!versions_.isEmpty()) {
var version = versions_.get(0);
var qualifier = VersionNumber.SNAPSHOT_QUALIFIER;
if (snapshotTimestamp_ != null && snapshotBuildNumber_ != null) {
qualifier = snapshotTimestamp_ + "-" + snapshotBuildNumber_;
}
snapshot_ = new VersionNumber(version.major(), version.minor(), version.revision(), qualifier);
}
}

// determine latest stable version by removing pre-release qualifiers
var filtered_versions = new TreeSet<>(versions_.stream()
.filter(v -> {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/BLD_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.7.4
1.7.5-SNAPSHOT

0 comments on commit 85f2c8f

Please sign in to comment.