From e2a60bd61aa13015cb4cfd7ae2fa9b904a1ab644 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Ricau Date: Tue, 12 May 2015 18:54:27 -0700 Subject: [PATCH] Lighter no-op dependency --- library/leakcanary-android-no-op/build.gradle | 1 - .../com/squareup/leakcanary/RefWatcher.java | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 library/leakcanary-android-no-op/src/main/java/com/squareup/leakcanary/RefWatcher.java diff --git a/library/leakcanary-android-no-op/build.gradle b/library/leakcanary-android-no-op/build.gradle index b14f58075d..5f3dc02538 100644 --- a/library/leakcanary-android-no-op/build.gradle +++ b/library/leakcanary-android-no-op/build.gradle @@ -14,7 +14,6 @@ repositories { } dependencies { - compile project(':leakcanary-watcher') } android { diff --git a/library/leakcanary-android-no-op/src/main/java/com/squareup/leakcanary/RefWatcher.java b/library/leakcanary-android-no-op/src/main/java/com/squareup/leakcanary/RefWatcher.java new file mode 100644 index 0000000000..ca9f660202 --- /dev/null +++ b/library/leakcanary-android-no-op/src/main/java/com/squareup/leakcanary/RefWatcher.java @@ -0,0 +1,19 @@ +package com.squareup.leakcanary; + +/** + * No-op implementation of {@link RefWatcher} for release builds. Please use {@link + * RefWatcher#DISABLED}. + */ +public final class RefWatcher { + + public static final RefWatcher DISABLED = new RefWatcher(); + + private RefWatcher() { + } + + public void watch(Object watchedReference) { + } + + public void watch(Object watchedReference, String referenceName) { + } +}