Inconsistency when Java legacy depends on task generated from model elements Gradle 2.7

Hi,

Working on the native support of the protobuf plugin
( https://github.com/Shad0w1nk/protobuf-gradle-plugin-1/tree/native ), I
got some inconsistency between Mac OS X and Windows build using default
toolchain, build type, platform and variant.
The inconsistency happen
here:
https://github.com/Shad0w1nk/protobuf-gradle-plugin-1/blob/native/build.gradle#L86.
At that line, I’m depending on task from a native project that build
executable and libraries. On Mac OS (Yosemite) and presumably Linux
(Ubuntu), the code compiles fine as expected. However, on Windows (10 in
my case), it fail saying the task couldn’t be found. I looked at the
info logs and the Mac one show some log about finding gcc/clang before
starting to build and the Windows one doesn’t seems to do any of those
check and fail. The build is executed on Gradle 2.7. I tried on 2.8 and I
got the same problem. I didn’t try on 2.9 because of a change to the
top-level binaries container that have been moved to the model which
break the build.

I tried reproducing at a smaller scale but I
couldn’t get it to crash. I will try to a bit more once I get more time,
in the meanwhile I want to know if there is anything obvious that seems
to be problematic. My best guess is something is happening with the
Visual Studio toolchain plugin as Gcc and Clang both share most of the
logic.

Spec for the build are as follow:
Crash on:
* Windows 10
* JVM 8 (must be close to latest)
* Gradle 2.7
* Visual Studio 2013 compilers

Succeed on:
* Mac OS X Yosemite
* JVM (latest from apple, must be 8)
* Gradle 2.7
* clang (latest from apple)

I can post the exact version if those are needed.