On 4/28/17, Steven Winston <
gpx...@gmail.com> wrote:
> So there are a couple of options for you. The easiest involves writing
> your own intellij plugin. The idea would be to create a new run
> configuration that uses your desired CMake distro from your desired
> location; then plugin all the rest of the Android plugin steps. I've done
> this successfully with both a Lua Debugger and gtest build/configurations.
> You probably could get away with just switching the build tools path by
> abstracting the build process and inheriting from the gradle plugin; but I
> haven't really tried to hijack that portion of the build so I don't really
> know.
> The next easiest way would be to grab the last source release for gradle
> that included cmake (it's been awhile so there's a lot of changes back).
> From there, grab the corresponding CMake, create a list of changes and
> then try merging all those changes into the latest CMake. The only problem
>
> is Google tends to not stand still so there's probably quite a few changes
> between their last public source release, and the one they currently are
> using in production so there's going to be changes that are missing. This
> process is probably going to be very low success rate and impossible to
> keep up to date. Thus if you have to go down a route of not using their
> CMake, I highly encourage you to in a very limited way look into the first
> option, Intellij plugin.
>
Hi Steven,
Your ideas sound pretty good.
I was told where Google’s CMake fork was and while messy, I think I
have a good chance of successfully merging with it.
So now I’m trying to figure out the Gradle plugin stuff. I don’t have
any familiarity with how this part works. But your idea of subclassing
the Google one, just enough to override the path to where CMake is
located, is really appealing. But I’m still not sure where to start.
I’m looking for two things.
1) Can you point me to some examples of how to subclass the Gradle
plugin, like how you did with your Lua Debugger?
2) I need find the official source code that controls invoking CMake
so I can understand what to override, but I don’t know where it
exists.
I tried the official process of using
repo init -u
https://android.googlesource.com/platform/manifest -b
studio-master-dev
repo sync
But that took a 24 hour day to grab everything, and the first time
around, I missed the -b studio-master-dev (looking at a different set
of instructions). So the second time around took another full day as
it seemed to redownload everything, only to have it break with:
error: Cannot remove project "bionic": uncommitted changes are present
commit changes, then run sync again
(I can try another fresh run, but I’m taking a break of completely
saturating my internet connection so I can use it for other stuff.)
So I tried directly cloning:
https://android.googlesource.com/platform/tools/external/gradle/
and doing git checkout studio-master-dev
But everything inside seems to be a prebuilt binary, not source code.
I also looked at:
https://android.googlesource.com/platform/tools/gradle
but there didn’t seem to be much there that is relevant to this.
I also looked at what I believe is the official Gradle repository, but
I did not see any CMake stuff in there.
https://github.com/gradle/gradle.git
Any ideas of what I’m looking for and where it exists?
Thanks,
Eric