From 75944f35a596a3fc75f89bafed9ca9f0c1f16102 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Wed, 30 Nov 2016 22:32:48 +0100 Subject: [PATCH] Bazel: Fix eclipse classpath generation I2b065a8ec exposed sources in GWT UI plugin API. Given that classpath generation tool chain depends on GWT UI plugin API, the transitive closure was now included in the Eclipse classpath. But we don't want to include the source JARs, because the source directories themself already included. Reported-By: Hector Oswaldo Caballero Change-Id: Iaef7eecba48f08f327dce6af258d45408850d859 --- tools/eclipse/project_bzl.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/eclipse/project_bzl.py b/tools/eclipse/project_bzl.py index 6bc7398c24..a7ddf6f7ab 100755 --- a/tools/eclipse/project_bzl.py +++ b/tools/eclipse/project_bzl.py @@ -170,10 +170,6 @@ def gen_classpath(ext): m = java_library.match(p) if m: gwt_src.add(m.group(1)) - # Exception: we need source here for GWT SDM mode to work - if p.endswith('libEdit.jar'): - p = p[:-4] + '-src.jar' - lib.add(p) for s in sorted(src): out = None @@ -213,10 +209,18 @@ def gen_classpath(ext): p = path.join(prefix, "jar", "%s-src.jar" % suffix) if path.exists(p): s = p - # TODO(davido): make plugins actually work if args.plugins: classpathentry('lib', j, s, exported=True) else: + # Filter out the source JARs that we pull through transitive closure of + # GWT plugin API (we add source directories themself). Exception is + # libEdit-src.jar, that is needed for GWT SDM to work. + m = java_library.match(j) + if m: + if m.group(1).startswith("gerrit-") and \ + j.endswith("-src.jar") and \ + not j.endswith("libEdit-src.jar"): + continue classpathentry('lib', j, s) for s in sorted(gwt_src):