Skip to content

Commit

Permalink
Add a utility method to create a legacy Label instance from the new one.
Browse files Browse the repository at this point in the history
(cherry picked from commit 0ed5cbf)
  • Loading branch information
Googler authored and mai93 committed Jul 31, 2023
1 parent 3ab98fa commit 6a5c3d8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions base/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ java_library(
"//intellij_platform_sdk:jsr305",
"//intellij_platform_sdk:plugin_api",
"//proto:proto_deps",
"//shared",
"//third_party/auto_value",
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public static Label create(String label) {
return ProjectDataInterner.intern(new Label(label));
}

public static Label create(com.google.idea.blaze.common.Label label) {
return create(label.toString());
}

public static Label create(WorkspacePath packageName, TargetName newTargetName) {
return create(null, packageName, newTargetName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public ImmutableList<Label> getTargetsToBuildForSourceFile(File file) {
// implementing expects all such targets.
com.google.idea.blaze.common.Label targetOwner = snapshot.getTargetOwner(rel);
if (targetOwner != null) {
buildTargets.add(Label.create(targetOwner.toString()));
buildTargets.add(Label.create(targetOwner));
} else {
logger.warn(String.format("No target owner found for file %s", rel));
}
Expand Down

0 comments on commit 6a5c3d8

Please sign in to comment.