Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set resourceDirs in gradle IDEA module?

I have a separate resource folder which I want to add to IDEA classpath. The reason I don't use main/resources is I need to have the folder outside of JAR to allow XML config files edition.

This is what works in IDEA

apply plugin: 'idea'
idea {
    module {
        resourceDirs += file('src/dist/etc')
   }
}

When I press "reimport from Gradle" the folder is mapped as Resource Folder. So IDEA understands resourceDirs property.

But Gradle 2.2 fails:

Could not find property 'resourceDirs' on org.gradle.plugins.ide.idea.model.IdeaModule_Decorated@329c1075.

How can I set a resource dir in IDEA from Gradle?

like image 602
relgames Avatar asked Nov 01 '22 13:11

relgames


1 Answers

idea.module.resourceDirs += file('src/dist/etc')

Should work since Gradle 4.7 where support for specifying idea resourceDirs has been added.

like image 89
Fanick Avatar answered Nov 11 '22 16:11

Fanick