From 2e26bdb6698ea0295d0495a5aa5483a695ec68cd Mon Sep 17 00:00:00 2001 From: Divya Amaravathy Date: Mon, 22 Apr 2024 20:48:45 -0700 Subject: Set skeleton for LeakCanary supporting library Follow the setup of adblib. Bug: 336417209 Test: N/A Change-Id: If3f8571a63aa2f6542a29193cc88721c0f721ef6 --- leakcanarylib/BUILD | 14 +++++++++++ leakcanarylib/OWNERS | 1 + leakcanarylib/README.md | 6 +++++ leakcanarylib/android.sdktools.leakcanarylib.iml | 13 +++++++++++ .../android/leakcanarylib/LeakCanarySerializer.kt | 27 ++++++++++++++++++++++ 5 files changed, 61 insertions(+) create mode 100644 leakcanarylib/BUILD create mode 100644 leakcanarylib/OWNERS create mode 100644 leakcanarylib/README.md create mode 100644 leakcanarylib/android.sdktools.leakcanarylib.iml create mode 100644 leakcanarylib/src/com/android/leakcanarylib/LeakCanarySerializer.kt diff --git a/leakcanarylib/BUILD b/leakcanarylib/BUILD new file mode 100644 index 0000000000..2e665d22f7 --- /dev/null +++ b/leakcanarylib/BUILD @@ -0,0 +1,14 @@ +load("//tools/base/bazel:bazel.bzl", "iml_module") + +# managed by go/iml_to_build +iml_module( + name = "studio.android.sdktools.leakcanarylib", + srcs = ["src"], + iml_files = ["android.sdktools.leakcanarylib.iml"], + visibility = ["//visibility:public"], + # do not sort: must match IML order + deps = [ + "@intellij//:intellij-sdk", + "@intellij//:com.intellij.java", + ], +) diff --git a/leakcanarylib/OWNERS b/leakcanarylib/OWNERS new file mode 100644 index 0000000000..7215bec3ce --- /dev/null +++ b/leakcanarylib/OWNERS @@ -0,0 +1 @@ +include platform/tools/base:/owners/profilers_OWNERS \ No newline at end of file diff --git a/leakcanarylib/README.md b/leakcanarylib/README.md new file mode 100644 index 0000000000..9e7943afee --- /dev/null +++ b/leakcanarylib/README.md @@ -0,0 +1,6 @@ +# Overview + +The `leakcanarylib` is the interface between Android Studio and the +LeakCanary memory leak detection tool (https://square.github.io/leakcanary/). +This Kotlin-based library facilitates integration and streamlines the process +of identifying and addressing memory leaks in Android applications. diff --git a/leakcanarylib/android.sdktools.leakcanarylib.iml b/leakcanarylib/android.sdktools.leakcanarylib.iml new file mode 100644 index 0000000000..a0d3a1016e --- /dev/null +++ b/leakcanarylib/android.sdktools.leakcanarylib.iml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/leakcanarylib/src/com/android/leakcanarylib/LeakCanarySerializer.kt b/leakcanarylib/src/com/android/leakcanarylib/LeakCanarySerializer.kt new file mode 100644 index 0000000000..c3d1ded9e8 --- /dev/null +++ b/leakcanarylib/src/com/android/leakcanarylib/LeakCanarySerializer.kt @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.leakcanarylib + +class LeakCanarySerializer { + var logcatMessage: String = "" + + /** Test function **/ + fun test(logcatMessage: String): String { + return logcatMessage + } +} + -- cgit v1.2.3