I am writing a plugin for intellij and I would like to programmatically alter the build.gradle file of an Intellij Project.
I want to add
sourceSets {
resources {
srcDir 'src/resources'
}
}
inside the android
object in the build.gradle file (this is an android project)
I realize I have to do something along the lines
GradleBuildFile gradleBuildFile = GradleBuildFile.get(module);
GrStatementOwner closure = gradleBuildFile.getClosure("android/sourceSets/main/resources");
gradleBuildFile.setValue(closure, BuildFileKey.SRC_DIR, "blah");
Problem is, there is no BuildFileKey.SRC_DIR
and I didn't find something remotely similar.
Also, will this add the sourceSets
object if it is not there in the build.gradle file?
Any advice?
Thanks
Update: Alternatively, is there a way to mark a folder as a resource folder? I don't want to use the default res folder. Perhaps using the AndroidFacet object..