bazel: incompatible_disallow_legacy_javainfo: Remove legacy (deprecated) JavaInfo constructors

This is a tracking issue for offering a migration solution for --incompatible_disallow_legacy_javainfo

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 28 (28 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks very much for the snippet of code. It seems to work well. I will patch the library rule. Thanks again!

On Mon, Aug 5, 2019 at 10:40 AM Irina Iancu notifications@github.com wrote:

@brown https://github.com/brown The flag needs to be flipped in Bazel 1.0. I put together some snippets to help you migrate your use case and still be able to exclude some jars. Please let me know how I can help further.

after computing runtime_jars and compile_time_jars

transitive_compile_providers = [JavaInfo( output_jar = compile_time_jar, compile_jar = compile_time_jar, neverlink = True, ) for compile_time_jar in compile_time_jars]

transitive_runtime_providers = [JavaInfo( output_jar = runtime_jar, compile_jar = runtime_jar, ) for runtime_jar in runtime_jars]

compile_providers = [JavaInfo( output_jar = compile_jar, compile_jar = compile_jar, neverlink = True, ) for compile_jar in provider.compile_jars]

runtime_providers = [JavaInfo( output_jar = runtime_jar, compile_jar = runtime_jar, deps = transitive_runtime_providers, ) for runtime_jar in provider.runtime_output_jars]

new_providers.append(java_common.merge(compile_providers + runtime_providers)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bazelbuild/bazel/issues/5821?email_source=notifications&email_token=AAAGVMO5U7QV5EVP3IR3V5TQDA3VJA5CNFSM4FOTCLX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3SA3BY#issuecomment-518262151, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAGVMOUKW3FOVV4ZLVKETTQDA3VJANCNFSM4FOTCLXQ .