mirror of https://github.com/apache/lucene.git
LUCENE-9311: detect intellij reimport and modify sourceset to exclude solr-ref-guide/tools (#1422)
This commit is contained in:
parent
c7cac5749a
commit
2437f3f56c
|
@ -88,8 +88,8 @@ apply from: file('gradle/jar-manifest.gradle')
|
|||
// Maven publishing.
|
||||
apply from: file('gradle/maven/defaults-maven.gradle')
|
||||
|
||||
// IDE settings and specials.
|
||||
apply from: file('gradle/defaults-idea.gradle')
|
||||
// IDE support, settings and specials.
|
||||
apply from: file('gradle/ide/intellij-idea.gradle')
|
||||
|
||||
// Validation tasks
|
||||
apply from: file('gradle/validation/precommit.gradle')
|
||||
|
|
|
@ -15,6 +15,15 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Try to detect IntelliJ model loader ("reimport") early.
|
||||
def isIdea = System.getProperty("idea.active") != null ||
|
||||
gradle.startParameter.taskNames.contains('idea') ||
|
||||
gradle.startParameter.taskNames.contains('cleanIdea')
|
||||
|
||||
if (isIdea) {
|
||||
logger.warn("IntelliJ Idea IDE detected.")
|
||||
}
|
||||
|
||||
allprojects {
|
||||
apply plugin: 'idea'
|
||||
|
||||
|
@ -27,3 +36,18 @@ allprojects {
|
|||
}
|
||||
}
|
||||
|
||||
// Remove tools source set entirely if we're running under IntelliJ. Otherwise
|
||||
// files that reference ant can't be compiled.
|
||||
if (isIdea) {
|
||||
configure(project(":solr:solr-ref-guide")) {
|
||||
afterEvaluate {
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDirs = []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue