Merge pull request #15452 from ywelsch/fix/gradle-idea-resources
Gradle idea plugin does not properly mark resources directories
This commit is contained in:
commit
3a95516b79
24
build.gradle
24
build.gradle
|
@ -179,6 +179,30 @@ gradle.projectsEvaluated {
|
||||||
// intellij configuration
|
// intellij configuration
|
||||||
allprojects {
|
allprojects {
|
||||||
apply plugin: 'idea'
|
apply plugin: 'idea'
|
||||||
|
|
||||||
|
idea {
|
||||||
|
module {
|
||||||
|
// same as for the IntelliJ Gradle tooling integration
|
||||||
|
inheritOutputDirs = false
|
||||||
|
outputDir = file('build/classes/main')
|
||||||
|
testOutputDir = file('build/classes/test')
|
||||||
|
|
||||||
|
iml {
|
||||||
|
// fix so that Gradle idea plugin properly generates support for resource folders
|
||||||
|
// see also https://issues.gradle.org/browse/GRADLE-2975
|
||||||
|
withXml {
|
||||||
|
it.asNode().component.content.sourceFolder.findAll { it.@url == 'file://$MODULE_DIR$/src/main/resources' }.each {
|
||||||
|
it.attributes().remove('isTestSource')
|
||||||
|
it.attributes().put('type', 'java-resource')
|
||||||
|
}
|
||||||
|
it.asNode().component.content.sourceFolder.findAll { it.@url == 'file://$MODULE_DIR$/src/test/resources' }.each {
|
||||||
|
it.attributes().remove('isTestSource')
|
||||||
|
it.attributes().put('type', 'java-test-resource')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
idea {
|
idea {
|
||||||
|
|
Loading…
Reference in New Issue