From f827ea90b0e2f26a05c69c40331da76fcb65ed74 Mon Sep 17 00:00:00 2001 From: grabbou Date: Wed, 21 Aug 2019 14:40:10 +0200 Subject: [PATCH] Revert "Remove vendored proguard annotation (#26069)" This reverts commit 35fc0add2d3a278bf90257284fe23e03898008de. --- ReactAndroid/build.gradle | 1 - .../proguard/annotations/DoNotStrip.java | 22 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 ReactAndroid/src/main/java/com/facebook/proguard/annotations/DoNotStrip.java diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle index 47f6c74a07a..1ef2f605c46 100644 --- a/ReactAndroid/build.gradle +++ b/ReactAndroid/build.gradle @@ -356,7 +356,6 @@ android { dependencies { api("com.facebook.infer.annotation:infer-annotation:0.11.2") - api("com.facebook.yoga:proguard-annotations:1.14.1") api("javax.inject:javax.inject:1") api("androidx.appcompat:appcompat:1.0.2") api("com.facebook.fresco:fresco:${FRESCO_VERSION}") diff --git a/ReactAndroid/src/main/java/com/facebook/proguard/annotations/DoNotStrip.java b/ReactAndroid/src/main/java/com/facebook/proguard/annotations/DoNotStrip.java new file mode 100644 index 00000000000..0af1b790f13 --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/proguard/annotations/DoNotStrip.java @@ -0,0 +1,22 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + *

This source code is licensed under the MIT license found in the LICENSE file in the root + * directory of this source tree. + */ +package com.facebook.proguard.annotations; + +import static java.lang.annotation.RetentionPolicy.CLASS; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * Add this annotation to a class, method, or field to instruct Proguard to not strip it out. + * + *

This is useful for methods called via reflection that could appear as unused to Proguard. + */ +@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR}) +@Retention(CLASS) +public @interface DoNotStrip {}