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 # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # 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_OVERRIDE_FLAGS = [
# gmock does not mark mocked methods as override, ignore the warnings in tests # 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", "-std=c++1y",
] ]
cxx_library( yoga_cxx_library(
name = "yoga", name = "yoga",
srcs = glob(["yoga/*.cpp"]), srcs = glob(["yoga/*.cpp"]),
header_namespace = "", header_namespace = "",
@@ -32,7 +32,7 @@ cxx_library(
], ],
) )
cxx_test( yoga_cxx_test(
name = "YogaTests", name = "YogaTests",
srcs = glob(["tests/*.cpp"]), srcs = glob(["tests/*.cpp"]),
compiler_flags = TEST_COMPILER_FLAGS, compiler_flags = TEST_COMPILER_FLAGS,

View File

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

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # 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", name = "android",
manifest_skeleton = "src/main/AndroidManifest.xml", manifest_skeleton = "src/main/AndroidManifest.xml",
visibility = [ visibility = [
@@ -20,7 +20,7 @@ android_aar(
], ],
) )
android_resource( yoga_android_resource(
name = "res", name = "res",
package = "com.facebook.yoga.android", package = "com.facebook.yoga.android",
res = "src/main/res", res = "src/main/res",

View File

@@ -4,9 +4,9 @@
# This source code is licensed under the license found in the # This source code is licensed under the license found in the
# LICENSE-examples file in the root directory of this source tree. # 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", name = "sample",
keystore = ":debug_keystore", keystore = ":debug_keystore",
manifest = "AndroidManifest.xml", manifest = "AndroidManifest.xml",
@@ -16,7 +16,7 @@ android_binary(
], ],
) )
android_resource( yoga_android_resource(
name = "res", name = "res",
package = "com.facebook.samples.yoga", package = "com.facebook.samples.yoga",
res = "res", res = "res",

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the license found in the # This source code is licensed under the license found in the
# LICENSE-examples file in the root directory of this source tree. # 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", name = "yoga",
srcs = glob(["**/*.java"]), srcs = glob(["**/*.java"]),
visibility = [ visibility = [

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # 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", name = "android",
srcs = glob(["**/*.java"]), srcs = glob(["**/*.java"]),
visibility = [ visibility = [

View File

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

View File

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

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # 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", name = "annotations",
srcs = glob(["*.java"]), srcs = glob(["*.java"]),
source = "1.7", source = "1.7",

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # 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", name = "android-support",
binary_jar = "android-support-v4.jar", binary_jar = "android-support-v4.jar",
visibility = YOGA_ROOTS, visibility = YOGA_ROOTS,

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # 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", name = "ndklog",
exported_platform_linker_flags = [ exported_platform_linker_flags = [
( (
@@ -17,7 +17,7 @@ prebuilt_cxx_library(
visibility = YOGA_ROOTS, visibility = YOGA_ROOTS,
) )
cxx_library( yoga_cxx_library(
name = "fbjni", name = "fbjni",
srcs = glob(["src/main/cpp/**/*.cpp"]), srcs = glob(["src/main/cpp/**/*.cpp"]),
header_namespace = "", header_namespace = "",

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # 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", name = "jni",
srcs = glob(["**/*.java"]), srcs = glob(["**/*.java"]),
proguard_config = "fbjni.pro", proguard_config = "fbjni.pro",

View File

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

View File

@@ -3,14 +3,14 @@
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # 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", name = "infer-annotations-jar",
binary_jar = "infer-annotations-1.4.jar", binary_jar = "infer-annotations-1.4.jar",
) )
java_library( yoga_java_library(
name = "infer-annotations", name = "infer-annotations",
exported_deps = [ exported_deps = [
":infer-annotations-jar", ":infer-annotations-jar",

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # 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", name = "jni",
header_namespace = "", header_namespace = "",
exported_headers = [ exported_headers = [

View File

@@ -3,14 +3,14 @@
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # 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", name = "jsr305-jar",
binary_jar = "jsr305.jar", binary_jar = "jsr305.jar",
) )
java_library( yoga_java_library(
name = "jsr-305", name = "jsr-305",
exported_deps = [ exported_deps = [
":jsr305-jar", ":jsr305-jar",

View File

@@ -3,14 +3,14 @@
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # 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", name = "junit-jar",
binary_jar = "junit4.jar", binary_jar = "junit4.jar",
) )
java_library( yoga_java_library(
name = "junit", name = "junit",
exported_deps = [ exported_deps = [
":junit-jar", ":junit-jar",

View File

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