Check Android compatibility using AnimalSniffer

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

Check Android compatibility using AnimalSniffer

Florian Schmaus
Would the legion be interested in a little patch that introduces Android
compatibility verification to the test suite?

I've created a GitHub pull request at

https://github.com/bcgit/bc-java/pull/336

which adds the AninimalSniffer [1] Gradle plugin to the Gradle build
process and activates Android 8 compatibility verification for all
subprojects.

I know that Bouncycastle is used a lot on Android (OpenKeychain, …) and
I'm mentoring a GSOC project which will use Bouncycastle on Android too.
Therefore it appears to be a good idea to check for Android
compatibility to avoid runtime errors because of linkage errors.

Since this is my first contribution to the Bouncycastle project, I'm
happy to hear your thoughts on this matter.

As a related side note: After cloning Bouncycastle, issuing "gradle
check" does not succeed as the S/MIME junit tests fail. I think the root
cause is

java.lang.NoClassDefFoundError: Could not initialize class
org.bouncycastle.mail.smime.test.NewSMIMESignedTest
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at junit.framework.TestSuite.createTest(TestSuite.java:68)
        at junit.framework.TestSuite.addTestMethod(TestSuite.java:310)
        at junit.framework.TestSuite.addTestsFromTestCase(TestSuite.java:153)
        at junit.framework.TestSuite.<init>(TestSuite.java:132)
        at junit.framework.TestSuite.addTestSuite(TestSuite.java:219)
        at org.bouncycastle.mail.smime.test.AllTests.suite(AllTests.java:25)

Is there any special setup needed prior running the tests?

- Florian

1: https://github.com/xvik/gradle-animalsniffer-plugin



Reply | Threaded
Open this post in threaded view
|

Re: Check Android compatibility using AnimalSniffer

Hohwiller, Jörg
Hi Florian,

I am also new here but looks like a good and reasonable improvement.
Thanks for your support.

After your observation with the JUnits I would also like to discuss if
travis (travis-ci.org) should be enabled for the repo. This would add a
free CI service that perfectly integrates with github. As a result you
can add a build status batch logo to the Readme.md and will also get
automatic build status feedback for every PR so before merging you will
already know if the build will succeed.

I am using this in arbitrary of my OSS projects:

See e.g. here: https://github.com/m-m-m/util/#mmm-util

All you need to do is add a travis.yml config file:

https://github.com/m-m-m/util/blob/master/.travis.yml

And then you need to enable the repo on travis once.

I am happy to assist if the legion is interested...

Cheers

   Jörg


Am 04.05.2018 um 15:00 schrieb Florian Schmaus:

> Would the legion be interested in a little patch that introduces Android
> compatibility verification to the test suite?
>
> I've created a GitHub pull request at
>
> https://github.com/bcgit/bc-java/pull/336
>
> which adds the AninimalSniffer [1] Gradle plugin to the Gradle build
> process and activates Android 8 compatibility verification for all
> subprojects.
>
> I know that Bouncycastle is used a lot on Android (OpenKeychain, …) and
> I'm mentoring a GSOC project which will use Bouncycastle on Android too.
> Therefore it appears to be a good idea to check for Android
> compatibility to avoid runtime errors because of linkage errors.
>
> Since this is my first contribution to the Bouncycastle project, I'm
> happy to hear your thoughts on this matter.
>
> As a related side note: After cloning Bouncycastle, issuing "gradle
> check" does not succeed as the S/MIME junit tests fail. I think the root
> cause is
>
> java.lang.NoClassDefFoundError: Could not initialize class
> org.bouncycastle.mail.smime.test.NewSMIMESignedTest
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> at junit.framework.TestSuite.createTest(TestSuite.java:68)
> at junit.framework.TestSuite.addTestMethod(TestSuite.java:310)
> at junit.framework.TestSuite.addTestsFromTestCase(TestSuite.java:153)
> at junit.framework.TestSuite.<init>(TestSuite.java:132)
> at junit.framework.TestSuite.addTestSuite(TestSuite.java:219)
> at org.bouncycastle.mail.smime.test.AllTests.suite(AllTests.java:25)
>
> Is there any special setup needed prior running the tests?
>
> - Florian
>
> 1: https://github.com/xvik/gradle-animalsniffer-plugin
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Check Android compatibility using AnimalSniffer

David Hook-3

Travis came up quite a while ago. When use of Travis was first suggested
it wasn't actually practical due to the code signing... but now:

https://www.travis-ci.org/bcgit

Yes, I think the patch is of interest as well. We'll take a look.

Thanks,

David

On 05/05/18 00:07, Hohwiller, Jörg wrote:

> Hi Florian,
>
> I am also new here but looks like a good and reasonable improvement.
> Thanks for your support.
>
> After your observation with the JUnits I would also like to discuss if
> travis (travis-ci.org) should be enabled for the repo. This would add
> a free CI service that perfectly integrates with github. As a result
> you can add a build status batch logo to the Readme.md and will also
> get automatic build status feedback for every PR so before merging you
> will already know if the build will succeed.
>
> I am using this in arbitrary of my OSS projects:
>
> See e.g. here: https://github.com/m-m-m/util/#mmm-util
>
> All you need to do is add a travis.yml config file:
>
> https://github.com/m-m-m/util/blob/master/.travis.yml
>
> And then you need to enable the repo on travis once.
>
> I am happy to assist if the legion is interested...
>
> Cheers
>
>   Jörg
>
>
> Am 04.05.2018 um 15:00 schrieb Florian Schmaus:
>> Would the legion be interested in a little patch that introduces Android
>> compatibility verification to the test suite?
>>
>> I've created a GitHub pull request at
>>
>> https://github.com/bcgit/bc-java/pull/336
>>
>> which adds the AninimalSniffer [1] Gradle plugin to the Gradle build
>> process and activates Android 8 compatibility verification for all
>> subprojects.
>>
>> I know that Bouncycastle is used a lot on Android (OpenKeychain, …) and
>> I'm mentoring a GSOC project which will use Bouncycastle on Android too.
>> Therefore it appears to be a good idea to check for Android
>> compatibility to avoid runtime errors because of linkage errors.
>>
>> Since this is my first contribution to the Bouncycastle project, I'm
>> happy to hear your thoughts on this matter.
>>
>> As a related side note: After cloning Bouncycastle, issuing "gradle
>> check" does not succeed as the S/MIME junit tests fail. I think the root
>> cause is
>>
>> java.lang.NoClassDefFoundError: Could not initialize class
>> org.bouncycastle.mail.smime.test.NewSMIMESignedTest
>>     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>>     at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>>
>>     at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>>
>>     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
>>     at junit.framework.TestSuite.createTest(TestSuite.java:68)
>>     at junit.framework.TestSuite.addTestMethod(TestSuite.java:310)
>>     at
>> junit.framework.TestSuite.addTestsFromTestCase(TestSuite.java:153)
>>     at junit.framework.TestSuite.<init>(TestSuite.java:132)
>>     at junit.framework.TestSuite.addTestSuite(TestSuite.java:219)
>>     at org.bouncycastle.mail.smime.test.AllTests.suite(AllTests.java:25)
>>
>> Is there any special setup needed prior running the tests?
>>
>> - Florian
>>
>> 1: https://github.com/xvik/gradle-animalsniffer-plugin
>>
>>
>>
>
>
>