From 6c51eb4f7214ca1b537ea5f75eb699cf24bfef3f Mon Sep 17 00:00:00 2001 From: Taras Tsugrii Date: Sun, 20 May 2018 23:06:59 -0700 Subject: [PATCH] Re-format BUCK to use recommended style. Summary: This uses the latest version of `buildifier` that supports many more Skylark syntax features. Reviewed By: yfeldblum Differential Revision: D8073585 fbshipit-source-id: 12322aebc09b89d5af9cc257b16c1bc0fbb066c1 --- BUCK | 2 +- YogaKit/BUCK | 2 +- android/sample/BUCK | 2 +- csharp/BUCK | 69 +++++++++++----------- java/BUCK | 2 +- lib/fb/BUCK | 2 +- lib/fb/src/main/java/com/facebook/jni/BUCK | 2 +- lib/gtest/BUCK | 2 +- lib/infer-annotations/BUCK | 2 +- lib/jsr-305/BUCK | 2 +- lib/junit/BUCK | 2 +- 11 files changed, 45 insertions(+), 44 deletions(-) diff --git a/BUCK b/BUCK index edd57942..fd87a83b 100644 --- a/BUCK +++ b/BUCK @@ -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", "yoga_cxx_library", "yoga_cxx_test") +load("//:yoga_defs.bzl", "BASE_COMPILER_FLAGS", "GTEST_TARGET", "LIBRARY_COMPILER_FLAGS", "yoga_cxx_library", "yoga_cxx_test", "yoga_dep") GMOCK_OVERRIDE_FLAGS = [ # gmock does not mark mocked methods as override, ignore the warnings in tests diff --git a/YogaKit/BUCK b/YogaKit/BUCK index fb56bd3d..14198edb 100644 --- a/YogaKit/BUCK +++ b/YogaKit/BUCK @@ -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", "yoga_apple_library", "yoga_apple_test") +load("//:yoga_defs.bzl", "yoga_apple_library", "yoga_apple_test", "yoga_dep") COMPILER_FLAGS = [ "-fobjc-arc", diff --git a/android/sample/BUCK b/android/sample/BUCK index 3e264416..966c700d 100644 --- a/android/sample/BUCK +++ b/android/sample/BUCK @@ -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", "yoga_android_binary", "yoga_android_resource") +load("//: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", diff --git a/csharp/BUCK b/csharp/BUCK index aa610fab..d29f35a3 100644 --- a/csharp/BUCK +++ b/csharp/BUCK @@ -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", "yoga_cxx_library", "is_apple_platform") +load("//:yoga_defs.bzl", "BASE_COMPILER_FLAGS", "is_apple_platform", "yoga_cxx_library", "yoga_dep") COMPILER_FLAGS = BASE_COMPILER_FLAGS + ["-std=c++11"] @@ -33,39 +33,40 @@ yoga_cxx_library( ) if is_apple_platform(): - yoganet_ios_srcs = [] - for arch in [ - 'iphonesimulator-x86_64', 'iphoneos-arm64' - ]: - name = 'yoganet-' + arch - yoganet_ios_srcs.append(':' + name) + yoganet_ios_srcs = [] + for arch in [ + "iphonesimulator-x86_64", + "iphoneos-arm64", + ]: + name = "yoganet-" + arch + yoganet_ios_srcs.append(":" + name) + 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")], + ) + 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')], + name = "yoganet-ios", + srcs = yoganet_ios_srcs, + out = "libyoga.a", + cmd = "lipo $SRCS -create -output $OUT", + visibility = ["PUBLIC"], ) - 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' - genrule( - name = 'yoganet-macosx', - srcs = [ - yoga_dep(yoganet_macosx_target % 'x86_64') - ], - out = 'libyoga.dylib', - cmd = 'lipo $SRCS -create -output $OUT', - visibility = ['PUBLIC'], - ) + yoganet_macosx_target = "csharp:yoganetAppleMac#macosx-%s,dynamic" + genrule( + name = "yoganet-macosx", + srcs = [ + yoga_dep(yoganet_macosx_target % "x86_64"), + ], + out = "libyoga.dylib", + cmd = "lipo $SRCS -create -output $OUT", + visibility = ["PUBLIC"], + ) diff --git a/java/BUCK b/java/BUCK index 60c11da4..0975d521 100644 --- a/java/BUCK +++ b/java/BUCK @@ -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", "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") +load("//:yoga_defs.bzl", "ANDROID", "CXX_LIBRARY_WHITELIST", "FBJNI_JAVA_TARGET", "FBJNI_TARGET", "INFER_ANNOTATIONS_TARGET", "JNI_TARGET", "JSR_305_TARGET", "JUNIT_TARGET", "PROGRUARD_ANNOTATIONS_TARGET", "SOLOADER_TARGET", "yoga_cxx_library", "yoga_dep", "yoga_java_binary", "yoga_java_library", "yoga_java_test") yoga_cxx_library( name = "jni", diff --git a/lib/fb/BUCK b/lib/fb/BUCK index ee97abe6..e72c3cb6 100644 --- a/lib/fb/BUCK +++ b/lib/fb/BUCK @@ -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_prebuilt_cxx_library", "yoga_cxx_library", "YOGA_ROOTS", "FBJNI_JAVA_TARGET", "JNI_TARGET", "ANDROID") +load("//:yoga_defs.bzl", "ANDROID", "FBJNI_JAVA_TARGET", "JNI_TARGET", "YOGA_ROOTS", "yoga_cxx_library", "yoga_prebuilt_cxx_library") yoga_prebuilt_cxx_library( name = "ndklog", diff --git a/lib/fb/src/main/java/com/facebook/jni/BUCK b/lib/fb/src/main/java/com/facebook/jni/BUCK index 66685b4f..0bb5297d 100644 --- a/lib/fb/src/main/java/com/facebook/jni/BUCK +++ b/lib/fb/src/main/java/com/facebook/jni/BUCK @@ -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", "PROGRUARD_ANNOTATIONS_TARGET", "SOLOADER_TARGET", "JSR_305_TARGET", "yoga_java_library") +load("//:yoga_defs.bzl", "JSR_305_TARGET", "PROGRUARD_ANNOTATIONS_TARGET", "SOLOADER_TARGET", "yoga_java_library") yoga_java_library( name = "jni", diff --git a/lib/gtest/BUCK b/lib/gtest/BUCK index 8c7cf926..167d70eb 100644 --- a/lib/gtest/BUCK +++ b/lib/gtest/BUCK @@ -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_cxx_library", "YOGA_ROOTS") +load("//:yoga_defs.bzl", "YOGA_ROOTS", "yoga_cxx_library") COMPILER_FLAGS = [ "-std=c++11", diff --git a/lib/infer-annotations/BUCK b/lib/infer-annotations/BUCK index 3eed9328..b7e2a503 100644 --- a/lib/infer-annotations/BUCK +++ b/lib/infer-annotations/BUCK @@ -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_ROOTS", "yoga_prebuilt_jar", "yoga_java_library") +load("//:yoga_defs.bzl", "YOGA_ROOTS", "yoga_java_library", "yoga_prebuilt_jar") yoga_prebuilt_jar( name = "infer-annotations-jar", diff --git a/lib/jsr-305/BUCK b/lib/jsr-305/BUCK index 8a070e84..716db462 100644 --- a/lib/jsr-305/BUCK +++ b/lib/jsr-305/BUCK @@ -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_ROOTS", "yoga_prebuilt_jar", "yoga_java_library") +load("//:yoga_defs.bzl", "YOGA_ROOTS", "yoga_java_library", "yoga_prebuilt_jar") yoga_prebuilt_jar( name = "jsr305-jar", diff --git a/lib/junit/BUCK b/lib/junit/BUCK index 74265c2a..e88f6ef0 100644 --- a/lib/junit/BUCK +++ b/lib/junit/BUCK @@ -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_ROOTS", "yoga_prebuilt_jar", "yoga_java_library") +load("//:yoga_defs.bzl", "YOGA_ROOTS", "yoga_java_library", "yoga_prebuilt_jar") yoga_prebuilt_jar( name = "junit-jar",