Skip to content

Apache Lucene open-source search software

GH-11819: Exclude MR-JAR sourceSet and folders from Idea Sync (#11836)

Uwe Schindlerf54fddc89f19
diff --git a/gradle/ide/intellij-idea.gradle b/gradle/ide/intellij-idea.gradle
index f9e7d1d456e..cfb0d52fec1 100644
--- a/gradle/ide/intellij-idea.gradle
+++ b/gradle/ide/intellij-idea.gradle
@@ -37,6 +37,21 @@ if (isIdea) {
}
}
+if (isIdeaSync) {
+ allprojects {
+ // disable all MR-JAR folders by hiding them from IDE after evaluation:
+ plugins.withType(JavaPlugin) {
+ sourceSets.matching{ it.name ==~ /main\d+/ }.all{ SourceSet sourceSet ->
+ project.afterEvaluate {
+ logger.lifecycle("Skipping MR-JAR sourceSet on IntelliJ Idea: " + sourceSet.name)
+ sourceSet.java.srcDirs = []
+ sourceSet.resources.srcDirs = []
+ }
+ }
+ }
+ }
+}
+
if (isIdeaBuild) {
// Skip certain long tasks that are dependencies
// of 'assemble' if we're building from within IntelliJ.