bazeltools / bazel-deps

Generate bazel dependencies for maven artifacts
MIT License
250 stars 121 forks source link

Handle paths for labels correctly #186

Closed jhnj closed 6 years ago

jhnj commented 6 years ago

In bazel the target @some_label is resolved as @some_label//:some_label.

When specifying replacements using this format, e.g.:

replacements:
  org.scala-lang.modules:
    scala-parser-combinators:
      lang: scala
      target:
        "@io_bazel_rules_scala_scala_parser_combinators"

the exports in the created BUILD file looks like @io_bazel_rules_scala_scala_parser_combinators//. This is not the same as @io_bazel_rules_scala_scala_parser_combinators and thus doesn't work.

This makes a target @some_label resolve to @some_label instead of @some_label// by:

Didn't find any direct tests for Label, should I add something / add a test somewhere else?

@johnynek

johnynek commented 6 years ago

sorry I lost track @jhnj

This is great.

travisbrown commented 6 years ago

Thanks for doing this, @jhnj!