Consolidate mobile yoga into top-level xplat

Reviewed By: emilsjolander

Differential Revision: D6494379

fbshipit-source-id: f6b78d8a1b3d4bcdeef350ad7bd097cdbe5d15b1
This commit is contained in:
Jonathan Kim
2017-12-13 14:43:19 -08:00
committed by Facebook Github Bot
parent 836eaa62df
commit 2a10337344
16 changed files with 90 additions and 18 deletions

4
BUCK
View File

@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
include_defs("//yoga_defs.bzl")
load("//:yoga_defs.bzl", "LIBRARY_COMPILER_FLAGS", "BASE_COMPILER_FLAGS", "GTEST_TARGET", "yoga_dep", "cxx_library", "cxx_test")
GMOCK_OVERRIDE_FLAGS = [
# gmock does not mark mocked methods as override, ignore the warnings in tests
@@ -30,7 +30,7 @@ cxx_library(
soname = "libyogacore.$(ext)",
tests = [":YogaTests"],
visibility = ["PUBLIC"],
deps = [] if THIS_IS_FBOBJC else [
deps = [
yoga_dep("lib/fb:ndklog"),
],
)

View File

@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
include_defs("//yoga_defs.bzl")
load("//:yoga_defs.bzl", "yoga_dep", "apple_library", "apple_test")
COMPILER_FLAGS = [
"-fobjc-arc",
@@ -30,12 +30,19 @@ COMPILER_FLAGS = [
apple_library(
name = "YogaKit",
srcs = glob(["Source/**/*.m"]),
exported_headers = glob(["Source/**/*.h"]),
exported_headers = subdir_glob(
[
("", "Source/**/*.h"),
("Source", "**/*.h"),
],
prefix = "YogaKit",
),
compiler_flags = COMPILER_FLAGS,
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
"$SDKROOT/System/Library/Frameworks/UIKit.framework",
],
header_path_prefix = "",
link_whole = True,
visibility = ["PUBLIC"],
deps = [

View File

@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
load("//:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "PROGRUARD_ANNOTATIONS_TARGET")
load("//:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "PROGRUARD_ANNOTATIONS_TARGET", "android_aar", "android_resource")
android_aar(
name = "android",

View File

@@ -4,7 +4,7 @@
# This source code is licensed under the license found in the
# LICENSE-examples file in the root directory of this source tree.
load("//:yoga_defs.bzl", "ANDROID_SAMPLE_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_RES_TARGET")
load("//:yoga_defs.bzl", "ANDROID_SAMPLE_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_RES_TARGET", "android_binary", "android_resource")
android_binary(
name = "sample",

View File

@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
load("//:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_SUPPORT_TARGET", "APPCOMPAT_TARGET", "ANDROID_SUPPORT_TARGET", "SOLOADER_TARGET")
load("//:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_SUPPORT_TARGET", "APPCOMPAT_TARGET", "SOLOADER_TARGET", "android_library")
android_library(
name = "yoga",

View File

@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
load("//:yoga_defs.bzl", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "JSR_305_TARGET", "SOLOADER_TARGET")
load("//:yoga_defs.bzl", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "JSR_305_TARGET", "SOLOADER_TARGET", "android_library")
android_library(
name = "android",

View File

@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
include_defs("//yoga_defs.bzl")
load("//:yoga_defs.bzl", "FBJNI_TARGET", "JNI_TARGET", "INFER_ANNOTATIONS_TARGET", "JSR_305_TARGET", "PROGRUARD_ANNOTATIONS_TARGET", "SOLOADER_TARGET", "JUNIT_TARGET", "FBJNI_JAVA_TARGET", "CXX_LIBRARY_WHITELIST", "yoga_dep", "cxx_library", "java_library", "java_test", "java_binary")
cxx_library(
name = "jni",

View File

@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
load("//:yoga_defs.bzl", "YOGA_ROOTS")
load("//:yoga_defs.bzl", "YOGA_ROOTS", "java_library")
java_library(
name = "annotations",

View File

@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
load("//:yoga_defs.bzl", "YOGA_ROOTS")
load("//:yoga_defs.bzl", "YOGA_ROOTS", "prebuilt_jar")
prebuilt_jar(
name = "android-support",

View File

@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
load("//:yoga_defs.bzl", "PROGRUARD_ANNOTATIONS_TARGET", "SOLOADER_TARGET", "JSR_305_TARGET")
load("//:yoga_defs.bzl", "PROGRUARD_ANNOTATIONS_TARGET", "SOLOADER_TARGET", "JSR_305_TARGET", "java_library")
java_library(
name = "jni",

View File

@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
include_defs("//yoga_defs.bzl")
load("//:yoga_defs.bzl", "cxx_library", "YOGA_ROOTS")
COMPILER_FLAGS = [
"-std=c++11",

View File

@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
load("//:yoga_defs.bzl", "YOGA_ROOTS")
load("//:yoga_defs.bzl", "YOGA_ROOTS", "prebuilt_jar", "java_library")
prebuilt_jar(
name = "infer-annotations-jar",

View File

@@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
load("//:yoga_defs.bzl", "cxx_library")
cxx_library(
name = "jni",
header_namespace = "",

View File

@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
load("//:yoga_defs.bzl", "YOGA_ROOTS")
load("//:yoga_defs.bzl", "YOGA_ROOTS", "prebuilt_jar", "java_library")
prebuilt_jar(
name = "jsr305-jar",

View File

@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
load("//:yoga_defs.bzl", "YOGA_ROOTS")
load("//:yoga_defs.bzl", "YOGA_ROOTS", "prebuilt_jar", "java_library")
prebuilt_jar(
name = "junit-jar",

View File

@@ -19,8 +19,6 @@ ANDROID_RES_TARGET = '//android:res'
ANDROID_SAMPLE_JAVA_TARGET = '//android/sample/java/com/facebook/samples/yoga:yoga'
ANDROID_SAMPLE_RES_TARGET = '//android/sample:res'
THIS_IS_FBOBJC = False
CXX_LIBRARY_WHITELIST = [
'//:yoga',
'//lib/fb:fbjni',
@@ -42,3 +40,68 @@ LIBRARY_COMPILER_FLAGS = BASE_COMPILER_FLAGS + [
def yoga_dep(dep):
return '//' + dep
_original_android_aar = android_aar
def android_aar(*args, **kwargs):
_original_android_aar(*args, **kwargs)
_original_android_binary = android_binary
def android_binary(*args, **kwargs):
_original_android_binary(*args, **kwargs)
_original_android_library = android_library
def android_library(*args, **kwargs):
_original_android_library(*args, **kwargs)
_original_android_resource = android_resource
def android_resource(*args, **kwargs):
_original_android_resource(*args, **kwargs)
_original_apple_library = apple_library
def apple_library(*args, **kwargs):
_original_apple_library(*args, **kwargs)
_original_apple_test = apple_test
def apple_test(*args, **kwargs):
_original_apple_test(*args, **kwargs)
_original_cxx_library = cxx_library
def cxx_library(*args, **kwargs):
_original_cxx_library(*args, **kwargs)
_original_cxx_test = cxx_test
def cxx_test(*args, **kwargs):
_original_cxx_test(*args, **kwargs)
_original_java_binary = java_binary
def java_binary(*args, **kwargs):
_original_java_binary(*args, **kwargs)
_original_java_library = java_library
def java_library(*args, **kwargs):
_original_java_library(*args, **kwargs)
_original_java_test = java_test
def java_test(*args, **kwargs):
_original_java_test(*args, **kwargs)
_original_prebuilt_cxx_library = prebuilt_cxx_library
def prebuilt_cxx_library(*args, **kwargs):
_original_prebuilt_cxx_library(*args, **kwargs)
_original_prebuilt_jar = prebuilt_jar
def prebuilt_jar(*args, **kwargs):
_original_prebuilt_jar(*args, **kwargs)