File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 108108 "GridTrackType" ,
109109 "Gutter" ,
110110 "Justify" ,
111+ "LogLevel" ,
111112}
112113
113114ENUMS_KOTLIN = {name : ENUMS [name ] for name in KOTLIN_ENUM_NAMES }
@@ -307,6 +308,9 @@ def to_hyphenated_lower(symbol):
307308 with open (root + "/java/com/facebook/yoga/Yoga%s.kt" % name , "w" ) as f :
308309 f .write (get_license ("kotlin" ))
309310 f .write ("package com.facebook.yoga\n \n " )
311+ if name in DO_NOT_STRIP :
312+ f .write ("import com.facebook.yoga.annotations.DoNotStrip\n \n " )
313+ f .write ("@DoNotStrip\n " )
310314 f .write ("public enum class Yoga%s(public val intValue: Int) {\n " % name )
311315 if len (values ) > 0 :
312316 for value in values :
@@ -324,6 +328,8 @@ def to_hyphenated_lower(symbol):
324328 f .write (" public fun intValue(): Int = intValue\n " )
325329 f .write ("\n " )
326330 f .write (" public companion object {\n " )
331+ if name in DO_NOT_STRIP :
332+ f .write (" @DoNotStrip\n " )
327333 f .write (" @JvmStatic\n " )
328334 f .write (" public fun fromInt(value: Int): Yoga%s =\n " % name )
329335 f .write (" when (value) {\n " )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3+ *
4+ * This source code is licensed under the MIT license found in the
5+ * LICENSE file in the root directory of this source tree.
6+ */
7+
8+ // @generated by enums.py
9+
10+ package com.facebook.yoga
11+
12+ import com.facebook.yoga.annotations.DoNotStrip
13+
14+ @DoNotStrip
15+ public enum class YogaLogLevel (public val intValue : Int ) {
16+ ERROR (0 ),
17+ WARN (1 ),
18+ INFO (2 ),
19+ DEBUG (3 ),
20+ VERBOSE (4 ),
21+ FATAL (5 );
22+
23+ public fun intValue (): Int = intValue
24+
25+ public companion object {
26+ @DoNotStrip
27+ @JvmStatic
28+ public fun fromInt (value : Int ): YogaLogLevel =
29+ when (value) {
30+ 0 -> ERROR
31+ 1 -> WARN
32+ 2 -> INFO
33+ 3 -> DEBUG
34+ 4 -> VERBOSE
35+ 5 -> FATAL
36+ else -> throw IllegalArgumentException (" Unknown enum value: $value " )
37+ }
38+ }
39+ }
You can’t perform that action at this time.
0 commit comments