mirror of
https://github.com/apache/lucene.git
synced 2025-02-08 02:58:58 +00:00
Revert "Try to detect sync and build phases within intellij and act accordingly to support both modes of compilation (gradle and intellij)."
This reverts commit 13e10eaae230cd79ac56bb9ebc0fe64cd7cafdf6.
This commit is contained in:
parent
13e10eaae2
commit
e8c1720956
@ -15,46 +15,23 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Try to detect IntelliJ model loader project structure "sync"
|
||||
//
|
||||
rootProject.ext.isIdea = Boolean.parseBoolean(System.getProperty("idea.active", "false"))
|
||||
rootProject.ext.isIdeaSync = Boolean.parseBoolean(System.getProperty("idea.sync.active", "false"))
|
||||
rootProject.ext.isIdeaBuild = (isIdea && !isIdeaSync)
|
||||
// Try to detect IntelliJ model loader ("reimport") early.
|
||||
rootProject.ext.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'
|
||||
allprojects {
|
||||
apply plugin: 'idea'
|
||||
|
||||
idea {
|
||||
module {
|
||||
outputDir file('build/idea/classes/main')
|
||||
testOutputDir file('build/idea/classes/test')
|
||||
downloadSources = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isIdeaBuild) {
|
||||
// Skip certain long tasks that are dependencies
|
||||
// of 'assemble' if we're building from within IntelliJ.
|
||||
gradle.taskGraph.whenReady { taskGraph ->
|
||||
def tasks = taskGraph.getAllTasks()
|
||||
|
||||
def skipTasks = [
|
||||
// Skip site javadoc rendering
|
||||
".*:(renderSiteJavadoc)",
|
||||
]
|
||||
|
||||
logger.lifecycle("Skipping certain tasks on IntelliJ builds")
|
||||
tasks.each { task ->
|
||||
def taskPath = task.path
|
||||
if (skipTasks.any { pattern -> taskPath ==~ pattern }) {
|
||||
logger.debug("Skipping task on IntelliJ: " + taskPath)
|
||||
task.enabled = false
|
||||
}
|
||||
idea {
|
||||
module {
|
||||
outputDir file('build/idea/classes/main')
|
||||
testOutputDir file('build/idea/classes/test')
|
||||
downloadSources = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ allprojects {
|
||||
|
||||
// LUCENE-10304: if we modify the classpath here, IntelliJ no longer sees the dependencies as compile-time
|
||||
// dependencies, don't know why.
|
||||
if (!rootProject.ext.isIdeaSync) {
|
||||
if (!rootProject.ext.isIdea) {
|
||||
task.classpath = modularPaths.compilationClasspath
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ allprojects {
|
||||
|
||||
// LUCENE-10304: if we modify the classpath here, IntelliJ no longer sees the dependencies as compile-time
|
||||
// dependencies, don't know why.
|
||||
if (!rootProject.ext.isIdeaSync) {
|
||||
if (!rootProject.ext.isIdea) {
|
||||
def jarTask = project.tasks.getByName(mainSourceSet.getJarTaskName())
|
||||
def testJarTask = project.tasks.getByName(testSourceSet.getJarTaskName())
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user