Re-sync with internal repository #1166
83
BUCK
83
BUCK
@@ -1,83 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "BASE_COMPILER_FLAGS", "GTEST_TARGET", "LIBRARY_COMPILER_FLAGS", "YOGA_ROOTS", "subdir_glob", "yoga_cxx_library", "yoga_cxx_test", "yoga_dep", "yoga_prebuilt_cxx_library")
|
||||
|
||||
GMOCK_OVERRIDE_FLAGS = [
|
||||
# gmock does not mark mocked methods as override, ignore the warnings in tests
|
||||
"-Wno-inconsistent-missing-override",
|
||||
]
|
||||
|
||||
TEST_COMPILER_FLAGS = BASE_COMPILER_FLAGS + GMOCK_OVERRIDE_FLAGS + [
|
||||
"-DDEBUG",
|
||||
"-DYG_ENABLE_EVENTS",
|
||||
]
|
||||
|
||||
yoga_prebuilt_cxx_library(
|
||||
name = "ndklog",
|
||||
exported_platform_linker_flags = [
|
||||
(
|
||||
"^android.*",
|
||||
["-llog"],
|
||||
),
|
||||
],
|
||||
header_only = True,
|
||||
visibility = YOGA_ROOTS,
|
||||
)
|
||||
|
||||
yoga_cxx_library(
|
||||
name = "yoga",
|
||||
srcs = glob(["yoga/**/*.cpp"]),
|
||||
compiler_flags = LIBRARY_COMPILER_FLAGS,
|
||||
public_include_directories = ["."],
|
||||
raw_headers = glob(["yoga/**/*.h"]),
|
||||
soname = "libyogacore.$(ext)",
|
||||
tests = [":YogaTests"],
|
||||
visibility = ["PUBLIC"],
|
||||
deps = [
|
||||
":ndklog",
|
||||
],
|
||||
)
|
||||
|
||||
yoga_cxx_library(
|
||||
name = "yoga-static",
|
||||
srcs = glob(["yoga/**/*.cpp"]),
|
||||
compiler_flags = LIBRARY_COMPILER_FLAGS,
|
||||
preferred_linkage = "static",
|
||||
public_include_directories = ["."],
|
||||
raw_headers = glob(["yoga/**/*.h"]),
|
||||
tests = [":YogaTests"],
|
||||
visibility = ["PUBLIC"],
|
||||
deps = [
|
||||
":ndklog",
|
||||
],
|
||||
)
|
||||
|
||||
yoga_cxx_library(
|
||||
name = "yogaForDebug",
|
||||
srcs = glob(["yoga/**/*.cpp"]),
|
||||
compiler_flags = TEST_COMPILER_FLAGS,
|
||||
public_include_directories = ["."],
|
||||
raw_headers = glob(["yoga/**/*.h"]),
|
||||
soname = "libyogacore.$(ext)",
|
||||
tests = [":YogaTests"],
|
||||
visibility = ["PUBLIC"],
|
||||
deps = [
|
||||
":yoga",
|
||||
],
|
||||
)
|
||||
|
||||
yoga_cxx_test(
|
||||
name = "YogaTests",
|
||||
srcs = glob(["tests/*.cpp"]),
|
||||
headers = subdir_glob([("", "yoga/**/*.h")]),
|
||||
compiler_flags = TEST_COMPILER_FLAGS,
|
||||
contacts = ["emilsj@fb.com"],
|
||||
visibility = ["PUBLIC"],
|
||||
deps = [
|
||||
":yogaForDebug",
|
||||
yoga_dep("testutil:testutil"),
|
||||
GTEST_TARGET,
|
||||
],
|
||||
)
|
74
YogaKit/BUCK
74
YogaKit/BUCK
@@ -1,74 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "subdir_glob", "yoga_apple_library", "yoga_apple_test", "yoga_dep")
|
||||
|
||||
COMPILER_FLAGS = [
|
||||
"-fobjc-arc",
|
||||
"-Wconditional-uninitialized",
|
||||
"-Wdangling-else",
|
||||
"-Wdeprecated-declarations",
|
||||
"-Wimplicit-retain-self",
|
||||
"-Wincomplete-implementation",
|
||||
"-Wobjc-method-access",
|
||||
"-Wobjc-missing-super-calls",
|
||||
"-Wmismatched-return-types",
|
||||
"-Wreturn-type",
|
||||
"-Wno-global-constructors",
|
||||
"-Wno-shadow",
|
||||
"-Wunused-const-variable",
|
||||
"-Wunused-function",
|
||||
"-Wunused-property-ivar",
|
||||
"-Wunused-result",
|
||||
"-Wunused-value",
|
||||
]
|
||||
|
||||
yoga_apple_library(
|
||||
name = "YogaKit",
|
||||
srcs = glob(["Source/**/*.m"]),
|
||||
header_namespace = "",
|
||||
exported_headers = subdir_glob(
|
||||
[
|
||||
("", "Source/**/*.h"),
|
||||
("Source", "**/*.h"),
|
||||
],
|
||||
prefix = "YogaKit",
|
||||
),
|
||||
compiler_flags = COMPILER_FLAGS,
|
||||
frameworks = [
|
||||
"$SDKROOT/System/Library/Frameworks/CoreGraphics.framework",
|
||||
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
|
||||
"$SDKROOT/System/Library/Frameworks/UIKit.framework",
|
||||
],
|
||||
header_path_prefix = "",
|
||||
labels = ["skip_module_validation"],
|
||||
link_whole = True,
|
||||
modular = True,
|
||||
module_name = "YogaKit",
|
||||
sdk_modules = [
|
||||
"CoreGraphics",
|
||||
"Foundation",
|
||||
"UIKit",
|
||||
],
|
||||
use_submodules = False,
|
||||
visibility = ["PUBLIC"],
|
||||
deps = [
|
||||
yoga_dep(":yoga"),
|
||||
],
|
||||
)
|
||||
|
||||
yoga_apple_test(
|
||||
name = "YogaKitTests",
|
||||
srcs = glob(["Tests/**/*.m"]),
|
||||
compiler_flags = COMPILER_FLAGS,
|
||||
frameworks = [
|
||||
"$PLATFORM_DIR/Developer/Library/Frameworks/XCTest.framework",
|
||||
"$SDKROOT/System/Library/Frameworks/CoreGraphics.framework",
|
||||
],
|
||||
info_plist = "Tests/Info.plist",
|
||||
visibility = ["PUBLIC"],
|
||||
deps = [
|
||||
":YogaKit",
|
||||
],
|
||||
)
|
30
android/BUCK
30
android/BUCK
@@ -1,30 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_RES_TARGET", "JAVA_TARGET", "PROGUARD_ANNOTATIONS_TARGET", "yoga_android_aar", "yoga_android_resource")
|
||||
|
||||
yoga_android_aar(
|
||||
name = "android",
|
||||
enable_relinker = True,
|
||||
manifest_skeleton = "src/main/AndroidManifest.xml",
|
||||
visibility = [
|
||||
"PUBLIC",
|
||||
],
|
||||
deps = [
|
||||
ANDROID_JAVA_TARGET,
|
||||
ANDROID_RES_TARGET,
|
||||
JAVA_TARGET,
|
||||
PROGUARD_ANNOTATIONS_TARGET,
|
||||
],
|
||||
)
|
||||
|
||||
yoga_android_resource(
|
||||
name = "res",
|
||||
package = "com.facebook.yoga.android",
|
||||
res = "src/main/res",
|
||||
visibility = [
|
||||
"PUBLIC",
|
||||
],
|
||||
)
|
@@ -1,36 +0,0 @@
|
||||
# Copyright 2014-present, Facebook, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE-examples file in the root directory of this source tree.
|
||||
|
||||
load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID_RES_TARGET", "ANDROID_SAMPLE_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "yoga_android_binary", "yoga_android_resource")
|
||||
|
||||
yoga_android_binary(
|
||||
name = "sample",
|
||||
keystore = ":debug_keystore",
|
||||
manifest = "AndroidManifest.xml",
|
||||
deps = [
|
||||
ANDROID_SAMPLE_JAVA_TARGET,
|
||||
ANDROID_SAMPLE_RES_TARGET,
|
||||
],
|
||||
)
|
||||
|
||||
yoga_android_resource(
|
||||
name = "res",
|
||||
package = "com.facebook.samples.yoga",
|
||||
res = "res",
|
||||
visibility = [
|
||||
"PUBLIC",
|
||||
],
|
||||
deps = [
|
||||
ANDROID_RES_TARGET,
|
||||
],
|
||||
)
|
||||
|
||||
fb_native.keystore(
|
||||
name = "debug_keystore",
|
||||
properties = "debug.keystore.properties",
|
||||
store = "debug.keystore",
|
||||
)
|
@@ -1,23 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE-examples file in the root directory of this source tree.
|
||||
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_SUPPORT_TARGET", "APPCOMPAT_TARGET", "SOLOADER_TARGET", "yoga_android_library")
|
||||
|
||||
yoga_android_library(
|
||||
name = "yoga",
|
||||
srcs = glob(["**/*.java"]),
|
||||
autoglob = False,
|
||||
language = "JAVA",
|
||||
visibility = [
|
||||
"PUBLIC",
|
||||
],
|
||||
deps = [
|
||||
ANDROID_JAVA_TARGET,
|
||||
ANDROID_SAMPLE_RES_TARGET,
|
||||
ANDROID_SUPPORT_TARGET,
|
||||
APPCOMPAT_TARGET,
|
||||
SOLOADER_TARGET,
|
||||
],
|
||||
)
|
@@ -1,23 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "JSR_305_TARGET", "SOLOADER_TARGET", "yoga_android_library")
|
||||
|
||||
yoga_android_library(
|
||||
name = "android",
|
||||
srcs = glob(["**/*.java"]),
|
||||
autoglob = False,
|
||||
language = "JAVA",
|
||||
visibility = [
|
||||
"PUBLIC",
|
||||
],
|
||||
deps = [
|
||||
ANDROID_RES_TARGET,
|
||||
INFER_ANNOTATIONS_TARGET,
|
||||
JAVA_TARGET,
|
||||
JSR_305_TARGET,
|
||||
SOLOADER_TARGET,
|
||||
],
|
||||
)
|
@@ -1,24 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "subdir_glob", "yoga_cxx_binary", "yoga_dep")
|
||||
|
||||
yoga_cxx_binary(
|
||||
name = "benchmark",
|
||||
srcs = glob(["*.c"]),
|
||||
headers = subdir_glob([("", "*.h")]),
|
||||
header_namespace = "",
|
||||
compiler_flags = [
|
||||
"-fno-omit-frame-pointer",
|
||||
"-fexceptions",
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
"-O3",
|
||||
"-std=c11",
|
||||
],
|
||||
visibility = ["PUBLIC"],
|
||||
deps = [
|
||||
yoga_dep(":yoga"),
|
||||
],
|
||||
)
|
42
csharp/BUCK
42
csharp/BUCK
@@ -1,42 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
|
||||
load(
|
||||
"//tools/build_defs/oss:yoga_defs.bzl",
|
||||
"BASE_COMPILER_FLAGS",
|
||||
"yoga_apple_binary",
|
||||
"yoga_cxx_library",
|
||||
"yoga_dep",
|
||||
)
|
||||
|
||||
COMPILER_FLAGS = BASE_COMPILER_FLAGS + ["-std=c++11"]
|
||||
|
||||
fb_native.csharp_library(
|
||||
name = "yogalibnet46",
|
||||
srcs = glob(["**/*.cs"]),
|
||||
dll_name = "Facebook.Yoga.dll",
|
||||
framework_ver = "net46",
|
||||
)
|
||||
|
||||
fb_native.csharp_library(
|
||||
name = "yogalibnet45",
|
||||
srcs = glob(["**/*.cs"]),
|
||||
dll_name = "Facebook.Yoga.dll",
|
||||
framework_ver = "net45",
|
||||
)
|
||||
|
||||
yoga_cxx_library(
|
||||
name = "yoganet",
|
||||
srcs = ["Yoga/YGInterop.cpp"],
|
||||
compiler_flags = COMPILER_FLAGS,
|
||||
link_style = "static",
|
||||
link_whole = True,
|
||||
soname = "libyoga.$(ext)",
|
||||
visibility = ["PUBLIC"],
|
||||
deps = [yoga_dep(":yoga")],
|
||||
)
|
||||
|
||||
yoga_apple_binary()
|
128
java/BUCK
128
java/BUCK
@@ -1,128 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID", "CXX", "CXX_LIBRARY_WHITELIST", "JNI_TARGET", "JSR_305_TARGET", "JUNIT_TARGET", "PROGUARD_ANNOTATIONS_TARGET", "SOLOADER_TARGET", "YOGA_ROOTS", "yoga_android_dep", "yoga_cxx_library", "yoga_dep", "yoga_java_binary", "yoga_java_library", "yoga_java_test", "yoga_prebuilt_cxx_library")
|
||||
|
||||
CXX_LIBRARY_WHITELIST_FOR_TESTS = CXX_LIBRARY_WHITELIST + [
|
||||
yoga_android_dep("testutil:jni"),
|
||||
yoga_android_dep("testutil:testutil-jni"),
|
||||
]
|
||||
|
||||
YOGA_JAVA_IMPLEMENTATION_FILES = [
|
||||
"com/facebook/yoga/*JNI*.java",
|
||||
"com/facebook/yoga/*Factory.java",
|
||||
"com/facebook/yoga/YogaNative.java",
|
||||
]
|
||||
|
||||
yoga_prebuilt_cxx_library(
|
||||
name = "ndklog",
|
||||
exported_platform_linker_flags = [
|
||||
(
|
||||
"^android.*",
|
||||
["-llog"],
|
||||
),
|
||||
],
|
||||
header_only = True,
|
||||
visibility = YOGA_ROOTS,
|
||||
)
|
||||
|
||||
yoga_cxx_library(
|
||||
name = "jni",
|
||||
srcs = glob(["jni/*.cpp"]),
|
||||
header_namespace = "yoga/java",
|
||||
exported_headers = glob(["jni/*.h"]),
|
||||
allow_jni_merging = True,
|
||||
compiler_flags = [
|
||||
"-fno-omit-frame-pointer",
|
||||
"-fexceptions",
|
||||
"-fvisibility=hidden",
|
||||
"-ffunction-sections",
|
||||
"-fdata-sections",
|
||||
"-fPIC",
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
"-Os",
|
||||
"-std=c++11",
|
||||
],
|
||||
platforms = (CXX, ANDROID),
|
||||
preprocessor_flags = [
|
||||
"-DFBJNI_WITH_FAST_CALLS",
|
||||
],
|
||||
soname = "libyoga.$(ext)",
|
||||
visibility = ["PUBLIC"],
|
||||
deps = [
|
||||
JNI_TARGET,
|
||||
yoga_dep(":yoga-static"),
|
||||
":ndklog",
|
||||
],
|
||||
)
|
||||
|
||||
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,
|
||||
PROGUARD_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",
|
||||
JSR_305_TARGET,
|
||||
PROGUARD_ANNOTATIONS_TARGET,
|
||||
SOLOADER_TARGET,
|
||||
],
|
||||
)
|
||||
|
||||
yoga_java_library(
|
||||
name = "java",
|
||||
required_for_source_only_abi = True,
|
||||
source = "1.7",
|
||||
target = "1.7",
|
||||
tests = [
|
||||
yoga_dep("java:tests"),
|
||||
],
|
||||
visibility = ["PUBLIC"],
|
||||
exported_deps = [
|
||||
":java-impl",
|
||||
":java-interface",
|
||||
],
|
||||
)
|
||||
|
||||
yoga_java_test(
|
||||
name = "tests",
|
||||
srcs = glob(["tests/**/*.java"]),
|
||||
contacts = ["oncall+yoga@xmail.facebook.com"],
|
||||
cxx_library_whitelist = CXX_LIBRARY_WHITELIST_FOR_TESTS,
|
||||
use_cxx_libraries = True,
|
||||
visibility = ["PUBLIC"],
|
||||
deps = [
|
||||
":java",
|
||||
yoga_dep("testutil:java"),
|
||||
JUNIT_TARGET,
|
||||
],
|
||||
)
|
||||
|
||||
yoga_java_binary(
|
||||
name = "yoga",
|
||||
visibility = ["PUBLIC"],
|
||||
deps = [
|
||||
":java",
|
||||
],
|
||||
)
|
@@ -1,15 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "yoga_java_library")
|
||||
|
||||
yoga_java_library(
|
||||
name = "annotations",
|
||||
srcs = glob(["*.java"]),
|
||||
source = "1.7",
|
||||
target = "1.7",
|
||||
visibility = ["PUBLIC"],
|
||||
deps = [],
|
||||
)
|
@@ -1,12 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "YOGA_ROOTS", "yoga_prebuilt_jar")
|
||||
|
||||
yoga_prebuilt_jar(
|
||||
name = "android-support",
|
||||
binary_jar = "android-support-v4.jar",
|
||||
visibility = YOGA_ROOTS,
|
||||
)
|
@@ -1,13 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "YOGA_ROOTS")
|
||||
|
||||
fb_native.android_prebuilt_aar(
|
||||
name = "appcompat",
|
||||
aar = "appcompat-v7-24.2.1.aar",
|
||||
visibility = YOGA_ROOTS,
|
||||
)
|
@@ -1,7 +0,0 @@
|
||||
METADATA = {
|
||||
"maintainers": [
|
||||
"yoga",
|
||||
],
|
||||
"name": "appcompat",
|
||||
"owner": "yoga",
|
||||
}
|
@@ -1,34 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "YOGA_ROOTS", "subdir_glob", "yoga_cxx_library", "yoga_prebuilt_cxx_library")
|
||||
|
||||
COMPILER_FLAGS = [
|
||||
"-std=c++14",
|
||||
"-Wno-missing-prototypes",
|
||||
]
|
||||
|
||||
yoga_prebuilt_cxx_library(
|
||||
name = "pthread",
|
||||
exported_linker_flags = [
|
||||
"-lpthread",
|
||||
],
|
||||
header_only = True,
|
||||
)
|
||||
|
||||
yoga_cxx_library(
|
||||
name = "gtest",
|
||||
srcs = glob(["googletest/googletest/src/*.cc"]),
|
||||
header_namespace = "",
|
||||
exported_headers = subdir_glob([
|
||||
("googletest/googletest/include", "**/*.h"),
|
||||
("googletest/googletest", "src/*.h"),
|
||||
("googletest/googletest", "src/*.cc"),
|
||||
]),
|
||||
compiler_flags = COMPILER_FLAGS,
|
||||
visibility = YOGA_ROOTS,
|
||||
deps = [
|
||||
":pthread",
|
||||
],
|
||||
)
|
@@ -1,19 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "YOGA_ROOTS", "yoga_java_library", "yoga_prebuilt_jar")
|
||||
|
||||
yoga_prebuilt_jar(
|
||||
name = "hamcrest-jar",
|
||||
binary_jar = "hamcrest-2.1.jar",
|
||||
)
|
||||
|
||||
yoga_java_library(
|
||||
name = "hamcrest",
|
||||
visibility = YOGA_ROOTS,
|
||||
exported_deps = [
|
||||
":hamcrest-jar",
|
||||
],
|
||||
)
|
18
lib/jni/BUCK
18
lib/jni/BUCK
@@ -1,18 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "yoga_cxx_library")
|
||||
|
||||
yoga_cxx_library(
|
||||
name = "jni",
|
||||
header_namespace = "",
|
||||
exported_headers = [
|
||||
"jni.h",
|
||||
"real/jni.h",
|
||||
],
|
||||
force_static = True,
|
||||
preprocessor_flags = ["-fmacro-backtrace-limit=0"],
|
||||
visibility = ["PUBLIC"],
|
||||
)
|
@@ -1,19 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "YOGA_ROOTS", "yoga_java_library", "yoga_prebuilt_jar")
|
||||
|
||||
yoga_prebuilt_jar(
|
||||
name = "jsr305-jar",
|
||||
binary_jar = "jsr305.jar",
|
||||
)
|
||||
|
||||
yoga_java_library(
|
||||
name = "jsr-305",
|
||||
visibility = YOGA_ROOTS,
|
||||
exported_deps = [
|
||||
":jsr305-jar",
|
||||
],
|
||||
)
|
@@ -1,19 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "YOGA_ROOTS", "yoga_java_library", "yoga_prebuilt_jar")
|
||||
|
||||
yoga_prebuilt_jar(
|
||||
name = "junit-jar",
|
||||
binary_jar = "junit-4.12.jar",
|
||||
)
|
||||
|
||||
yoga_java_library(
|
||||
name = "junit",
|
||||
visibility = YOGA_ROOTS,
|
||||
exported_deps = [
|
||||
":junit-jar",
|
||||
],
|
||||
)
|
@@ -1,7 +0,0 @@
|
||||
METADATA = {
|
||||
"maintainers": [
|
||||
"yoga",
|
||||
],
|
||||
"name": "junit",
|
||||
"owner": "yoga",
|
||||
}
|
@@ -1,12 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "YOGA_ROOTS", "yoga_prebuilt_aar")
|
||||
|
||||
yoga_prebuilt_aar(
|
||||
name = "soloader",
|
||||
aar = "soloader-0.5.1.aar",
|
||||
visibility = YOGA_ROOTS,
|
||||
)
|
@@ -1,53 +0,0 @@
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID", "CXX", "FBJNI_TARGET", "LIBRARY_COMPILER_FLAGS", "SOLOADER_TARGET", "subdir_glob", "yoga_cxx_library", "yoga_dep", "yoga_java_library")
|
||||
|
||||
yoga_cxx_library(
|
||||
name = "testutil",
|
||||
srcs = ["src/main/cpp/testutil/testutil.cpp"],
|
||||
header_namespace = "",
|
||||
exported_headers = subdir_glob([("src/main/cpp/include", "yoga/testutil/testutil.h")]),
|
||||
compiler_flags = LIBRARY_COMPILER_FLAGS,
|
||||
soname = "libyoga_testutil.$(ext)",
|
||||
visibility = ["PUBLIC"],
|
||||
deps = [yoga_dep(":yoga")],
|
||||
)
|
||||
|
||||
yoga_cxx_library(
|
||||
name = "testutil-jni",
|
||||
srcs = ["src/main/cpp/testutil/testutil.cpp"],
|
||||
header_namespace = "",
|
||||
exported_headers = subdir_glob([("src/main/cpp/include", "yoga/testutil/testutil.h")]),
|
||||
compiler_flags = LIBRARY_COMPILER_FLAGS,
|
||||
platforms = (CXX, ANDROID),
|
||||
soname = "libyoga_testutil.$(ext)",
|
||||
visibility = ["PUBLIC"],
|
||||
deps = [
|
||||
yoga_dep("java:jni"),
|
||||
yoga_dep(":yoga"),
|
||||
],
|
||||
)
|
||||
|
||||
yoga_java_library(
|
||||
name = "java",
|
||||
srcs = ["src/main/java/com/facebook/yoga/TestUtil.java"],
|
||||
source = "1.7",
|
||||
target = "1.7",
|
||||
visibility = ["PUBLIC"],
|
||||
deps = [
|
||||
":jni",
|
||||
SOLOADER_TARGET,
|
||||
],
|
||||
)
|
||||
|
||||
yoga_cxx_library(
|
||||
name = "jni",
|
||||
srcs = ["src/main/cpp/jni/jni.cpp"],
|
||||
allow_jni_merging = False,
|
||||
compiler_flags = LIBRARY_COMPILER_FLAGS,
|
||||
platforms = (CXX, ANDROID),
|
||||
soname = "libyoga_testutil_jni.$(ext)",
|
||||
visibility = ["PUBLIC"],
|
||||
deps = [
|
||||
":testutil-jni",
|
||||
FBJNI_TARGET,
|
||||
],
|
||||
)
|
@@ -1,109 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
fb_native = struct(
|
||||
android_aar = native.android_aar,
|
||||
android_app_modularity = native.android_app_modularity,
|
||||
android_binary = native.android_binary,
|
||||
android_build_config = native.android_build_config,
|
||||
android_bundle = native.android_bundle,
|
||||
android_instrumentation_apk = native.android_instrumentation_apk,
|
||||
android_instrumentation_test = native.android_instrumentation_test,
|
||||
android_library = native.android_library,
|
||||
android_manifest = native.android_manifest,
|
||||
android_prebuilt_aar = native.android_prebuilt_aar,
|
||||
android_resource = native.android_resource,
|
||||
apk_genrule = native.apk_genrule,
|
||||
apple_asset_catalog = native.apple_asset_catalog,
|
||||
apple_binary = native.apple_binary,
|
||||
apple_bundle = native.apple_bundle,
|
||||
apple_library = native.apple_library,
|
||||
apple_package = native.apple_package,
|
||||
apple_resource = native.apple_resource,
|
||||
apple_test = native.apple_test,
|
||||
cgo_library = native.cgo_library,
|
||||
command_alias = native.command_alias,
|
||||
config_setting = native.config_setting,
|
||||
constraint_setting = native.constraint_setting,
|
||||
constraint_value = native.constraint_value,
|
||||
core_data_model = native.core_data_model,
|
||||
csharp_library = native.csharp_library,
|
||||
cxx_binary = native.cxx_binary,
|
||||
cxx_genrule = native.cxx_genrule,
|
||||
cxx_library = native.cxx_library,
|
||||
cxx_lua_extension = native.cxx_lua_extension,
|
||||
cxx_precompiled_header = native.cxx_precompiled_header,
|
||||
cxx_python_extension = native.cxx_python_extension,
|
||||
cxx_test = native.cxx_test,
|
||||
d_binary = native.d_binary,
|
||||
d_library = native.d_library,
|
||||
d_test = native.d_test,
|
||||
export_file = native.export_file,
|
||||
filegroup = native.filegroup,
|
||||
gen_aidl = native.gen_aidl,
|
||||
genrule = native.genrule,
|
||||
go_binary = native.go_binary,
|
||||
go_library = native.go_library,
|
||||
go_test = native.go_test,
|
||||
groovy_library = native.groovy_library,
|
||||
groovy_test = native.groovy_test,
|
||||
gwt_binary = native.gwt_binary,
|
||||
halide_library = native.halide_library,
|
||||
haskell_binary = native.haskell_binary,
|
||||
haskell_ghci = native.haskell_ghci,
|
||||
haskell_haddock = native.haskell_haddock,
|
||||
haskell_library = native.haskell_library,
|
||||
haskell_prebuilt_library = native.haskell_prebuilt_library,
|
||||
http_archive = native.http_archive,
|
||||
http_file = native.http_file,
|
||||
jar_genrule = native.jar_genrule,
|
||||
java_annotation_processor = native.java_annotation_processor,
|
||||
java_binary = native.java_binary,
|
||||
java_library = native.java_library,
|
||||
java_test = native.java_test,
|
||||
js_bundle = native.js_bundle,
|
||||
js_bundle_genrule = native.js_bundle_genrule,
|
||||
js_library = native.js_library,
|
||||
keystore = native.keystore,
|
||||
kotlin_library = native.kotlin_library,
|
||||
kotlin_test = native.kotlin_test,
|
||||
lua_binary = native.lua_binary,
|
||||
lua_library = native.lua_library,
|
||||
ndk_library = native.ndk_library,
|
||||
ocaml_binary = native.ocaml_binary,
|
||||
ocaml_library = native.ocaml_library,
|
||||
platform = native.platform,
|
||||
prebuilt_apple_framework = native.prebuilt_apple_framework,
|
||||
prebuilt_cxx_library = native.prebuilt_cxx_library,
|
||||
prebuilt_cxx_library_group = native.prebuilt_cxx_library_group,
|
||||
prebuilt_dotnet_library = native.prebuilt_dotnet_library,
|
||||
prebuilt_go_library = native.prebuilt_go_library,
|
||||
prebuilt_jar = native.prebuilt_jar,
|
||||
prebuilt_native_library = native.prebuilt_native_library,
|
||||
prebuilt_ocaml_library = native.prebuilt_ocaml_library,
|
||||
prebuilt_python_library = native.prebuilt_python_library,
|
||||
prebuilt_rust_library = native.prebuilt_rust_library,
|
||||
python_binary = native.python_binary,
|
||||
python_library = native.python_library,
|
||||
python_test = native.python_test,
|
||||
remote_file = native.remote_file,
|
||||
robolectric_test = native.robolectric_test,
|
||||
rust_binary = native.rust_binary,
|
||||
rust_library = native.rust_library,
|
||||
rust_test = native.rust_test,
|
||||
scala_library = native.scala_library,
|
||||
scala_test = native.scala_test,
|
||||
scene_kit_assets = native.scene_kit_assets,
|
||||
sh_binary = native.sh_binary,
|
||||
sh_test = native.sh_test,
|
||||
swift_library = native.swift_library,
|
||||
test_suite = native.test_suite,
|
||||
versioned_alias = native.versioned_alias,
|
||||
worker_tool = native.worker_tool,
|
||||
xcode_postbuild_script = native.xcode_postbuild_script,
|
||||
xcode_prebuild_script = native.xcode_prebuild_script,
|
||||
xcode_workspace_config = native.xcode_workspace_config,
|
||||
zip_file = native.zip_file,
|
||||
)
|
@@ -1,264 +0,0 @@
|
||||
#
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the LICENSE
|
||||
# file in the root directory of this source tree.
|
||||
#
|
||||
"""Provides macros for working with yoga library."""
|
||||
|
||||
YOGA_ROOTS = ["//..."]
|
||||
|
||||
JAVA_TARGET = "//java:java"
|
||||
|
||||
JSR_305_TARGET = "//lib/jsr-305:jsr-305"
|
||||
|
||||
JUNIT_TARGET = "//lib/junit:junit"
|
||||
|
||||
PROGUARD_ANNOTATIONS_TARGET = "//java/proguard-annotations/src/main/java/com/facebook/proguard/annotations:annotations"
|
||||
|
||||
SOLOADER_TARGET = "//lib/soloader:soloader"
|
||||
|
||||
GTEST_TARGET = "//lib/gtest:gtest"
|
||||
|
||||
JNI_TARGET = "//lib/jni:jni"
|
||||
|
||||
FBJNI_TARGET = "//lib/fb:fbjni"
|
||||
|
||||
FBJNI_JAVA_TARGET = "//lib/fb/src/main/java/com/facebook/jni:jni"
|
||||
|
||||
APPCOMPAT_TARGET = "//lib/appcompat:appcompat"
|
||||
|
||||
APPLE = ""
|
||||
|
||||
ANDROID = ""
|
||||
|
||||
ANDROID_SUPPORT_TARGET = "//lib/android-support:android-support"
|
||||
|
||||
ANDROID_TARGET = "//android:android"
|
||||
|
||||
ANDROID_JAVA_TARGET = "//android/src/main/java/com/facebook/yoga/android:android"
|
||||
|
||||
ANDROID_RES_TARGET = "//android:res"
|
||||
|
||||
ANDROID_SAMPLE_JAVA_TARGET = "//android/sample/java/com/facebook/samples/yoga:yoga"
|
||||
|
||||
ANDROID_SAMPLE_RES_TARGET = "//android/sample:res"
|
||||
|
||||
CXX_LIBRARY_WHITELIST = [
|
||||
"//:yoga",
|
||||
"//lib/fb:fbjni",
|
||||
"//java:jni",
|
||||
]
|
||||
|
||||
SUPPRESSION_FLAGS = [
|
||||
"-Wno-enum-float-conversion",
|
||||
"-Wno-implicit-float-conversion",
|
||||
]
|
||||
|
||||
BASE_COMPILER_FLAGS = [
|
||||
"-fno-omit-frame-pointer",
|
||||
"-fexceptions",
|
||||
"-fvisibility=hidden",
|
||||
"-ffunction-sections",
|
||||
"-fdata-sections",
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
"-O2",
|
||||
"-std=c++11",
|
||||
"-DYG_ENABLE_EVENTS",
|
||||
] + SUPPRESSION_FLAGS
|
||||
|
||||
LIBRARY_COMPILER_FLAGS = BASE_COMPILER_FLAGS + [
|
||||
"-fPIC",
|
||||
]
|
||||
|
||||
def _paths_join(path, *others):
|
||||
"""Joins one or more path components."""
|
||||
result = path
|
||||
|
||||
for p in others:
|
||||
if p.startswith("/"): # absolute
|
||||
result = p
|
||||
elif not result or result.endswith("/"):
|
||||
result += p
|
||||
else:
|
||||
result += "/" + p
|
||||
|
||||
return result
|
||||
|
||||
def subdir_glob(glob_specs, exclude = None, prefix = ""):
|
||||
"""Returns a dict of sub-directory relative paths to full paths.
|
||||
|
||||
The subdir_glob() function is useful for defining header maps for C/C++
|
||||
libraries which should be relative the given sub-directory.
|
||||
Given a list of tuples, the form of (relative-sub-directory, glob-pattern),
|
||||
it returns a dict of sub-directory relative paths to full paths.
|
||||
|
||||
Please refer to native.glob() for explanations and examples of the pattern.
|
||||
|
||||
Args:
|
||||
glob_specs: The array of tuples in form of
|
||||
(relative-sub-directory, glob-pattern inside relative-sub-directory).
|
||||
type: List[Tuple[str, str]]
|
||||
exclude: A list of patterns to identify files that should be removed
|
||||
from the set specified by the first argument. Defaults to [].
|
||||
type: Optional[List[str]]
|
||||
prefix: If is not None, prepends it to each key in the dictionary.
|
||||
Defaults to None.
|
||||
type: Optional[str]
|
||||
|
||||
Returns:
|
||||
A dict of sub-directory relative paths to full paths.
|
||||
"""
|
||||
if exclude == None:
|
||||
exclude = []
|
||||
|
||||
results = []
|
||||
|
||||
for dirpath, glob_pattern in glob_specs:
|
||||
results.append(
|
||||
_single_subdir_glob(dirpath, glob_pattern, exclude, prefix),
|
||||
)
|
||||
|
||||
return _merge_maps(*results)
|
||||
|
||||
def _merge_maps(*file_maps):
|
||||
result = {}
|
||||
for file_map in file_maps:
|
||||
for key in file_map:
|
||||
if key in result and result[key] != file_map[key]:
|
||||
fail(
|
||||
"Conflicting files in file search paths. " +
|
||||
"\"%s\" maps to both \"%s\" and \"%s\"." %
|
||||
(key, result[key], file_map[key]),
|
||||
)
|
||||
|
||||
result[key] = file_map[key]
|
||||
|
||||
return result
|
||||
|
||||
def _single_subdir_glob(dirpath, glob_pattern, exclude = None, prefix = None):
|
||||
if exclude == None:
|
||||
exclude = []
|
||||
results = {}
|
||||
files = native.glob([_paths_join(dirpath, glob_pattern)], exclude = exclude)
|
||||
for f in files:
|
||||
if dirpath:
|
||||
key = f[len(dirpath) + 1:]
|
||||
else:
|
||||
key = f
|
||||
if prefix:
|
||||
key = _paths_join(prefix, key)
|
||||
results[key] = f
|
||||
|
||||
return results
|
||||
|
||||
def yoga_dep(dep):
|
||||
return "//" + dep
|
||||
|
||||
def yoga_cxx_lib(lib):
|
||||
return yoga_dep(lib)
|
||||
|
||||
def yoga_android_aar(*args, **kwargs):
|
||||
native.android_aar(*args, **kwargs)
|
||||
|
||||
def yoga_android_binary(*args, **kwargs):
|
||||
native.android_binary(*args, **kwargs)
|
||||
|
||||
def yoga_android_library(*args, **kwargs):
|
||||
native.android_library(*args, **kwargs)
|
||||
|
||||
def yoga_android_resource(*args, **kwargs):
|
||||
native.alias(
|
||||
name = kwargs["name"] + "Android",
|
||||
actual = ":" + kwargs["name"],
|
||||
visibility = kwargs.get("visibility") or ["PUBLIC"],
|
||||
)
|
||||
native.android_resource(*args, **kwargs)
|
||||
|
||||
def yoga_apple_library(*args, **kwargs):
|
||||
native.apple_library(*args, **kwargs)
|
||||
|
||||
def yoga_apple_test(*args, **kwargs):
|
||||
native.apple_test(*args, **kwargs)
|
||||
|
||||
def yoga_cxx_binary(*args, **kwargs):
|
||||
kwargs.pop("platforms", None)
|
||||
native.cxx_binary(*args, **kwargs)
|
||||
|
||||
def yoga_cxx_library(*args, **kwargs):
|
||||
# Currently unused
|
||||
kwargs.pop("platforms", None)
|
||||
kwargs.pop("allow_jni_merging", None)
|
||||
|
||||
native.cxx_library(*args, **kwargs)
|
||||
|
||||
def yoga_cxx_test(*args, **kwargs):
|
||||
native.cxx_test(*args, **kwargs)
|
||||
|
||||
def yoga_java_binary(*args, **kwargs):
|
||||
native.java_binary(*args, **kwargs)
|
||||
|
||||
def yoga_java_library(*args, **kwargs):
|
||||
native.java_library(*args, **kwargs)
|
||||
|
||||
def yoga_java_test(*args, **kwargs):
|
||||
kwargs["deps"] = kwargs.get("deps", []) + ["//lib/hamcrest:hamcrest"]
|
||||
native.java_test(*args, **kwargs)
|
||||
|
||||
def yoga_prebuilt_cxx_library(*args, **kwargs):
|
||||
native.prebuilt_cxx_library(*args, **kwargs)
|
||||
|
||||
def yoga_prebuilt_jar(*args, **kwargs):
|
||||
native.alias(
|
||||
name = kwargs["name"] + "Android",
|
||||
actual = ":" + kwargs["name"],
|
||||
visibility = kwargs.get("visibility") or ["PUBLIC"],
|
||||
)
|
||||
native.prebuilt_jar(*args, **kwargs)
|
||||
|
||||
def yoga_prebuilt_aar(*args, **kwargs):
|
||||
native.android_prebuilt_aar(*args, **kwargs)
|
||||
|
||||
def is_apple_platform():
|
||||
return True
|
||||
|
||||
def yoga_apple_binary():
|
||||
if is_apple_platform():
|
||||
yoganet_ios_srcs = []
|
||||
for arch in [
|
||||
"iphonesimulator-x86_64",
|
||||
"iphoneos-arm64",
|
||||
]:
|
||||
name = "yoganet-" + arch
|
||||
yoganet_ios_srcs.append(":" + name)
|
||||
native.genrule(
|
||||
name = name,
|
||||
srcs = [
|
||||
yoga_dep(":yogaApple#%s,static" % arch),
|
||||
yoga_dep("YogaKit:YogaKitApple#%s,static" % arch),
|
||||
yoga_dep("csharp:yoganetApple#%s,static" % arch),
|
||||
],
|
||||
out = "libyoga-%s.a" % arch,
|
||||
cmd = "libtool -static -o $OUT $SRCS",
|
||||
visibility = [yoga_dep("csharp:yoganet-ios")],
|
||||
)
|
||||
|
||||
native.genrule(
|
||||
name = "yoganet-ios",
|
||||
srcs = yoganet_ios_srcs,
|
||||
out = "libyoga.a",
|
||||
cmd = "lipo $SRCS -create -output $OUT",
|
||||
visibility = ["PUBLIC"],
|
||||
)
|
||||
|
||||
yoganet_macosx_target = "csharp:yoganetAppleMac#macosx-%s,dynamic"
|
||||
native.genrule(
|
||||
name = "yoganet-macosx",
|
||||
srcs = [
|
||||
yoga_dep(yoganet_macosx_target % "x86_64"),
|
||||
],
|
||||
out = "libyoga.dylib",
|
||||
cmd = "lipo $SRCS -create -output $OUT",
|
||||
visibility = ["PUBLIC"],
|
||||
)
|
30
util/BUCK
30
util/BUCK
@@ -1,30 +0,0 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
load("//tools/build_defs/oss:yoga_defs.bzl", "GTEST_TARGET", "LIBRARY_COMPILER_FLAGS", "yoga_cxx_library", "yoga_cxx_test")
|
||||
|
||||
_TESTS = glob(["*Test.cpp"])
|
||||
|
||||
yoga_cxx_library(
|
||||
name = "util",
|
||||
srcs = glob(
|
||||
["*.cpp"],
|
||||
exclude = _TESTS,
|
||||
),
|
||||
header_namespace = "yoga/util",
|
||||
exported_headers = glob(["*.h"]),
|
||||
compiler_flags = LIBRARY_COMPILER_FLAGS,
|
||||
tests = [":test"],
|
||||
visibility = ["PUBLIC"],
|
||||
)
|
||||
|
||||
yoga_cxx_test(
|
||||
name = "test",
|
||||
srcs = _TESTS,
|
||||
compiler_flags = LIBRARY_COMPILER_FLAGS,
|
||||
deps = [
|
||||
":util",
|
||||
GTEST_TARGET,
|
||||
],
|
||||
)
|
Reference in New Issue
Block a user