The documentation is comprehensive, but as always does not exactly match what I have in front of me.
After moving the sources around I started generating a
build.gradlefile. I added my external libs to the dependencies but the build did not succeed with a lot of trial and error.
At the end with the help of googling and StackOverflow I found out that order matters a lot in the build file:
First comes the section about plugins for the build system itself:
Settings herein only apply to the build system, but not to the project to be built.
After this we can use those plugins (the android one)
apply plugin: 'android'
apply plugin: 'idea'
And only when those plugins are loaded, we can start talking about the project itself and add dependencies
I guess for someone experienced with Gradle, this is no news, but it took me quite some time to figure out especially as the documentation mentions all the parts but not on a larger example.
The file layout now looks like this:
One caveat is that the external libraries are not automagically yet loaded into the IDE - one still has to manually add them in the project structure wizard.
The last thing is then to mark
build/source/r/debugas source directory to also get completion for the R.* entries.