Categories
Java Kotlin

How to ignore generated Kotlin files in Jacoco?

I am using build.gradle.kts Jacoco: id(“org.barfuin.gradle.jacocolog”) version “3.1.0” Optics from Arrow library Arrow library generates __OpticsKt files that don’t have coverage in Jacoco. How to ignore them in the build.gradle.kts? Answer You need to add tasks.jacocoTestReport { block: How does it work? It seems like Jacoco uses .class files to generate coverage. Check in your […]

Categories
Android Crypto Java Kotlin

Java EC crypto with BouncyCastle

Java crypto is like an architect building a house. Architect only knows how to design a house, but needs a construction company to actually build it. In Java, only crypto interface is defined, and a provider is required to actually implement the methods. There are different providers, but one has stood out in the test […]

Categories
Architecture Java Kotlin

Callback styles for async tasks

For asynchronous tasks, the actions on completion need to be handled via a callback. There are different patterns to achieve this, with each having their own benefits and shortcomings. Interfaces One of the oldest callback styles are interfaces or anonymous classes. They are used to great effect in Android. As an example, with okhttp library, […]