Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
Get semantic version out of bazel info release command
Browse files Browse the repository at this point in the history
  • Loading branch information
SocksDevil committed Feb 26, 2021
1 parent 39805f0 commit 98f822b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public BazelData(
this.workspaceRoot = workspaceRoot;
this.binRoot = binRoot;
this.workspaceLabel = workspaceLabel;
this.version = new SemanticVersion(version);
this.version = SemanticVersion.fromReleaseData(version);
}

public String getExecRoot() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ public SemanticVersion(String version) {
this.version = version;
}

static SemanticVersion fromReleaseData(String version) {
return new SemanticVersion(version.split(" ")[1]);
}

@Override
public int compareTo(SemanticVersion other) {
if (other == null) return 1;
Expand Down
1 change: 1 addition & 0 deletions test-resources/sample-repo/dep/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ java_binary(
"-Werror",
"-Xlint:all",
],
main_class= "dep.JavaTest",
visibility = ["//visibility:public"],
)

0 comments on commit 98f822b

Please sign in to comment.