diff --git a/android/build.gradle b/android/build.gradle index 67b841d41..4f7f1a1cc 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -64,7 +64,6 @@ android { implementation deps.jsr305 implementation deps.supportAppCompat implementation deps.stetho - compileOnly deps.leakcanary testImplementation deps.mockito testImplementation deps.robolectric diff --git a/android/plugins/leakcanary/build.gradle b/android/plugins/leakcanary/build.gradle new file mode 100644 index 000000000..b284bf071 --- /dev/null +++ b/android/plugins/leakcanary/build.gradle @@ -0,0 +1,27 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. + */ + +apply plugin: 'com.android.library' +apply plugin: 'maven' + +android { + compileSdkVersion rootProject.compileSdkVersion + buildToolsVersion rootProject.buildToolsVersion + + defaultConfig { + minSdkVersion rootProject.minSdkVersion + targetSdkVersion rootProject.targetSdkVersion + } + + dependencies { + implementation project(':android') + implementation deps.leakcanary + compileOnly deps.jsr305 + } +} + +apply from: rootProject.file('gradle/release.gradle') diff --git a/android/plugins/leakcanary/gradle.properties b/android/plugins/leakcanary/gradle.properties new file mode 100644 index 000000000..864d74e0e --- /dev/null +++ b/android/plugins/leakcanary/gradle.properties @@ -0,0 +1,12 @@ +# +# Copyright (c) Facebook, Inc. and its affiliates. +# +# This source code is licensed under the MIT license found in the LICENSE +# file in the root directory of this source tree. +# + +POM_NAME=Flipper LeakCanary Plugin +POM_DESCRIPTION=LeakCanary plugin for Flipper +POM_ARTIFACT_ID=flipper-leakcanary-plugin +POM_PACKAGING=aar + diff --git a/android/plugins/leakcanary/src/main/AndroidManifest.xml b/android/plugins/leakcanary/src/main/AndroidManifest.xml new file mode 100644 index 000000000..177d135f0 --- /dev/null +++ b/android/plugins/leakcanary/src/main/AndroidManifest.xml @@ -0,0 +1,11 @@ + + + + + diff --git a/android/src/main/java/com/facebook/flipper/plugins/leakcanary/LeakCanaryFlipperPlugin.java b/android/plugins/leakcanary/src/main/java/com/facebook/flipper/plugins/leakcanary/LeakCanaryFlipperPlugin.java similarity index 100% rename from android/src/main/java/com/facebook/flipper/plugins/leakcanary/LeakCanaryFlipperPlugin.java rename to android/plugins/leakcanary/src/main/java/com/facebook/flipper/plugins/leakcanary/LeakCanaryFlipperPlugin.java diff --git a/android/src/main/java/com/facebook/flipper/plugins/leakcanary/RecordLeakService.java b/android/plugins/leakcanary/src/main/java/com/facebook/flipper/plugins/leakcanary/RecordLeakService.java similarity index 100% rename from android/src/main/java/com/facebook/flipper/plugins/leakcanary/RecordLeakService.java rename to android/plugins/leakcanary/src/main/java/com/facebook/flipper/plugins/leakcanary/RecordLeakService.java diff --git a/android/sample/build.gradle b/android/sample/build.gradle index ede3993a0..e0ba7fc0d 100644 --- a/android/sample/build.gradle +++ b/android/sample/build.gradle @@ -70,5 +70,6 @@ dependencies { debugImplementation project(':fresco-plugin') debugImplementation project(':network-plugin') debugImplementation project(':litho-plugin') + debugImplementation project(':leakcanary-plugin') releaseImplementation project(':noop') } diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 93933e4d4..8fd52d626 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -48,6 +48,7 @@ dependencies { implementation project(':fresco-plugin') implementation project(':network-plugin') implementation project(':litho-plugin') + implementation project(':leakcanary-plugin') implementation deps.soloader // Litho diff --git a/settings.gradle b/settings.gradle index 5f76a006e..aae5b5073 100644 --- a/settings.gradle +++ b/settings.gradle @@ -39,3 +39,6 @@ project(':network-plugin').projectDir = file('android/plugins/network') include ':litho-plugin' project(':litho-plugin').projectDir = file('android/plugins/litho') + +include ':leakcanary-plugin' +project(':leakcanary-plugin').projectDir = file('android/plugins/leakcanary')