We have a project with 3 subprojects one of which is called bldfiles. Each has a .project file so we can tell eclipse to import the project and it imports all 3 subprojects. Any files in the project directly do NOT show up in eclipse of course. I think with gradle though, we have to have a file in the project directory, so we would like to put a file there that we “never” change since it doesn’t show up in eclipse. We would like that file to import(or is it called something else) the “real” gradle build file from bldfiles/build.gradle.
How to do this?
and will it still work like all that code was in the top level gradle file? (ie. when building from subprojects and such, it finds the top level one, etc. etc.)
thanks,
Dean
You don’t necessarily have to have your main
build.gradlefile in the project directory. Although it’s not very clear in the manual, but you can have your project’sbuild.gradlein a sibling directory calledmaster.So instead of (the usual hierarchical setup):
you can have this to achieve the same behaviour as above (flat hierarchy setup):
Note: Make sure to use the
includeFlatdirective in yourmaster/gradle.settingsfile, instead of usualinclude.