Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/@unreleased/pr-1134.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: fix
fix:
description: The `baseline-idea` plugin now correctly marks test resources as test
resources in IntelliJ.
links:
- https://github.com/palantir/gradle-baseline/pull/1134
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class BaselineIdea extends AbstractBaselinePlugin {
}

// Configure Idea module
markResourcesDirs(ideaModuleModel)
moveProjectReferencesToEnd(ideaModuleModel)
}

Expand Down Expand Up @@ -281,24 +280,6 @@ class BaselineIdea extends AbstractBaselinePlugin {
return base.appendNode(name, attributes + defaults)
}

/**
* By default the Idea plugin marks resources dirs as source dirs.
*/
private void markResourcesDirs(IdeaModel ideaModel) {
ideaModel.module.iml.withXml {
def node = it.asNode()
def content = node.component.find { it.'@name' == 'NewModuleRootManager' }.content[0]
content.sourceFolder.each { sourceFolder ->
if(sourceFolder.@url?.endsWith('/resources')) {
sourceFolder.attributes().with {
boolean isTestSource = (remove('isTestSource') == 'true')
put('type', isTestSource ? 'java-test-resource' : 'java-resource')
}
}
}
}
}

/**
* By default, IntelliJ and Gradle have different classpath behaviour with subprojects.
*
Expand Down