I am trying to stop IntelliJ from putting generated files in my primary source folder. These generated .java files are interfering with glob rules that I use with other tools. (Think
find -name '*.java'.)
For Android development, I appear to be able to customize the output directory for
R.java and files generated from the AIDL compiler, but IntelliJ appears insistent on creating a
gen/ directory and writing a
BuildConfig.java file in my source tree. Is there anything that I can do to stop it?
I realize that normally, the
gen/ folder is created alongside the
src/ folder, but in my case, I am using something like:
<sourceFolder packagePrefix="com.example" />
gen/ directory that is created under
com.example and looks like a new package (
com.example.gen) whereas it is not.
click File->Project Structure->Facets,you can here found your android app,click Generated sources here, now you can set Directory for generated files here。