From 06f7aaa85c95d560dba4951800c695ffe4de69a6 Mon Sep 17 00:00:00 2001 From: Irina Iancu Date: Mon, 26 Aug 2019 13:20:07 +0200 Subject: [PATCH] Migrate from old-style legacy .java provider to the new JavaInfo. This is a rollforward of https://gerrit-review.googlesource.com/c/gerrit/+/234154 with a bug fix. I checked the bug is now fixed by building :gerrit at head, with the faulty (rolledback) change and with the current change. I compared the war files contents: the ones built at head and with this change are the same, the ones built at head and with the rolledback change differ a lot. Change-Id: I1d5afb8b022b33f110ed1006fcfcd6fc7aa97d71 --- tools/bzl/pkg_war.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/bzl/pkg_war.bzl b/tools/bzl/pkg_war.bzl index 72ed9f878f..64970faf34 100644 --- a/tools/bzl/pkg_war.bzl +++ b/tools/bzl/pkg_war.bzl @@ -77,8 +77,8 @@ def _war_impl(ctx): # Add lib transitive_libs = [] for j in ctx.attr.libs: - if hasattr(j, "java"): - transitive_libs.append(j.java.transitive_runtime_deps) + if JavaInfo in j: + transitive_libs.append(j[JavaInfo].transitive_runtime_deps) elif hasattr(j, "files"): transitive_libs.append(j.files) @@ -90,7 +90,7 @@ def _war_impl(ctx): # Add pgm lib transitive_pgmlibs = [] for j in ctx.attr.pgmlibs: - transitive_pgmlibs.append(j.java.transitive_runtime_deps) + transitive_pgmlibs.append(j[JavaInfo].transitive_runtime_deps) transitive_pgmlib_deps = depset(transitive = transitive_pgmlibs) for dep in transitive_pgmlib_deps.to_list():