Skip to content

Commit

Permalink
feat: test feat version calculate
Browse files Browse the repository at this point in the history
  • Loading branch information
sukidayou committed Dec 16, 2024
1 parent 3bf2828 commit 9d20ce1
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/main/java/org/casbin/util/VersionUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,43 +90,31 @@ public static String getCliVersion() throws IOException {
String commitMessage = properties.getProperty("git.commit.message.full", "Unknown");
Pattern pattern = Pattern.compile("^(fix|feat|chore|docs|style|refactor|test|perf|build|ci):");
Matcher matcher = pattern.matcher(commitMessage);
System.out.println("commitId: " + commitId);
System.out.println("tag: " + tag);
System.out.println("commitCount: " + commitCount);
System.out.println("commitMessage: " + commitMessage);
if(tag.isEmpty() || tag.equals("Unknown")) {
String tags = properties.getProperty("git.tags", "Unknown");
System.out.println("tags: " + tags);
tag = tags;
if(tags.isEmpty() || tags.equals("Unknown")) {
System.out.println("tags if in");
InputStream versionInputStream = Client.class.getResourceAsStream("/META-INF/lastCli.version");
if (versionInputStream != null) {
BufferedReader reader = new BufferedReader(new InputStreamReader(versionInputStream, StandardCharsets.UTF_8));
String version = "";
String line;
if ((line = reader.readLine()) != null) {
version = line;
System.out.println("version: " + version);
if (matcher.find()) {
System.out.println("matcher.find()");
tag = calculateNewVersion(version, matcher.group(1));
}
}
}
}
}else {
if(!commitCount.isEmpty() && !commitCount.equals("0") && !commitCount.equals("Unknown")) {
System.out.println("commitCount if in");
if (matcher.find()) {
System.out.println("matcher.find()");
tag = calculateNewVersion(tag, matcher.group(1));
commitCount = "0";
}
}
}
System.out.println("after tag: " + tag);
System.out.println("commitCount: " + commitCount);
if ((commitCount.isEmpty() || commitCount.equals("0") || commitCount.equals("Unknown")) && (!tag.isEmpty() && !tag.equals("Unknown"))) {
return tag;
}
Expand Down

0 comments on commit 9d20ce1

Please sign in to comment.