true
if the target is a rule and has a attribute named tags
containing the
+ * specified tag.
+ *
+ * @param tag
+ * the tag to check
+ * @return true
if the rule has the specified tag, false
otherwise
+ * @throws CoreException
+ */
+ public boolean hasTag(String tag) throws CoreException {
+ var tags = getInfo().getRuleAttributes().getStringList("tags");
+ return (tags != null) && tags.contains(tag);
+ }
}
diff --git a/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/SynchronizeProjectViewJob.java b/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/SynchronizeProjectViewJob.java
index 75f092ec..3afae43a 100644
--- a/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/SynchronizeProjectViewJob.java
+++ b/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/SynchronizeProjectViewJob.java
@@ -110,7 +110,8 @@ private static String queryForTargets(Collection
+ * Bazel allows to re-use sources in multiple targets. It will then compile those multiple times. An example setup
+ * is where all code is exposed as java_library
as well as many targets for java_test
with
+ * only one test class. If this is the case, we want to not issue "split package" warnings when the test class is
+ * already handled at the java_library
level.
+ *
java_library
as well as many targets for java_test
with
+ * only one test class. If this is the case, we want to not issue "split package" warnings when the test class is
+ * already handled at the java_library
level.
+ */
+ if ((sharedSourceInfo != null) && sharedSourceInfo.hasSourceDirectories()) {
+ var sharedSourceDirectories = sharedSourceInfo.getSourceDirectories();
+ potentialSplitPackageOrSubsetFolders.removeIf(
+ potentialSourceRoot -> sharedSourceDirectories.contains(potentialSourceRoot)
+ || sharedSourceDirectories.stream().anyMatch(p -> p.isPrefixOf(potentialSourceRoot)));
+ }
+
// when there are no split packages we found a good setup
if (potentialSplitPackageOrSubsetFolders.isEmpty()) {
// collect remaining files without a root
- if (sourceEntriesBySourceRoot.containsKey(INVALID)) {
- sourceFilesWithoutCommonRoot = (List