java - Programmatically updating build.gradle in an intellij plugin -


i writing plugin intellij , programmatically alter build.gradle file of intellij project.

i want add

sourcesets {     resources {         srcdir 'src/resources'     } } 

inside android object in build.gradle file (this android project)

i realize have along lines

gradlebuildfile gradlebuildfile = gradlebuildfile.get(module); grstatementowner closure = gradlebuildfile.getclosure("android/sourcesets/main/resources"); gradlebuildfile.setvalue(closure, buildfilekey.src_dir, "blah"); 

problem is, there no buildfilekey.src_dir , didn't find remotely similar.

also, add sourcesets object if not there in build.gradle file?

any advice?

thanks

update: alternatively, there way mark folder resource folder? don't want use default res folder. perhaps using androidfacet object..


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -