Skip to content

Commit 213ac8f

Browse files
committed
Respond to review comments
1 parent 1a12ad4 commit 213ac8f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ bzl_library(
2626
"//private/lib:implementation",
2727
"//private/rules:implementation",
2828
"//settings:implementation",
29+
"@bazel_skylib//lib:paths",
2930
"@rules_java//java:rules",
3031
],
3132
)

private/rules/coursier.bzl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313

14+
load("@bazel_skylib//lib:paths.bzl", "paths")
1415
load("//:specs.bzl", "utils")
1516
load("//private:artifact_utilities.bzl", "deduplicate_and_sort_artifacts")
1617
load(
@@ -945,9 +946,10 @@ def rewrite_files_attribute_if_necessary(repository_ctx, dep_tree):
945946
amended_deps.append(dep)
946947
continue
947948

948-
jar_path = dep["file"].removesuffix(".pom") + ".jar"
949-
if repository_ctx.path(jar_path).exists:
950-
dep["file"] = jar_path
949+
if dep["file"].endswith(".pom"):
950+
jar_path = paths.replace_extension(dep["file"], "jar")
951+
if repository_ctx.path(jar_path).exists:
952+
dep["file"] = jar_path
951953

952954
amended_deps.append(dep)
953955

0 commit comments

Comments
 (0)