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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,6 @@ local.properties

# Docusarus build
.docusaurus

# Android Studio
.idea
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
id("com.android.library") version "8.7.1" apply false
id("com.android.application") version "8.7.1" apply false
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
id 'org.jetbrains.kotlin.android' version '2.1.20' apply false
}

allprojects {
Expand Down
6 changes: 6 additions & 0 deletions java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
id("com.android.library")
id("maven-publish")
id("signing")
id("org.jetbrains.kotlin.android")
}

group = "com.facebook.yoga"
Expand Down Expand Up @@ -48,6 +49,10 @@ android {
}
}

kotlinOptions {
jvmTarget = "1.8"
}

publishing {
multipleVariants {
withSourcesJar()
Expand All @@ -60,6 +65,7 @@ android {
dependencies {
implementation("com.google.code.findbugs:jsr305:3.0.2")
implementation("com.facebook.soloader:soloader:0.10.5")
implementation("androidx.core:core-ktx:1.16.0")
testImplementation("junit:junit:4.12")
}

Expand Down
25 changes: 0 additions & 25 deletions java/com/facebook/yoga/YogaConstants.java

This file was deleted.

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

public object YogaConstants {
@JvmField public val UNDEFINED: Float = Float.NaN

@JvmStatic public fun isUndefined(value: Float): Boolean = value.compareTo(UNDEFINED) == 0

@JvmStatic public fun isUndefined(value: YogaValue): Boolean = value.unit == YogaUnit.UNDEFINED

@JvmStatic public fun getUndefined(): Float = UNDEFINED
}
Loading