From 1634d5ab5b21af33e250e1312085d174a9c8049d Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Mon, 3 Dec 2018 05:37:14 +0100 Subject: [PATCH] Bazel: Include eclipse-out directory in .bazelignore Since [1] Bazel added support for .bazelignore, allowing to specify directories that should be ignored. We still preserve the exclusion of BUILD files in generated .classpath file to avoid Eclipse warnings in the form: The resource is a duplicate of java/BUILD \ and was not copied to the output folder [1] https://github.com/bazelbuild/bazel/issues/4888 Change-Id: I8dfd9b5701dfcc85fd51f626af448d0306b02857 --- .bazelignore | 1 + tools/eclipse/project.py | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 .bazelignore diff --git a/.bazelignore b/.bazelignore new file mode 100644 index 0000000000..30f16134c3 --- /dev/null +++ b/.bazelignore @@ -0,0 +1 @@ +eclipse-out diff --git a/tools/eclipse/project.py b/tools/eclipse/project.py index dace18227e..5fd612637c 100755 --- a/tools/eclipse/project.py +++ b/tools/eclipse/project.py @@ -141,9 +141,8 @@ def gen_classpath(ext): def classpathentry(kind, path, src=None, out=None, exported=None): e = doc.createElement('classpathentry') e.setAttribute('kind', kind) - # TODO(davido): Remove this and other exclude BUILD files hack - # when this Bazel bug is fixed: - # https://github.com/bazelbuild/bazel/issues/1083 + # Excluding the BUILD file, to avoid the Eclipse warnings: + # "The resource is a duplicate of ..." if kind == 'src': e.setAttribute('excluding', '**/BUILD') e.setAttribute('path', path)