Realm-java: Support android experimental plugin

Created on 1 Apr 2016  路  11Comments  路  Source: realm/realm-java

Question from SO: http://stackoverflow.com/questions/36341822/run-realm-with-android-experimental-plugin

What could be fixed in our side:
in 'gradle-plugin/Realm.groovy` check through the plugin name instead of the class.

def isAndroidApp = project.plugins.hasPlugin("com.android.application") ||
                project.plugins.hasPlugin("com.android.model.application") // Android experimental plugin
def isAndroidLib = project.plugins.hasPlugin("com.android.library") ||
                project.plugins.hasPlugin("com.android.model.library") // Android experimental plugin

However, it will still fail because of the AndroidAptPlugin doesn't support Android experimental plugin yet, see issue https://bitbucket.org/hvisser/android-apt/issues/46/support-for-experimental-plugin

T-Enhancement

Most helpful comment

@masterjefferson Just curious, what is the special reason you want to use the experimental plugin? For NDK project? There are other choices now like the the ndk with cmake which doesn't require the experimental plugin https://github.com/googlesamples/android-ndk/tree/master-cmake/hello-jni .

And we tried it, it works great! https://github.com/realm/realm-java/pull/2960

All 11 comments

Perhaps we should document this under Current limitations on the website until we get this fixed?

Heads up, I have been using this plugin as a replacement for apt when using the android experimental plugin, and it does work. I have only used it in conjunction with butterknife so far though.

I'd really like to see this fixed, as our build includes a _lot_ of C/C++ code and the experimental plugin is a must have.

@masterjefferson Just curious, what is the special reason you want to use the experimental plugin? For NDK project? There are other choices now like the the ndk with cmake which doesn't require the experimental plugin https://github.com/googlesamples/android-ndk/tree/master-cmake/hello-jni .

And we tried it, it works great! https://github.com/realm/realm-java/pull/2960

@beeender Thanks for the heads up on that! Yes, we are using it for NDK support. I must have missed that update somehow. I'll update our build and give it shot.

@beeender wait, how would you make the realm-android Gradle plugin run with cmake?

EDIT: Oh I should just learn how to read: https://github.com/googlesamples/android-ndk/tree/master-cmake

@Zhuinden check this branch https://github.com/googlesamples/android-ndk/tree/master-cmake , lots of fun

@beeender yeah I've just figured it out that that's there too :smile:

This seems to be a way better alternative than the "experimental plugin" which breaks every Gradle version update and doesn't work with anything.

Thanks for the info :+1:

Probably not as relevant with CMake now being officially supported, but keeping it open just in case.

I think we can safely close this. For all intents and purposes, the experimental plugin seems dead: http://tools.android.com/tech-docs/new-build-system/gradle-experimental

It still receives fairly regular updates:

https://bintray.com/android/android-tools/com.android.tools.build.gradle-experimental/view

They were always terrible at keeping the wiki up-to-date

@josmad well how do they expect people to use it if they don't update their docs?

I haven't seen anything that would support the experimental plugin, CMake is better and officially supported.

Experimental was pretty much just as dead 2 years ago, except then there were no other options in AS. Makes me wonder why it even exists.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wezley98 picture wezley98  路  3Comments

jjorian picture jjorian  路  3Comments

tloshi picture tloshi  路  3Comments

bryanspano picture bryanspano  路  3Comments

CNyezi picture CNyezi  路  3Comments