diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f3f1f069e..156ff1bf64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,30 @@ # Change Log +## Version 1.3.2-SNAPSHOT +No change yet. -## Version 1.3.1-SNAPSHOT +### Dependencies + +```gradle + dependencies { + debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.2-SNAPSHOT' + releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.2-SNAPSHOT' + } +``` + +Snapshots are available in Sonatype's `snapshots` repository: + +``` + repositories { + mavenCentral() + maven { + url 'https://oss.sonatype.org/content/repositories/snapshots/' + } + } +``` + +## Version 1.3.1 *(2015-05-16)* * Heap dumps and analysis results are now saved on the sd card: [#21](https://github.com/square/leakcanary/issues/21). * `ExcludedRef` and `AndroidExcludedRefs` are customizable: [#12](https://github.com/square/leakcanary/issues/12) [#73](https://github.com/square/leakcanary/issues/73). @@ -32,22 +54,11 @@ ```gradle dependencies { - debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1-SNAPSHOT' - releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1-SNAPSHOT' + debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1' + releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1' } ``` -Snapshots are available in Sonatype's `snapshots` repository: - -``` - repositories { - mavenCentral() - maven { - url 'https://oss.sonatype.org/content/repositories/snapshots/' - } - } -``` - ## Version 1.3 *(2015-05-08)* Initial release. diff --git a/README.md b/README.md index 4edd121f0e..71db3d0188 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ In your `build.gradle`: ```gradle dependencies { - debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3' - releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3' + debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1' + releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1' } ``` @@ -219,7 +219,7 @@ Build a custom `RefWatcher` in your debug Application class: ```java public class DebugExampleApplication extends ExampleApplication { protected RefWatcher installLeakCanary() { - return LeakCanary.install(app, LeakUploadService.class); + return LeakCanary.install(app, LeakUploadService.class, AndroidExcludedRefs.createAppDefaults().build()); } } ``` @@ -239,6 +239,21 @@ Don't forget to register the service in your debug manifest: You can also upload the leak traces to Slack or HipChat, [here's an example](https://gist.github.com/pyricau/06c2c486d24f5f85f7f0). +### Ignoring specific references + +You can create your own version of `ExcludedRefs` to ignore specific references that you know are causing leaks but you still want to ignore: + +```java +public class DebugExampleApplication extends ExampleApplication { + protected RefWatcher installLeakCanary() { + ExcludedRefs excludedRefs = AndroidExcludedRefs.createAndroidDefaults() + .instanceField("com.example.ExampleClass", "exampleField") + .build(); + return LeakCanary.install(this, DisplayLeakService.class, excludedRefs); + } +} +``` + ## Snapshots of the development version See the [CHANGELOG](https://github.com/square/leakcanary/blob/master/CHANGELOG.md). diff --git a/library/build.gradle b/library/build.gradle index fd82c9a905..83d76ef7e7 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -26,7 +26,7 @@ ext { javaVersion = JavaVersion.VERSION_1_7 GROUP = 'com.squareup.leakcanary' - VERSION_NAME = "1.3.1-SNAPSHOT" + VERSION_NAME = "1.3.1" POM_PACKAGING = "pom" POM_DESCRIPTION= "Leak Canary" diff --git a/library/leakcanary-sample/src/main/java/com/example/leakcanary/ExampleApplication.java b/library/leakcanary-sample/src/main/java/com/example/leakcanary/ExampleApplication.java index 942be7762b..3303a31808 100644 --- a/library/leakcanary-sample/src/main/java/com/example/leakcanary/ExampleApplication.java +++ b/library/leakcanary-sample/src/main/java/com/example/leakcanary/ExampleApplication.java @@ -17,6 +17,9 @@ import android.app.Application; import android.os.StrictMode; +import com.squareup.leakcanary.AndroidExcludedRefs; +import com.squareup.leakcanary.DisplayLeakService; +import com.squareup.leakcanary.ExcludedRefs; import com.squareup.leakcanary.LeakCanary; import static android.os.Build.VERSION.SDK_INT; @@ -27,7 +30,10 @@ public class ExampleApplication extends Application { @Override public void onCreate() { super.onCreate(); enabledStrictMode(); - LeakCanary.install(this); + ExcludedRefs excludedRefs = AndroidExcludedRefs.createAndroidDefaults() + .instanceField("com.example.ExampleClass", "exampleField") + .build(); + LeakCanary.install(this, DisplayLeakService.class, excludedRefs); } private void enabledStrictMode() {