Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
}

# Temporary filter enums to not upgrade all enums at once
KOTLIN_ENUM_NAMES = {"Direction"}
KOTLIN_ENUM_NAMES = {"Direction", "Align", "BoxSizing"}

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")
}
}
}
39 changes: 0 additions & 39 deletions java/tests/com/facebook/yoga/TestParametrization.java

This file was deleted.

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

package com.facebook.yoga

object TestParametrization {
@JvmStatic
fun nodeFactories(): Iterable<NodeFactory> {
val nodeFactory =
object : NodeFactory {
override fun create(): YogaNode = YogaNodeFactory.create()

override fun create(config: YogaConfig): YogaNode = YogaNodeFactory.create(config)

override fun toString(): String = "JNI"
}
return listOf(nodeFactory)
}

interface NodeFactory {
fun create(): YogaNode

fun create(config: YogaConfig): YogaNode
}
}
123 changes: 0 additions & 123 deletions java/tests/com/facebook/yoga/YGAlignBaselineTest.java

This file was deleted.

Loading
Loading