mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2025-09-08 17:59:43 +02:00
Expose SOP revision info more fine-grained
This commit is contained in:
parent
90c77706a8
commit
8425665fa7
3 changed files with 96 additions and 4 deletions
|
@ -100,6 +100,42 @@ public class VersionExternal implements Version {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSopSpecVersionNumber() {
|
||||
String revision = getSopSpecVersion();
|
||||
String firstLine;
|
||||
if (revision.contains("\n")) {
|
||||
firstLine = revision.substring(0, revision.indexOf("\n"));
|
||||
} else {
|
||||
firstLine = revision;
|
||||
}
|
||||
|
||||
if (!firstLine.contains("-")) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return Integer.parseInt(firstLine.substring(firstLine.lastIndexOf("-") + 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSopSpecImplementationIncomplete() {
|
||||
String revision = getSopSpecVersion();
|
||||
return revision.startsWith("~");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSopSpecImplementationIncompletenessRemarks() {
|
||||
String revision = getSopSpecVersion();
|
||||
if (revision.contains("\n")) {
|
||||
String tail = revision.substring(revision.indexOf("\n") + 1).trim();
|
||||
|
||||
if (!tail.isEmpty()) {
|
||||
return tail;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSopSpecVersion() {
|
||||
String[] command = new String[] {binary, "version", "--sop-spec"};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue