Skip to content
Closed
15 changes: 14 additions & 1 deletion enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,20 @@
}

# Temporary filter enums to not upgrade all enums at once
KOTLIN_ENUM_NAMES = {"Direction"}
KOTLIN_ENUM_NAMES = {
"Direction",
"Align",
"BoxSizing",
"Dimension",
"Display",
"Edge",
"Errata",
"ExperimentalFeature",
"FlexDirection",
"GridTrackType",
"Gutter",
"Justify",
}

ENUMS_KOTLIN = {name: ENUMS[name] for name in KOTLIN_ENUM_NAMES}
ENUMS_JAVA = {
Expand Down
51 changes: 0 additions & 51 deletions java/com/facebook/yoga/YogaAlign.java

This file was deleted.

45 changes: 45 additions & 0 deletions java/com/facebook/yoga/YogaAlign.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* 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

public enum class YogaAlign(public val intValue: Int) {
AUTO(0),
FLEX_START(1),
CENTER(2),
FLEX_END(3),
STRETCH(4),
BASELINE(5),
SPACE_BETWEEN(6),
SPACE_AROUND(7),
SPACE_EVENLY(8),
START(9),
END(10);

public fun intValue(): Int = intValue

public companion object {
@JvmStatic
public fun fromInt(value: Int): YogaAlign =
when (value) {
0 -> AUTO
1 -> FLEX_START
2 -> CENTER
3 -> FLEX_END
4 -> STRETCH
5 -> BASELINE
6 -> SPACE_BETWEEN
7 -> SPACE_AROUND
8 -> SPACE_EVENLY
9 -> START
10 -> END
else -> throw IllegalArgumentException("Unknown enum value: $value")
}
}
}
33 changes: 0 additions & 33 deletions java/com/facebook/yoga/YogaBoxSizing.java

This file was deleted.

27 changes: 27 additions & 0 deletions java/com/facebook/yoga/YogaBoxSizing.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* 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

public enum class YogaBoxSizing(public val intValue: Int) {
BORDER_BOX(0),
CONTENT_BOX(1);

public fun intValue(): Int = intValue

public companion object {
@JvmStatic
public fun fromInt(value: Int): YogaBoxSizing =
when (value) {
0 -> BORDER_BOX
1 -> CONTENT_BOX
else -> throw IllegalArgumentException("Unknown enum value: $value")
}
}
}
33 changes: 0 additions & 33 deletions java/com/facebook/yoga/YogaDimension.java

This file was deleted.

27 changes: 27 additions & 0 deletions java/com/facebook/yoga/YogaDimension.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* 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

public enum class YogaDimension(public val intValue: Int) {
WIDTH(0),
HEIGHT(1);

public fun intValue(): Int = intValue

public companion object {
@JvmStatic
public fun fromInt(value: Int): YogaDimension =
when (value) {
0 -> WIDTH
1 -> HEIGHT
else -> throw IllegalArgumentException("Unknown enum value: $value")
}
}
}
37 changes: 0 additions & 37 deletions java/com/facebook/yoga/YogaDisplay.java

This file was deleted.

31 changes: 31 additions & 0 deletions java/com/facebook/yoga/YogaDisplay.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* 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

public enum class YogaDisplay(public val intValue: Int) {
FLEX(0),
NONE(1),
CONTENTS(2),
GRID(3);

public fun intValue(): Int = intValue

public companion object {
@JvmStatic
public fun fromInt(value: Int): YogaDisplay =
when (value) {
0 -> FLEX
1 -> NONE
2 -> CONTENTS
3 -> GRID
else -> throw IllegalArgumentException("Unknown enum value: $value")
}
}
}
47 changes: 0 additions & 47 deletions java/com/facebook/yoga/YogaEdge.java

This file was deleted.

Loading
Loading