Discussion:
-assumenosideeffects flag in AOSP
Sriram
2012-08-14 05:30:54 UTC
Permalink
Hi All,

I am trying to compile my application along with the AOSP and have no
issues doing that. But I am unable to make use of the proguard flag
-assumenosideeffects.
I am trying to strip out the Log statements in my final build and hence
using the following in my proguard file,
-assumenosideeffects class android.util.Log {
public static *** d(...);
public static *** v(...);
}
and my Android.mk file entries look like these
LOCAL_PROGUARD_ENABLED := full
LOCAL_PROGUARD_FLAG_FILES := proguard.flags

I tried with various combinations. I made sure that the optimizations are
enabled.
It works fine if I export my package using eclipse and the log statements
are stripped.
Also just to make sure that the file is being picked up during build
process, i have some errors in proguard.flags file and it does fail
compilation.

Is there any way to make this work while compiling with AOSP?
--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/x04iPxN_aW0J.
To post to this group, send email to android-platform-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to android-platform+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
Sriram
2012-08-14 13:11:40 UTC
Permalink
Ok figured that out. Android build system adds the default proguard.flags
with every build. And that file has -dontoptimize option selected and hence
my porguard.flag file which contains the code to strip the logs does not
work.
I made a small workaround it using a custom value for
LOCAL_PROGUARD_ENABLED config param in my make file and in java.mk, handled
this value differently.

But any specific reason why this flag file is ON for all the apps.
Shouldn't it be configurable by default?
--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/NXjCXExDfe4J.
To post to this group, send email to android-platform-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to android-platform+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
Loading...