OLD | NEW |
(Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import("//build/config/android/rules.gni") |
| 6 import("config.gni") |
| 7 |
| 8 java_group("leakcanary_java") { |
| 9 if (enable_leakcanary) { |
| 10 deps = [ |
| 11 ":leakcanary_impl_java", |
| 12 ] |
| 13 } else { |
| 14 deps = [ |
| 15 ":leakcanary_noop_java", |
| 16 ] |
| 17 } |
| 18 } |
| 19 |
| 20 android_library("leakcanary_noop_java") { |
| 21 java_files = [ |
| 22 "src/leakcanary-android-no-op/src/main/java/com/squareup/leakcanary/LeakCana
ry.java", |
| 23 "src/leakcanary-android-no-op/src/main/java/com/squareup/leakcanary/RefWatch
er.java", |
| 24 ] |
| 25 } |
| 26 |
| 27 _wanted_resource_files = [ |
| 28 "src/leakcanary-android/src/main/res/drawable-xxxhdpi-v11/leak_canary_notifica
tion.png", |
| 29 "src/leakcanary-android/src/main/res/drawable-xxhdpi-v11/leak_canary_notificat
ion.png", |
| 30 "src/leakcanary-android/src/main/res/drawable-xhdpi/leak_canary_notification.p
ng", |
| 31 "src/leakcanary-android/src/main/res/drawable-xhdpi/leak_canary_icon.png", |
| 32 "src/leakcanary-android/src/main/res/drawable-mdpi-v11/leak_canary_notificatio
n.png", |
| 33 "src/leakcanary-android/src/main/res/drawable-xxxhdpi/leak_canary_notification
.png", |
| 34 "src/leakcanary-android/src/main/res/drawable-xxxhdpi/leak_canary_icon.png", |
| 35 "src/leakcanary-android/src/main/res/drawable-hdpi/leak_canary_notification.pn
g", |
| 36 "src/leakcanary-android/src/main/res/drawable-hdpi/leak_canary_icon.png", |
| 37 "src/leakcanary-android/src/main/res/drawable-hdpi-v11/leak_canary_notificatio
n.png", |
| 38 "src/leakcanary-android/src/main/res/values/leak_canary_themes.xml", |
| 39 "src/leakcanary-android/src/main/res/values/leak_canary_int.xml", |
| 40 "src/leakcanary-android/src/main/res/values/leak_canary_strings.xml", |
| 41 "src/leakcanary-android/src/main/res/drawable/leak_canary_toast_background.xml
", |
| 42 "src/leakcanary-android/src/main/res/drawable-xxhdpi/leak_canary_notification.
png", |
| 43 "src/leakcanary-android/src/main/res/drawable-xxhdpi/leak_canary_icon.png", |
| 44 "src/leakcanary-android/src/main/res/drawable-xhdpi-v11/leak_canary_notificati
on.png", |
| 45 "src/leakcanary-android/src/main/res/drawable-mdpi/leak_canary_notification.pn
g", |
| 46 "src/leakcanary-android/src/main/res/drawable-mdpi/leak_canary_icon.png", |
| 47 "src/leakcanary-android/src/main/res/values-v21/leak_canary_themes.xml", |
| 48 "src/leakcanary-android/src/main/res/layout/leak_canary_leak_row.xml", |
| 49 "src/leakcanary-android/src/main/res/layout/leak_canary_heap_dump_toast.xml", |
| 50 "src/leakcanary-android/src/main/res/layout/leak_canary_display_leak.xml", |
| 51 "src/leakcanary-android/src/main/res/layout/leak_canary_ref_top_row.xml", |
| 52 "src/leakcanary-android/src/main/res/layout/leak_canary_ref_row.xml", |
| 53 "src/leakcanary-android/src/main/res/values-v14/leak_canary_themes.xml", |
| 54 ] |
| 55 |
| 56 # This is required to remove: |
| 57 # "src/leakcanary-android/src/main/res/values/leak_canary_public.xml", |
| 58 # which is meant for .aar, and breaks aapt normally. |
| 59 copy("leakcanary_resources_copy") { |
| 60 sources = _wanted_resource_files |
| 61 outputs = [ |
| 62 "$target_gen_dir/copied-resources/{{source}}", |
| 63 ] |
| 64 } |
| 65 |
| 66 android_resources("leakcanary_resources") { |
| 67 custom_package = "com.squareup.leakcanary" |
| 68 resource_dirs = [] |
| 69 generated_resource_dirs = [ "$target_gen_dir/copied-resources/third_party/leak
canary/src/leakcanary-android/src/main/res" ] |
| 70 generated_resource_files = |
| 71 process_file_template(_wanted_resource_files, |
| 72 [ "$target_gen_dir/copied-resources/{{source}}" ]) |
| 73 deps = [ |
| 74 ":leakcanary_resources_copy", |
| 75 ] |
| 76 } |
| 77 |
| 78 android_library("leakcanary_impl_java") { |
| 79 chromium_code = false |
| 80 java_files = [ |
| 81 "leakcanary-android-build-config/com/squareup/leakcanary/BuildConfig.java", |
| 82 "src/leakcanary-analyzer/src/main/java/com/squareup/haha/perflib/HahaSpy.jav
a", |
| 83 "src/leakcanary-analyzer/src/main/java/com/squareup/leakcanary/AnalysisResul
t.java", |
| 84 "src/leakcanary-analyzer/src/main/java/com/squareup/leakcanary/HahaHelper.ja
va", |
| 85 "src/leakcanary-analyzer/src/main/java/com/squareup/leakcanary/HeapAnalyzer.
java", |
| 86 "src/leakcanary-analyzer/src/main/java/com/squareup/leakcanary/LeakNode.java
", |
| 87 "src/leakcanary-analyzer/src/main/java/com/squareup/leakcanary/LeakTraceElem
ent.java", |
| 88 "src/leakcanary-analyzer/src/main/java/com/squareup/leakcanary/LeakTrace.jav
a", |
| 89 "src/leakcanary-analyzer/src/main/java/com/squareup/leakcanary/ShortestPathF
inder.java", |
| 90 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/AbstractAnalys
isResultService.java", |
| 91 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/ActivityRefWat
cher.java", |
| 92 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/AndroidDebugge
rControl.java", |
| 93 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/AndroidExclude
dRefs.java", |
| 94 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/AndroidHeapDum
per.java", |
| 95 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/AndroidWatchEx
ecutor.java", |
| 96 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/CanaryLog.java
", |
| 97 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/DefaultLeakDir
ectoryProvider.java", |
| 98 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/DisplayLeakSer
vice.java", |
| 99 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/internal/Displ
ayLeakActivity.java", |
| 100 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/internal/Displ
ayLeakAdapter.java", |
| 101 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/internal/Displ
ayLeakConnectorView.java", |
| 102 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/internal/Futur
eResult.java", |
| 103 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/internal/HeapA
nalyzerService.java", |
| 104 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/internal/LeakC
anaryInternals.java", |
| 105 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/internal/LeakC
anarySingleThreadFactory.java", |
| 106 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/internal/LeakC
anaryUi.java", |
| 107 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/internal/MoreD
etailsView.java", |
| 108 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/internal/Reque
stStoragePermissionActivity.java", |
| 109 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/LeakCanary.jav
a", |
| 110 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/LeakDirectoryP
rovider.java", |
| 111 "src/leakcanary-android/src/main/java/com/squareup/leakcanary/ServiceHeapDum
pListener.java", |
| 112 "src/leakcanary-watcher/src/main/java/com/squareup/leakcanary/DebuggerContro
l.java", |
| 113 "src/leakcanary-watcher/src/main/java/com/squareup/leakcanary/ExcludedRefs.j
ava", |
| 114 "src/leakcanary-watcher/src/main/java/com/squareup/leakcanary/Exclusion.java
", |
| 115 "src/leakcanary-watcher/src/main/java/com/squareup/leakcanary/GcTrigger.java
", |
| 116 "src/leakcanary-watcher/src/main/java/com/squareup/leakcanary/HeapDumper.jav
a", |
| 117 "src/leakcanary-watcher/src/main/java/com/squareup/leakcanary/HeapDump.java"
, |
| 118 "src/leakcanary-watcher/src/main/java/com/squareup/leakcanary/KeyedWeakRefer
ence.java", |
| 119 "src/leakcanary-watcher/src/main/java/com/squareup/leakcanary/Preconditions.
java", |
| 120 "src/leakcanary-watcher/src/main/java/com/squareup/leakcanary/RefWatcher.jav
a", |
| 121 ] |
| 122 deps = [ |
| 123 ":leakcanary_resources", |
| 124 "//third_party/haha", |
| 125 ] |
| 126 } |
OLD | NEW |