Summary: X-link: https://github.com/facebook/react-native/pull/35841 X-link: https://github.com/facebook/litho/pull/928 Pull Request resolved: https://github.com/facebook/yoga/pull/1216 The Yoga JNI bindings use Reflection, so we need to let ProGuard know not to strip certain annotated fields. This is done internally using a single copy of `com.facebook.proguard.annotations` from fbandroid (sometimes), which is then repackaged externally, and published as its own whole Yoga specific package. We never actually inform the stock Gradle project of the rules for the annotations though, so apps must add these manually. This simplifies the setup, where Yoga has its own self-contained annotations/rules. The rules are exposed for Gradle/Buck dependencies, but RN and Litho both consume Yoga via dirsync + custom Gradle logic, so we need to duplicate the proguard rules to them instead of them being propagated automatically. Changelog: [Internal] Reviewed By: rshest Differential Revision: D42406641 fbshipit-source-id: c2b12fd498f93f144e5651917ca878d2a5050e08
46 lines
903 B
Java
46 lines
903 B
Java
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
// @generated by enums.py
|
|
|
|
package com.facebook.yoga;
|
|
|
|
import com.facebook.yoga.annotations.DoNotStrip;
|
|
|
|
@DoNotStrip
|
|
public enum YogaLogLevel {
|
|
ERROR(0),
|
|
WARN(1),
|
|
INFO(2),
|
|
DEBUG(3),
|
|
VERBOSE(4),
|
|
FATAL(5);
|
|
|
|
private final int mIntValue;
|
|
|
|
YogaLogLevel(int intValue) {
|
|
mIntValue = intValue;
|
|
}
|
|
|
|
public int intValue() {
|
|
return mIntValue;
|
|
}
|
|
|
|
@DoNotStrip
|
|
public static YogaLogLevel fromInt(int value) {
|
|
switch (value) {
|
|
case 0: return ERROR;
|
|
case 1: return WARN;
|
|
case 2: return INFO;
|
|
case 3: return DEBUG;
|
|
case 4: return VERBOSE;
|
|
case 5: return FATAL;
|
|
default: throw new IllegalArgumentException("Unknown enum value: " + value);
|
|
}
|
|
}
|
|
}
|