square / radiography

Text-ray goggles for your Android UI.
Apache License 2.0
851 stars 35 forks source link

Support publish no-op libraries #158

Closed Goooler closed 9 months ago

Goooler commented 10 months ago

Now we are integrating this lib like

dependencies {
  implementation 'com.squareup.radiography:radiography:2.5'
}
  val graph = Radiography.scan()
  Log.d("CustomActivity", "Radiography: $graph")

Usually, it's unnecessary to print this graph on release builds, if we can provide no-op libs like what Chucker did, that might be awesome.

dependencies {
  debugImplementation "com.squareup.radiography:radiography:2.5"
  releaseImplementation "com.squareup.radiography:radiography-no-op:2.5"
}
pyricau commented 9 months ago

If you only use this for debug, I would recommend isolating the related sources in a debug folder, it should be fairly easy to do these days. My experience with no-op libraries is that they make maintenance super painful as they tend to expose the entire API as a no-op.