More c/cpp questions

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

More c/cpp questions

Xavier Ducrohet
Hi all,

the new native support looks pretty cool and I'm going to start looking at using it for android NDK usage.

I see that clang is not supported on Windows? will this come reasonably soon (next few releases)?

would there be a downside to have our plugin apply both the c and cpp plugins? (we already apply the javabaseplugin).

The new dependency stuff with the linkage, api concepts seems very different from the Configuration objects. What's the status of the API for this? Is this going to be something completely separate from the Java stuff?

I could envision a "android-native" project where one would work on a JNI library. The android-native plugin would setup our custom toolchain as well as our custom platform (but there could be other toolchain/platform as well for other targets).
A normal Android project could have its own JNI component that would depend on this project. Building the jni component of the Android project would be handled automatically but if the linkage is dynamic then we'll need to grab that library to package it in the APK (and deal with different ABIs).

All of this is very promising and  exciting. I had started a basic NDK integration that used the makefile underneath but I'm going to abandon it and move to this in the next month or two. I'm sure I'll have plenty of other questions.
Reply | Threaded
Open this post in threaded view
|

Re: More c/cpp questions

Adam Murdoch

On 8 Mar 2014, at 10:01 am, Xavier Ducrohet <[hidden email]> wrote:

Hi all,

the new native support looks pretty cool and I'm going to start looking at using it for android NDK usage.

I see that clang is not supported on Windows? will this come reasonably soon (next few releases)?

It could. How are you using clang? Under cygwin? standalone?


would there be a downside to have our plugin apply both the c and cpp plugins? (we already apply the javabaseplugin).

Our core native plugins try to avoid making any assumptions about the source languages for a native component, to keep things flexible. In practice, though, it probably doesn’t matter hugely. The language plugins don’t create tasks for empty source sets, for example.


The new dependency stuff with the linkage, api concepts seems very different from the Configuration objects. What's the status of the API for this? Is this going to be something completely separate from the Java stuff?

The dependency dsl for the native components is, intentionally very simple. Over time, we want to make this dsl richer, and move the native and jvm dependency dsl much closer together.

The `linkage:` stuff is a bit of an experiment, though.


I could envision a "android-native" project where one would work on a JNI library. The android-native plugin would setup our custom toolchain as well as our custom platform (but there could be other toolchain/platform as well for other targets).
A normal Android project could have its own JNI component that would depend on this project. Building the jni component of the Android project would be handled automatically but if the linkage is dynamic then we'll need to grab that library to package it in the APK (and deal with different ABIs).

This would be cool. I’d love to have a general jni plugin that wires in the native header generation at the right places, and connects together the meta-data for the jvm pieces and the native pieces.

Things get very interesting in dependency management once you start mixing jvm and native components in your dependency graph. Suddenly your nice simple jvm component has variants at runtime, and test time too.


--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com



Reply | Threaded
Open this post in threaded view
|

Re: More c/cpp questions

Daz DeBoer-2
In reply to this post by Xavier Ducrohet
On Fri, Mar 7, 2014 at 4:01 PM, Xavier Ducrohet <[hidden email]> wrote:
Hi all,

the new native support looks pretty cool and I'm going to start looking at using it for android NDK usage.

I see that clang is not supported on Windows? will this come reasonably soon (next few releases)?

would there be a downside to have our plugin apply both the c and cpp plugins? (we already apply the javabaseplugin).

They are intended to be used this way. You apply multiple language plugins that share the same base infrastructure.