Import library only for debugging

Viewed 1619

I am using stetho lib for debugging my app.

Gradle:

debugCompile 'com.facebook.stetho:stetho:1.4.1'
debugCompile 'com.uphyca:stetho_realm:2.0.0'

Application class:

if (BuildConfig.DEBUG) {
    Stetho.initialize(..);
}

But if I need to create a release version I must comment every time:

import com.facebook.stetho.Stetho; 
import com.uphyca.stetho_realm.RealmInspectorModulesProvider;

How to show the compiler that these libs only for debugging? Can we comment on two lines without creating an additional class, using annotations or something like this?

1 Answers
Related