summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authorMark Wei <markwei@google.com>2013-10-30 16:02:02 -0700
committerMark Wei <markwei@google.com>2013-10-30 16:08:30 -0700
commit144b2addf23646c813252995dfbc6e8c398df925 (patch)
tree2b8811cb9e6681611c21974e8b5534349982d661 /sample
parent46616414f6dabb6d57b0ac433a5fabe2abb8b5a9 (diff)
downloadbitmap-144b2addf23646c813252995dfbc6e8c398df925.tar.gz
Make the bitmap sample app buildable in git.
The proguard config file causes proguard to fail on the analysis step when building with blaze in google3, proguard 4.9 It does not cause proguard to fail when building in git, proguard 4.4 Bug: 11437985 Change-Id: I67b2fd749c54ae8f5c5fda0dd7742a0f88918685
Diffstat (limited to 'sample')
-rw-r--r--sample/Android.mk22
-rw-r--r--sample/BUILD41
-rw-r--r--sample/proguard-config.pro31
3 files changed, 90 insertions, 4 deletions
diff --git a/sample/Android.mk b/sample/Android.mk
index a861182..8d3f786 100644
--- a/sample/Android.mk
+++ b/sample/Android.mk
@@ -15,14 +15,28 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
-LOCAL_MODULE := com-example-bitmapcache
+bitmap_dir := ..//res
+res_dirs := $(bitmap_dir) res
-LOCAL_SDK_VERSION := 16
+LOCAL_PACKAGE_NAME := bitmapcache-sample
+
+LOCAL_STATIC_JAVA_LIBRARIES += android-opt-bitmap
+
+LOCAL_SDK_VERSION := 18
LOCAL_SRC_FILES := \
$(call all-java-files-under, src) \
$(call all-logtags-files-under, src)
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
+LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dirs)) $(LOCAL_PATH)/res
+LOCAL_AAPT_FLAGS := --auto-add-overlay
+LOCAL_AAPT_FLAGS += --extra-packages com.android.bitmap
+
+LOCAL_PROGUARD_FLAG_FILES := proguard-config.pro
+
+include $(BUILD_PACKAGE)
+
+##################################################
+# Build all sub-directories
-include $(BUILD_STATIC_JAVA_LIBRARY)
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/sample/BUILD b/sample/BUILD
new file mode 100644
index 0000000..13931e6
--- /dev/null
+++ b/sample/BUILD
@@ -0,0 +1,41 @@
+package(
+ default_visibility = [
+ "//java/com/google/android/apps/bigtop:__subpackages__",
+ ],
+)
+
+android_manifest_merge(
+ name = "merged_manifest",
+ srcs = ["AndroidManifest.xml"],
+ deps = [
+ "//java/com/google/android/apps/bigtop/third_party/bitmap:AndroidManifest.xml",
+ ],
+)
+
+android_resources(
+ name = "resources",
+ custom_package = "com.example.bitmapsample",
+ inline_constants = 0,
+ manifest = ":merged_manifest",
+ resources = glob(["res/**"]) + [
+ "//java/com/google/android/apps/bigtop/third_party/bitmap:resource_files",
+ ],
+ resources_dir = "res",
+ visibility = ["//visibility:private"],
+)
+
+exports_files([
+ "proguard-config.pro",
+])
+
+android_binary(
+ name = "bitmap_sample",
+ srcs = glob(["src/**/*.java"]) + [":resources"],
+ proguard_specs = [
+ ":proguard-config.pro",
+ ],
+ resources = ":resources",
+ deps = [
+ "//java/com/google/android/apps/bigtop/third_party/bitmap",
+ ],
+)
diff --git a/sample/proguard-config.pro b/sample/proguard-config.pro
new file mode 100644
index 0000000..5ad6bf4
--- /dev/null
+++ b/sample/proguard-config.pro
@@ -0,0 +1,31 @@
+-dontnote
+-dontwarn
+-dontobfuscate
+-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*,!code/allocation/variable
+-optimizationpasses 5
+-allowaccessmodification
+-dontpreverify
+
+-keep public class * extends android.app.Activity
+-keep public class * extends android.support.v4.app.Fragment
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+
+-keep interface android.util.AttributeSet
+
+-keep public class * extends android.view.View {
+ public <init>(android.content.Context, android.util.AttributeSet);
+ public <init>(android.content.Context, android.util.AttributeSet, int);
+ void set*(***);
+ *** get*();
+}
+
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet, int);
+}