Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable ui component by default, enable it at BlockCanary.install() #45

Merged
merged 1 commit into from
Apr 14, 2016
Merged

Conversation

Piasy
Copy link
Contributor

@Piasy Piasy commented Apr 14, 2016

  1. move blockcanary-ui into blockcanary-android;
  2. then we could disable ui component by default, enable it at BlockCanary.install();
  3. this feature let us compile blockcanary-android into release build but not showing BlockActivity, because in some case, we could not use debugCompile and releaseCompile at the same time;
  4. rename blockcanary-no-op to blockcanary-android-no-op, like LeakCanary;
  5. not depends on modules via maven, it won't affect maven publish;

2. then we could disable ui component by default, enable it at BlockCanary.install();
3. this feature let us compile blockcanary-android into release build but not showing BlockActivity, because in some case, we could not use debugCompile and releaseCompile at the same time;
4. rename blockcanary-no-op to blockcanary-android-no-op, like LeakCanary;
5. not depends on modules via maven, it won't affect maven publish;
@markzhai
Copy link
Owner

The reason I separate blockcanary-android and blockcanary-ui is to not compile UI related codes if we don't need it like in release package.

Not quite sure what do you mean by we could not use debugCompile and releaseCompile at the same time, the way to use blockcanary is various, and developer can assemble by themselves.

@Piasy
Copy link
Contributor Author

Piasy commented Apr 14, 2016

For clean release build, no-op is enough, right?

I use facebook BUCK build, and generate BUCK file automatically, my BUCK generator could not utilize the debugCompile and releaseCompile option, so I plan to ship blockcanary-android into release build, but not showing the BlockActivity entrance.

If you don't want to accept this pr, I think there are two options for me: improve my BUCK generator, or create my customized block canary build.

@markzhai
Copy link
Owner

@Piasy

    // if set true, notification will be shown, else only write log file
    @Override
    public boolean isNeedDisplay() {
        return BuildConfig.DEBUG;
    }

Have you tried to use this context configuration, this can prevent showing the BlockActivity entrance?

@Piasy
Copy link
Contributor Author

Piasy commented Apr 14, 2016

isNeedDisplay only control whether show notification, right? If we do not disable the DisplayBlockActivity component in manifest or code by default, the block icon will showed in launcher, because it's another entrance activity.

@markzhai
Copy link
Owner

@Piasy I see, maybe I removed the setComponentEnabledSetting sometime... This PR is accepted as I found separate this library into too many modules makes it hard to understand for developers.

Thanks

@markzhai markzhai merged commit 28c7184 into markzhai:master Apr 14, 2016
@Piasy
Copy link
Contributor Author

Piasy commented Apr 14, 2016

Thanks! Hope to see a new version in maven. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants