Bug 1155331 - Add ReflectionTarget annotation. r=nalexander

This is a clone of @JNITarget and @RobocopTarget.

--HG--
extra : commitid : AhiQ1OmtCY0
extra : rebase_source : 6fb3880e2368a163292b968084991ca965a12211
extra : source : 62dbceeb9f18238ed2725564db03a2a2c6491f94
This commit is contained in:
Michael Comella 2015-04-16 10:10:25 -07:00
Родитель fd261e57b4
Коммит acac98ee7c
3 изменённых файлов: 35 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,18 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/*
* Used to indicate to ProGuard that this definition is accessed
* via reflection and should not be stripped from the source.
*/
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD})
@Retention(RetentionPolicy.CLASS)
public @interface ReflectionTarget {}

Просмотреть файл

@ -15,6 +15,7 @@ constants_jar = add_java_jar('constants')
constants_jar.sources = [
'adjust/AdjustHelperInterface.java',
'annotation/JNITarget.java',
'annotation/ReflectionTarget.java',
'annotation/RobocopTarget.java',
'annotation/WebRTCJNITarget.java',
'annotation/WrapForJNI.java',

Просмотреть файл

@ -162,6 +162,22 @@
@org.mozilla.gecko.annotation.RobocopTarget <fields>;
}
# keep Reflection targets
-keep @interface org.mozilla.gecko.annotation.ReflectionTarget
-keep @org.mozilla.gecko.annotation.ReflectionTarget class *
-keepclassmembers class * {
@org.mozilla.gecko.annotation.ReflectionTarget *;
}
-keepclassmembers @org.mozilla.gecko.annotation.ReflectionTarget class * {
*;
}
-keepclasseswithmembers class * {
@org.mozilla.gecko.annotation.ReflectionTarget <methods>;
}
-keepclasseswithmembers class * {
@org.mozilla.gecko.annotation.ReflectionTarget <fields>;
}
# Keep WebRTC targets.
-keep @interface org.mozilla.gecko.annotation.WebRTCJNITarget
-keep @org.mozilla.gecko.annotation.WebRTCJNITarget class *