Split interface and jni java target

Summary:
Split the yoga buck targets from interface to actual implementation.

This is currently done without moving any files folder, since only we will make the distinction between interface<-->implementation only this buck target (and not in the litho/reactnative yoga copies).

Buck does insures that the `java-interface` is pure since it doesn't depend on any fbjni code.

Reviewed By: SidharthGuglani

Differential Revision: D17266406

fbshipit-source-id: 46aa469b74c2c3114f1d3d762c41d32cfe269f57
This commit is contained in:
Amir Shalem
2019-09-18 00:36:26 -07:00
committed by Facebook Github Bot
parent 96eb94afd0
commit e2dbff0ca6

View File

@@ -10,6 +10,12 @@ CXX_LIBRARY_WHITELIST_FOR_TESTS = CXX_LIBRARY_WHITELIST + [
yoga_cxx_lib("testutil:testutil"), yoga_cxx_lib("testutil:testutil"),
] ]
YOGA_JAVA_IMPLEMENTATION_FILES = [
"com/facebook/yoga/*JNI*.java",
"com/facebook/yoga/*Factory.java",
"com/facebook/yoga/YogaNative.java",
]
yoga_cxx_library( yoga_cxx_library(
name = "jni", name = "jni",
srcs = glob(["jni/*.cpp"]), srcs = glob(["jni/*.cpp"]),
@@ -38,9 +44,40 @@ yoga_cxx_library(
], ],
) )
yoga_java_library(
name = "java-interface",
srcs = glob(
["com/facebook/yoga/*.java"],
exclude = YOGA_JAVA_IMPLEMENTATION_FILES,
),
required_for_source_only_abi = True,
source = "1.7",
target = "1.7",
visibility = ["PUBLIC"],
deps = [
JSR_305_TARGET,
PROGRUARD_ANNOTATIONS_TARGET,
],
)
yoga_java_library(
name = "java-impl",
srcs = glob(YOGA_JAVA_IMPLEMENTATION_FILES),
required_for_source_only_abi = True,
source = "1.7",
target = "1.7",
deps = [
":java-interface",
":jni",
FBJNI_JAVA_TARGET,
JSR_305_TARGET,
PROGRUARD_ANNOTATIONS_TARGET,
SOLOADER_TARGET,
],
)
yoga_java_library( yoga_java_library(
name = "java", name = "java",
srcs = glob(["com/facebook/yoga/*.java"]),
required_for_source_only_abi = True, required_for_source_only_abi = True,
source = "1.7", source = "1.7",
target = "1.7", target = "1.7",
@@ -48,12 +85,9 @@ yoga_java_library(
yoga_dep("java:tests"), yoga_dep("java:tests"),
], ],
visibility = ["PUBLIC"], visibility = ["PUBLIC"],
deps = [ exported_deps = [
":jni", ":java-impl",
FBJNI_JAVA_TARGET, ":java-interface",
JSR_305_TARGET,
PROGRUARD_ANNOTATIONS_TARGET,
SOLOADER_TARGET,
], ],
) )