Finally I've managed to compile somehow working version of godot.
I've used visual studio for compiling godot on Android, as well as building gradle packaging.
Gradle build system is believably complex.
Visual studio itself provides an examples of gradle demo project, but they do contain only java - I wanted to have in similar manner to godot both - C++ and Java. And that turned out to be bit complex project itself.
Visual studio and Android studio both provide a wizard, which can generate some sample project, but sample project is rather messy in overall - a lot of unnecessary configuration files. I've liked what godot build.gradle looks like - one configuration file and nothing fancy.
Besides this Visual studio itself does not provide code syntax highlightning or intellisense for gradle. Android studio does, but my needs were relatively simple, no need for fancy gradle scripting.
Visual studio was also based on old gradle. Using newer gradle - up to godot level or up to Android studio level sounded like mission impossible.
Finally I've decided to restart everything, and went down to basics and beginning. I've downloaded and installed Android studio, created simple JNI (Java + C++) sample project and started iterating it through. After each successful step I've copied whole test project folder to another one, and continued refactoring further. I had about 17 iterations altogether - and I've managed to clean up fully JNI sample project from unnecessary files, upgraded gradle to Android studio level, simplified gradle config itself and adapted to Visual studio.
I've added support of gradle packaging to my own tool syncProj.
And finally wrote initial documentation over here:
https://docs.google.com/document/d/1C1YrbFUVpTBXajbtrC62aXru2om6dy5rClyknBj5zHU/edit#heading=h.23c0mll0wzk3
And placed sample demo project over here:
https://sourceforge.net/p/syncproj/code/HEAD/tree/sampleScripts/AndroidGradlePackage/
Demo syncProj C# script can be found here:
https://sourceforge.net/p/syncproj/code/HEAD/tree/sampleScripts/AndroidGradlePackage/TestAndroidJNI.cs
Related to Visual studio adaptation, I've managed to configure build variants so that Visual studio could build by gradle project.
Visual studio itself calls "wgradle.bat" with parameters assemblearm7debug, assemblerarm8debug, and so on.
I've remapped those configurations using batch (my own written gradlew.bat)
In sample project build variants are configured here:
https://sourceforge.net/p/syncproj/code/HEAD/tree/sampleScripts/AndroidGradlePackage/build.gradle#l58
Via advanced batching techniques I've recoded to autoprobe all paths from registry keys, also got rid of
gradle_wrapper.jar - it's copied on demand when project is compiled. Its version is not so relevant - it
will bootstrap gradle only. Currently batches means that project can be built on windows only, but I don't need other platforms at the moment.
My own version of gradlew.bat - batch:
https://sourceforge.net/p/syncproj/code/HEAD/tree/sampleScripts/AndroidGradlePackage/gradlew.bat
I've detached .apk package signing into separate (project specific) batch file.
My own current version of syncProj C# script for godot for building visual studio projects (which targets under windows and android) - now also includes .apk packaging:
https://drive.google.com/open?id=0B9oDi0MZfcs0a09fRWlvc0haWEE
And here is somehow tuned version of platform\android\java\build.gradle:
https://drive.google.com/open?id=1fttsfyqub0Ggpy9eKu5qvFLobcegRN21
At the moment I can see godot logo splash starting up in Android, and I can debug Java and C++ code from Visual studio.
Debug breakpoints seems to be working.
There is no game inside .apk package, and it's also possible that I'm using some unstable / development version of godot and / misconfigured some sources / defines - did not reach yet fully functional demo game. I'm not sure however if I ever will, my target is not the game itself.
Java support in Visual studio is somewhere in beta stage, like Java code syntax highlighting does not always work correctly, and there are also other glitches and bugs besides this - but at the moment I don't intent to use Java code in full scale - planning to keep it at minimum, in similar manner to godot.