October 16, 2020

23:08

Gradle is annoying me. I got an artefact that depends on another artefact which I got in three different variants (there might be more in the future):

  • coon-proto-full (2.4 Mb)
  • coon-proto-slim (555 kb)
  • coon-proto-nano (550 kb; lite runtime)

These artifacts provide protocol buffer parsers required for communicating with Google Play. Exactly one of them is required. Slim and Nano implement fewer message types (Full exceeds some resource limits on Android), but otherwise all three have the same API. The idea is that they are drop in replacements for each other. Pick and choose, the rest of the library is agnostic.

With Maven, there are optional dependencies, Gradle has this very elaborate “feature variant” concept. Really, by now, I’d be happy to simply omit those artifacts from the dependency graph, but then Gradle can’t build the APK downloader library itself.