Make yoga wrapper macros start with yoga_

Summary: Rename macros

Reviewed By: mzlee

Differential Revision: D7606834

fbshipit-source-id: a2089260dbe46f30f49a207737c83472e2fb3c63
This commit is contained in:
Jonathan Kim
2018-04-14 12:39:23 -07:00
committed by Facebook Github Bot
parent b9fa60fd74
commit eb15939c23
18 changed files with 85 additions and 98 deletions

6
BUCK
View File

@@ -3,7 +3,7 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "LIBRARY_COMPILER_FLAGS", "BASE_COMPILER_FLAGS", "GTEST_TARGET", "yoga_dep", "cxx_library", "cxx_test")
load("//:yoga_defs.bzl", "LIBRARY_COMPILER_FLAGS", "BASE_COMPILER_FLAGS", "GTEST_TARGET", "yoga_dep", "yoga_cxx_library", "yoga_cxx_test")
GMOCK_OVERRIDE_FLAGS = [
# gmock does not mark mocked methods as override, ignore the warnings in tests
@@ -18,7 +18,7 @@ TEST_COMPILER_FLAGS = BASE_COMPILER_FLAGS + GMOCK_OVERRIDE_FLAGS + [
"-std=c++1y",
]
cxx_library(
yoga_cxx_library(
name = "yoga",
srcs = glob(["yoga/*.cpp"]),
header_namespace = "",
@@ -32,7 +32,7 @@ cxx_library(
],
)
cxx_test(
yoga_cxx_test(
name = "YogaTests",
srcs = glob(["tests/*.cpp"]),
compiler_flags = TEST_COMPILER_FLAGS,

View File

@@ -3,7 +3,7 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "yoga_dep", "apple_library", "apple_test")
load("//:yoga_defs.bzl", "yoga_dep", "yoga_apple_library", "yoga_apple_test")
COMPILER_FLAGS = [
"-fobjc-arc",
@@ -25,7 +25,7 @@ COMPILER_FLAGS = [
"-Wunused-value",
]
apple_library(
yoga_apple_library(
name = "YogaKit",
srcs = glob(["Source/**/*.m"]),
header_namespace = "",
@@ -49,7 +49,7 @@ apple_library(
],
)
apple_test(
yoga_apple_test(
name = "YogaKitTests",
srcs = glob(["Tests/**/*.m"]),
compiler_flags = COMPILER_FLAGS,

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "PROGRUARD_ANNOTATIONS_TARGET", "android_aar", "android_resource")
load("//:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "PROGRUARD_ANNOTATIONS_TARGET", "yoga_android_aar", "yoga_android_resource")
android_aar(
yoga_android_aar(
name = "android",
manifest_skeleton = "src/main/AndroidManifest.xml",
visibility = [
@@ -20,7 +20,7 @@ android_aar(
],
)
android_resource(
yoga_android_resource(
name = "res",
package = "com.facebook.yoga.android",
res = "src/main/res",

View File

@@ -4,9 +4,9 @@
# 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", "android_binary", "android_resource")
load("//:yoga_defs.bzl", "ANDROID_SAMPLE_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_RES_TARGET", "yoga_android_binary", "yoga_android_resource")
android_binary(
yoga_android_binary(
name = "sample",
keystore = ":debug_keystore",
manifest = "AndroidManifest.xml",
@@ -16,7 +16,7 @@ android_binary(
],
)
android_resource(
yoga_android_resource(
name = "res",
package = "com.facebook.samples.yoga",
res = "res",

View File

@@ -3,9 +3,9 @@
# 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_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_SUPPORT_TARGET", "APPCOMPAT_TARGET", "SOLOADER_TARGET", "android_library")
load("//:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_SUPPORT_TARGET", "APPCOMPAT_TARGET", "SOLOADER_TARGET", "yoga_android_library")
android_library(
yoga_android_library(
name = "yoga",
srcs = glob(["**/*.java"]),
visibility = [

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "JSR_305_TARGET", "SOLOADER_TARGET", "android_library")
load("//:yoga_defs.bzl", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "JSR_305_TARGET", "SOLOADER_TARGET", "yoga_android_library")
android_library(
yoga_android_library(
name = "android",
srcs = glob(["**/*.java"]),
visibility = [

View File

@@ -3,7 +3,7 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "BASE_COMPILER_FLAGS", "yoga_dep", "cxx_library", "is_apple_platform")
load("//:yoga_defs.bzl", "BASE_COMPILER_FLAGS", "yoga_dep", "yoga_cxx_library", "is_apple_platform")
COMPILER_FLAGS = BASE_COMPILER_FLAGS + ["-std=c++11"]
@@ -21,7 +21,7 @@ csharp_library(
framework_ver = "net45",
)
cxx_library(
yoga_cxx_library(
name = "yoganet",
srcs = glob(["Yoga/YGInterop.cpp"]),
compiler_flags = COMPILER_FLAGS,

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
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", "ANDROID", "yoga_dep", "cxx_library", "java_library", "java_test", "java_binary")
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", "ANDROID", "yoga_dep", "yoga_cxx_library", "yoga_java_library", "yoga_java_test", "yoga_java_binary")
cxx_library(
yoga_cxx_library(
name = "jni",
srcs = glob(["jni/*.cpp"]),
header_namespace = "",
@@ -28,7 +28,7 @@ cxx_library(
],
)
java_library(
yoga_java_library(
name = "java",
srcs = glob(["com/facebook/yoga/*.java"]),
required_for_source_only_abi = True,
@@ -47,7 +47,7 @@ java_library(
],
)
java_test(
yoga_java_test(
name = "tests",
srcs = glob(["tests/**/*.java"]),
cxx_library_whitelist = CXX_LIBRARY_WHITELIST,
@@ -59,7 +59,7 @@ java_test(
],
)
java_binary(
yoga_java_binary(
name = "yoga",
deps = [
":java",

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "YOGA_ROOTS", "java_library")
load("//:yoga_defs.bzl", "YOGA_ROOTS", "yoga_java_library")
java_library(
yoga_java_library(
name = "annotations",
srcs = glob(["*.java"]),
source = "1.7",

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "YOGA_ROOTS", "prebuilt_jar")
load("//:yoga_defs.bzl", "YOGA_ROOTS", "yoga_prebuilt_jar")
prebuilt_jar(
yoga_prebuilt_jar(
name = "android-support",
binary_jar = "android-support-v4.jar",
visibility = YOGA_ROOTS,

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
include_defs("//yoga_defs.bzl")
load("//:yoga_defs.bzl", "yoga_prebuilt_cxx_library", "yoga_cxx_library", "YOGA_ROOTS", "FBJNI_JAVA_TARGET", "JNI_TARGET")
prebuilt_cxx_library(
yoga_prebuilt_cxx_library(
name = "ndklog",
exported_platform_linker_flags = [
(
@@ -17,7 +17,7 @@ prebuilt_cxx_library(
visibility = YOGA_ROOTS,
)
cxx_library(
yoga_cxx_library(
name = "fbjni",
srcs = glob(["src/main/cpp/**/*.cpp"]),
header_namespace = "",

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "PROGRUARD_ANNOTATIONS_TARGET", "SOLOADER_TARGET", "JSR_305_TARGET", "java_library")
load("//:yoga_defs.bzl", "PROGRUARD_ANNOTATIONS_TARGET", "SOLOADER_TARGET", "JSR_305_TARGET", "yoga_java_library")
java_library(
yoga_java_library(
name = "jni",
srcs = glob(["**/*.java"]),
proguard_config = "fbjni.pro",

View File

@@ -3,14 +3,14 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "cxx_library", "YOGA_ROOTS")
load("//:yoga_defs.bzl", "yoga_cxx_library", "YOGA_ROOTS")
COMPILER_FLAGS = [
"-std=c++11",
"-Wno-missing-prototypes",
]
cxx_library(
yoga_cxx_library(
name = "gtest",
srcs = glob(["googletest/googletest/src/*.cc"]),
header_namespace = "",

View File

@@ -3,14 +3,14 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "YOGA_ROOTS", "prebuilt_jar", "java_library")
load("//:yoga_defs.bzl", "YOGA_ROOTS", "yoga_prebuilt_jar", "yoga_java_library")
prebuilt_jar(
yoga_prebuilt_jar(
name = "infer-annotations-jar",
binary_jar = "infer-annotations-1.4.jar",
)
java_library(
yoga_java_library(
name = "infer-annotations",
exported_deps = [
":infer-annotations-jar",

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "cxx_library")
load("//:yoga_defs.bzl", "yoga_cxx_library")
cxx_library(
yoga_cxx_library(
name = "jni",
header_namespace = "",
exported_headers = [

View File

@@ -3,14 +3,14 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "YOGA_ROOTS", "prebuilt_jar", "java_library")
load("//:yoga_defs.bzl", "YOGA_ROOTS", "yoga_prebuilt_jar", "yoga_java_library")
prebuilt_jar(
yoga_prebuilt_jar(
name = "jsr305-jar",
binary_jar = "jsr305.jar",
)
java_library(
yoga_java_library(
name = "jsr-305",
exported_deps = [
":jsr305-jar",

View File

@@ -3,14 +3,14 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "YOGA_ROOTS", "prebuilt_jar", "java_library")
load("//:yoga_defs.bzl", "YOGA_ROOTS", "yoga_prebuilt_jar", "yoga_java_library")
prebuilt_jar(
yoga_prebuilt_jar(
name = "junit-jar",
binary_jar = "junit4.jar",
)
java_library(
yoga_java_library(
name = "junit",
exported_deps = [
":junit-jar",

View File

@@ -44,71 +44,58 @@ def yoga_dep(dep):
return '//' + dep
_original_android_aar = android_aar
def android_aar(*args, **kwargs):
_original_android_aar(*args, **kwargs)
def yoga_android_aar(*args, **kwargs):
native.android_aar(*args, **kwargs)
_original_android_binary = android_binary
def android_binary(*args, **kwargs):
_original_android_binary(*args, **kwargs)
def yoga_android_binary(*args, **kwargs):
native.android_binary(*args, **kwargs)
_original_android_library = android_library
def android_library(*args, **kwargs):
_original_android_library(*args, **kwargs)
def yoga_android_library(*args, **kwargs):
native.android_library(*args, **kwargs)
_original_android_resource = android_resource
def android_resource(*args, **kwargs):
_original_android_resource(*args, **kwargs)
def yoga_android_resource(*args, **kwargs):
native.android_resource(*args, **kwargs)
_original_apple_library = apple_library
def apple_library(*args, **kwargs):
_original_apple_library(*args, **kwargs)
def yoga_apple_library(*args, **kwargs):
native.apple_library(*args, **kwargs)
_original_apple_test = apple_test
def apple_test(*args, **kwargs):
_original_apple_test(*args, **kwargs)
def yoga_apple_test(*args, **kwargs):
native.apple_test(*args, **kwargs)
_original_cxx_library = cxx_library
def cxx_library(*args, **kwargs):
def yoga_cxx_library(*args, **kwargs):
# Currently unused
kwargs.pop("platforms", None)
_original_cxx_library(*args, **kwargs)
native.cxx_library(*args, **kwargs)
_original_cxx_test = cxx_test
def cxx_test(*args, **kwargs):
_original_cxx_test(*args, **kwargs)
def yoga_cxx_test(*args, **kwargs):
native.cxx_test(*args, **kwargs)
_original_java_binary = java_binary
def java_binary(*args, **kwargs):
_original_java_binary(*args, **kwargs)
def yoga_java_binary(*args, **kwargs):
native.java_binary(*args, **kwargs)
_original_java_library = java_library
def java_library(*args, **kwargs):
_original_java_library(*args, **kwargs)
def yoga_java_library(*args, **kwargs):
native.java_library(*args, **kwargs)
_original_java_test = java_test
def java_test(*args, **kwargs):
_original_java_test(*args, **kwargs)
def yoga_java_test(*args, **kwargs):
native.java_test(*args, **kwargs)
_original_prebuilt_cxx_library = prebuilt_cxx_library
def prebuilt_cxx_library(*args, **kwargs):
_original_prebuilt_cxx_library(*args, **kwargs)
def yoga_prebuilt_cxx_library(*args, **kwargs):
native.prebuilt_cxx_library(*args, **kwargs)
_original_prebuilt_jar = prebuilt_jar
def prebuilt_jar(*args, **kwargs):
_original_prebuilt_jar(*args, **kwargs)
def yoga_prebuilt_jar(*args, **kwargs):
native.prebuilt_jar(*args, **kwargs)
def is_apple_platform():