On 05/12/2019 00:45, Tatu Saloranta wrote:
> On Wed, Dec 4, 2019 at 2:36 AM Michael Rogers <
mic...@briarproject.org> wrote:
>>
>> The situation on Android is that unfortunately we still need to maintain
>> compatibility with the Java 6 API to support Android 6 and older (about
>> half of currently active devices). Java 8 language features are OK - the
>> Android toolchain transforms them into Java 6-compatible bytecode.
>>
>> So from my point of view it would be nice if a supported version of
>> Jackson was compatible with the Java 6 API for a few more years.
>>
>> Animal Sniffer can be used to check API compatibility at build time.
>
> Interesting.
>
> One thing that I am missing, unfortunately, is a regression test suite
> that could detect cases where post-JDK6 API was being used. It would
> be great if there was a profile for Travis (for example), to test this
> out. I do get bug reports for regressions, but those are
> after-the-fact (i.e. when a version has broken compatibility).
I've only used the Gradle plugin myself, but Animal Sniffer also has a
Maven plugin that could perhaps be incorporated into the Travis build?
For what it's worth, here's an example of using the Gradle plugin. The
'sourceCompatibility' line indicates that we can use Java 8 language
features. The 'targetCompatibility' line is misleading; it has to be set
to the same value as 'sourceCompatibility', but we're actually
targetting the Java 6 API. The 'signature' line tells the Animal Sniffer
plugin to check for compatibility with the Java 6 API:
https://code.briarproject.org/briar/briar/blob/master/bramble-api/build.gradle
Cheers,
Michael