4 ms·
> Even some of the seemingly obvious ones like pure Java/JUnit 4 testing on x86 are impossible This is actually possible, albeit through a third party framewor
by ZoFreX 12y ago
> Even some of the seemingly obvious ones like pure Java/JUnit 4 testing on x86 are impossible
This is actually possible, albeit through a third party framework - Robolectric.
> The Android Gradle plugin has a different interface than the Java Gradle plugin, so other existing Gradle plugins (this one being an example) all have to be re-written specifically for Android
This is probably the single most aggravating thing about the new build system. It's a serious pain point. Nothing works except what Google's developers have spent time on integrating - sure, there are third party libraries and hacks to bring some more of the Java ecosystem, but only the things Google has deemed worthy integrate nicely with the build tool and the IDE.
- krschultz 12y agoRobolectric testing with the new build system is such a pain in the ass I don't even know where to start. Jake Wharton - author of god knows how many Android libraries - even threw up his hands on it: https://github.com/JakeWharton/gradle-android-test-plugin https://github.com/JakeWharton/gradle-android-test-plugin.
- ZoFreX 12y agoIt's not that hard to get started: https://github.com/zofrex/gradle-template-android-robolectric https://github.com/zofrex/gradle-template-android-robolectri... And the Robolectric team adopted Jake's plugin, by the way: https://github.com/robolectric/robolectric-gradle-plugin https://github.com/robolectric/robolectric-gradle-plugin Also, it is going to get better. At the moment one of the biggest issues is that there is no way for Gradle to expose extra sourcesets to the IDE, this is a limitation of Gradle and not just the Android plugin I believe, and the tools team want the Gradle build to be the single source of truth. They are working to get that added to Gradle (and they have made a lot of positive changes to Gradle already as they build the new tools), and then things like Robolectric will be able to hook in with the IDE just fine.