Native binary support for mobile

The native binary support is really great, but could use the addition of cross-compiling for mobile: android (armv6, armv7, x86) and iOS (arm, x86 simulator).

Since gcc/linux and clang/macosx are already supported, this shouldn’t require a terrible lot of extra work.

You’re right, this wouldn’t be too hard to add to the code. There is an outstanding pull request for ARM support.

The big problem is that we don’t have infrastructure for automated testing of these platforms, and we’re reluctant to add code that we can’t test.

I appreciate the test-first philosophy. :slight_smile:

Perhaps I can help out here… What do the automated tests look like for native binary? Are you just linking “hello world” executables/libs?

We have an extensive integration test suite: you can see all of the tests under https://github.com/gradle/gradle/tree/master/subprojects/cpp/src/integTest/groovy/org/gradle/nativebinaries. Most of the actual tests are found in ‘language/cpp’ under that directory.

One issue here is that while we have the infrastructure (linux/windows) to cross-compile for mobile platforms, we don’t have anything setup to test if the compiled binary actually works. I don’t have any experience in this area.

Actually running the binary would be much more involved. Since its cross-compilation there’s nothing to run it on… (And to make it even more complicated, you can’t just run a ‘hello world’ exe on mobile anyway without it being a proper app.)

Cross-compilation in general is going to have this issue. For example, if you added mingw support on linux (gcc that compiles to windows).

In general, if you can get an executable or shared lib to link you’re 95% of the way there. It may be that this is “good enough”.