From c096a714a9d33c486cb76050f0d9f6610aedf81b Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Sat, 10 Mar 2018 14:21:13 -0800 Subject: [PATCH] Update oss loom to better reflect fbsource Reviewed By: BurntBrunch Differential Revision: D7212531 fbshipit-source-id: a6355ddb9246fd4efa57e2f8eaab530fa6ce4cd8 --- ...xplat_cxx.bzl => fb_xplat_cxx_library.bzl} | 3 +- .../profilo_oss_defs.bzl | 29 ++++- cpp/BUCK | 2 +- cpp/api/BUCK | 2 +- cpp/atrace/BUCK | 2 +- cpp/generated/BUCK | 2 +- cpp/jni/BUCK | 2 +- cpp/logger/BUCK | 2 +- cpp/logger/lfrb/BUCK | 2 +- cpp/profiler/BUCK | 2 +- cpp/systemcounters/BUCK | 2 +- cpp/test/BUCK | 2 +- cpp/threadmetadata/BUCK | 2 +- cpp/util/BUCK | 2 +- cpp/writer/BUCK | 2 +- cpp/yarn/BUCK | 2 +- deps/androidinternals/BUCK | 29 +++-- deps/atomic/BUCK | 15 ++- deps/buildconstants/BUCK | 23 ++-- deps/cjni/BUCK | 23 ++-- deps/cppdistract/BUCK | 32 +++-- deps/dalvik/BUCK | 23 ++-- deps/fb/BUCK | 56 ++++----- deps/fbjni/BUCK | 110 +++++++++-------- deps/fbtrace/BUCK | 19 ++- deps/forkjail/BUCK | 55 +++++---- deps/jsr-305/BUCK | 27 ++--- deps/keystore/BUCK | 17 ++- deps/linker/BUCK | 52 ++++---- deps/lss/BUCK | 23 ++-- deps/museum/5.1.1/BUCK | 111 +++++++++--------- deps/museum/6.0.1/BUCK | 111 +++++++++--------- deps/museum/7.0.0/BUCK | 111 +++++++++--------- deps/museum/BUCK | 70 ++++++----- deps/proguard/BUCK | 33 +++--- deps/sig_safe_write/BUCK | 38 +++--- deps/sigmux/BUCK | 48 ++++---- deps/soloader/BUCK | 29 ++--- deps/xplat_init/BUCK | 38 +++--- deps/zip/BUCK | 21 ++-- deps/zstr/BUCK | 37 +++--- 41 files changed, 595 insertions(+), 616 deletions(-) rename build_defs/{fb_xplat_cxx.bzl => fb_xplat_cxx_library.bzl} (88%) rename buck_imports/maven_library => build_defs/profilo_oss_defs.bzl (52%) diff --git a/build_defs/fb_xplat_cxx.bzl b/build_defs/fb_xplat_cxx_library.bzl similarity index 88% rename from build_defs/fb_xplat_cxx.bzl rename to build_defs/fb_xplat_cxx_library.bzl index 5a17c1e9e..5ae524c65 100644 --- a/build_defs/fb_xplat_cxx.bzl +++ b/build_defs/fb_xplat_cxx_library.bzl @@ -1,5 +1,4 @@ """Provides OSS compatibility layer with internal FB macros.""" -THIS_IS_FBANDROID = False def fb_xplat_cxx_library(name, **kwargs): @@ -15,4 +14,4 @@ def fb_xplat_cxx_library(name, **kwargs): compiler_flags.append("-std=c++14") kwargs["compiler_flags"] = compiler_flags - return cxx_library(name=name, **kwargs) + return native.cxx_library(name=name, **kwargs) diff --git a/buck_imports/maven_library b/build_defs/profilo_oss_defs.bzl similarity index 52% rename from buck_imports/maven_library rename to build_defs/profilo_oss_defs.bzl index cbd226edb..8b20f985e 100644 --- a/buck_imports/maven_library +++ b/build_defs/profilo_oss_defs.bzl @@ -1,4 +1,24 @@ -def maven_library( +"""Provides OSS compatibile macros.""" + +load("//build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") + + +def profilo_oss_android_library(**kwargs): + """Delegates to the native android_library rule.""" + native.android_library(**kwargs) + + +def profilo_oss_cxx_library(**kwargs): + """Delegates to the native cxx_library rule.""" + native.cxx_library(**kwargs) + + +def profilo_oss_java_library(**kwargs): + """Delegates to the native java_library rule.""" + native.java_library(**kwargs) + + +def profilo_oss_maven_library( name, group, artifact, @@ -19,15 +39,18 @@ def maven_library( ) if packaging == 'jar': - prebuilt_jar( + native.prebuilt_jar( name=name, binary_jar=':{}'.format(remote_file_name), visibility=visibility ) else: - android_prebuilt_aar( + native.android_prebuilt_aar( name=name, aar=':{}'.format(remote_file_name), visibility=visibility ) + +def profilo_oss_xplat_cxx_library(**kwargs): + fb_xplat_cxx_library(**kwargs) diff --git a/cpp/BUCK b/cpp/BUCK index 410bdfddd..3c9647c01 100644 --- a/cpp/BUCK +++ b/cpp/BUCK @@ -1,5 +1,5 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") -load("//build_defs:fb_xplat_cxx.bzl", "fb_xplat_cxx_library") +load("//build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") PROVIDER_EXPORTED_HEADERS = ["TraceProviders.h"] diff --git a/cpp/api/BUCK b/cpp/api/BUCK index 266aa3fe9..b31dcc5c4 100644 --- a/cpp/api/BUCK +++ b/cpp/api/BUCK @@ -1,5 +1,5 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") -load("//build_defs:fb_xplat_cxx.bzl", "fb_xplat_cxx_library") +load("//build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") fb_xplat_cxx_library( name = "external_api", diff --git a/cpp/atrace/BUCK b/cpp/atrace/BUCK index a8b4906ab..a9100662e 100644 --- a/cpp/atrace/BUCK +++ b/cpp/atrace/BUCK @@ -1,5 +1,5 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") -load("//build_defs:fb_xplat_cxx.bzl", "fb_xplat_cxx_library") +load("//build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") fb_xplat_cxx_library( name = "atrace", diff --git a/cpp/generated/BUCK b/cpp/generated/BUCK index 199f92f45..e89706a5e 100644 --- a/cpp/generated/BUCK +++ b/cpp/generated/BUCK @@ -1,6 +1,6 @@ load("//build_defs:fb_java_library.bzl", "fb_java_library") load("//buck_imports:profilo_path.bzl", "profilo_path") -load("//build_defs:fb_xplat_cxx.bzl", "fb_xplat_cxx_library") +load("//build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") fb_xplat_cxx_library( name = "cpp", diff --git a/cpp/jni/BUCK b/cpp/jni/BUCK index 9aa69683c..9f3756197 100644 --- a/cpp/jni/BUCK +++ b/cpp/jni/BUCK @@ -1,5 +1,5 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") -load("//build_defs:fb_xplat_cxx.bzl", "fb_xplat_cxx_library") +load("//build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") fb_xplat_cxx_library( name = "jni", diff --git a/cpp/logger/BUCK b/cpp/logger/BUCK index 3c0f9bb69..6a1ecd964 100644 --- a/cpp/logger/BUCK +++ b/cpp/logger/BUCK @@ -1,5 +1,5 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") -load("//build_defs:fb_xplat_cxx.bzl", "fb_xplat_cxx_library") +load("//build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") fb_xplat_cxx_library( name = "logger", diff --git a/cpp/logger/lfrb/BUCK b/cpp/logger/lfrb/BUCK index aec528ff6..4d232422a 100644 --- a/cpp/logger/lfrb/BUCK +++ b/cpp/logger/lfrb/BUCK @@ -1,5 +1,5 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") -load("//build_defs:fb_xplat_cxx.bzl", "fb_xplat_cxx_library") +load("//build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") fb_xplat_cxx_library( name = "lfrb", diff --git a/cpp/profiler/BUCK b/cpp/profiler/BUCK index b5acab64f..cedba152f 100644 --- a/cpp/profiler/BUCK +++ b/cpp/profiler/BUCK @@ -1,5 +1,5 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") -load("//build_defs:fb_xplat_cxx.bzl", "fb_xplat_cxx_library") +load("//build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") def tracer_library(version): version_ = version.replace(".", "_") diff --git a/cpp/systemcounters/BUCK b/cpp/systemcounters/BUCK index 1d393f596..45eb9bc27 100644 --- a/cpp/systemcounters/BUCK +++ b/cpp/systemcounters/BUCK @@ -1,5 +1,5 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") -load("//build_defs:fb_xplat_cxx.bzl", "fb_xplat_cxx_library") +load("//build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") SYSTEM_COUNTERS_EXPORTED_HEADERS = ["SystemCounterThread.h"] diff --git a/cpp/test/BUCK b/cpp/test/BUCK index 9ac59f926..a753c3749 100644 --- a/cpp/test/BUCK +++ b/cpp/test/BUCK @@ -1,5 +1,5 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") -load("//build_defs:fb_xplat_cxx.bzl", "fb_xplat_cxx_library") +load("//build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") cxx_test( name = "providers", diff --git a/cpp/threadmetadata/BUCK b/cpp/threadmetadata/BUCK index 2fe481ab0..b695c911e 100644 --- a/cpp/threadmetadata/BUCK +++ b/cpp/threadmetadata/BUCK @@ -1,5 +1,5 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") -load("//build_defs:fb_xplat_cxx.bzl", "fb_xplat_cxx_library") +load("//build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") fb_xplat_cxx_library( name = "threadmetadata", diff --git a/cpp/util/BUCK b/cpp/util/BUCK index bbbd6a34e..fb3816923 100644 --- a/cpp/util/BUCK +++ b/cpp/util/BUCK @@ -1,5 +1,5 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") -load("//build_defs:fb_xplat_cxx.bzl", "fb_xplat_cxx_library") +load("//build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") UTIL_EXPORTED_HEADERS = [ "common.h", diff --git a/cpp/writer/BUCK b/cpp/writer/BUCK index bf93265ef..de03e3d7a 100644 --- a/cpp/writer/BUCK +++ b/cpp/writer/BUCK @@ -1,5 +1,5 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") -load("//build_defs:fb_xplat_cxx.bzl", "fb_xplat_cxx_library") +load("//build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") fb_xplat_cxx_library( name = "print_visitor", diff --git a/cpp/yarn/BUCK b/cpp/yarn/BUCK index 9e6b13f82..8fc4d6fc0 100644 --- a/cpp/yarn/BUCK +++ b/cpp/yarn/BUCK @@ -1,5 +1,5 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") -load("//build_defs:fb_xplat_cxx.bzl", "fb_xplat_cxx_library") +load("//build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") fb_xplat_cxx_library( name = "headers_linux", diff --git a/deps/androidinternals/BUCK b/deps/androidinternals/BUCK index 0f08460e3..87504809a 100644 --- a/deps/androidinternals/BUCK +++ b/deps/androidinternals/BUCK @@ -1,16 +1,15 @@ -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_android_library") -if not THIS_IS_FBANDROID: - android_library( - name = "os", - srcs = [ - "ReflectionHelper.java", - "android/os/SystemPropertiesInternal.java", - ], - visibility = [ - "PUBLIC", - ], - deps = [ - "//deps/jsr-305:jsr-305", - ], - ) +profilo_oss_android_library( + name = "os", + srcs = [ + "ReflectionHelper.java", + "android/os/SystemPropertiesInternal.java", + ], + visibility = [ + "PUBLIC", + ], + deps = [ + "//deps/jsr-305:jsr-305", + ], +) diff --git a/deps/atomic/BUCK b/deps/atomic/BUCK index 236989fcf..caf655c3e 100644 --- a/deps/atomic/BUCK +++ b/deps/atomic/BUCK @@ -1,9 +1,8 @@ -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_cxx_library") -if not THIS_IS_FBANDROID: - cxx_library( - name = "atomic", - visibility = [ - "PUBLIC", - ], - ) +profilo_oss_cxx_library( + name = "atomic", + visibility = [ + "PUBLIC", + ], +) diff --git a/deps/buildconstants/BUCK b/deps/buildconstants/BUCK index 685f7a9cf..2d4091e10 100644 --- a/deps/buildconstants/BUCK +++ b/deps/buildconstants/BUCK @@ -1,14 +1,11 @@ -load("//build_defs:fb_java_library.bzl", "fb_java_library") +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_java_library") -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID - -if not THIS_IS_FBANDROID: - fb_java_library( - name = "buildconstants", - srcs = [ - "BuildConstants.java", - ], - visibility = [ - "PUBLIC", - ], - ) +profilo_oss_java_library( + name = "buildconstants", + srcs = [ + "BuildConstants.java", + ], + visibility = [ + "PUBLIC", + ], +) diff --git a/deps/cjni/BUCK b/deps/cjni/BUCK index 845be696e..e1c967731 100644 --- a/deps/cjni/BUCK +++ b/deps/cjni/BUCK @@ -1,13 +1,12 @@ -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_cxx_library") -if not THIS_IS_FBANDROID: - cxx_library( - name = "cjni", - header_namespace = "cjni", - exported_headers = glob(["*.h"]), - srcs = glob(["*.c"]), - preferred_linkage = "static", - visibility = [ - "PUBLIC", - ], - ) +profilo_oss_cxx_library( + name = "cjni", + srcs = glob(["*.c"]), + header_namespace = "cjni", + exported_headers = glob(["*.h"]), + preferred_linkage = "static", + visibility = [ + "PUBLIC", + ], +) diff --git a/deps/cppdistract/BUCK b/deps/cppdistract/BUCK index a76e9fc3c..b818c3d7b 100644 --- a/deps/cppdistract/BUCK +++ b/deps/cppdistract/BUCK @@ -1,19 +1,17 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_cxx_library") -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID - -if not THIS_IS_FBANDROID: - cxx_library( - name = "cppdistract", - srcs = [ - "dso.cpp", - ], - exported_headers = [ - "dso.h", - ], - header_namespace = "cppdistract", - preferred_linkage = "static", - visibility = [ - profilo_path("..."), - ], - ) +profilo_oss_cxx_library( + name = "cppdistract", + srcs = [ + "dso.cpp", + ], + header_namespace = "cppdistract", + exported_headers = [ + "dso.h", + ], + preferred_linkage = "static", + visibility = [ + profilo_path("..."), + ], +) diff --git a/deps/dalvik/BUCK b/deps/dalvik/BUCK index a17fda997..0530d631f 100644 --- a/deps/dalvik/BUCK +++ b/deps/dalvik/BUCK @@ -1,13 +1,12 @@ -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_cxx_library") -if not THIS_IS_FBANDROID: - cxx_library( - name = "dalvik-subset", - header_namespace = "dalvik-subset", - exported_headers = [ - "internals.h", - ], - visibility = [ - "PUBLIC", - ], - ) +profilo_oss_cxx_library( + name = "dalvik-subset", + header_namespace = "dalvik-subset", + exported_headers = [ + "internals.h", + ], + visibility = [ + "PUBLIC", + ], +) diff --git a/deps/fb/BUCK b/deps/fb/BUCK index 9f75c5cd9..9b950f41a 100644 --- a/deps/fb/BUCK +++ b/deps/fb/BUCK @@ -1,35 +1,35 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_cxx_library") -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID - -if not THIS_IS_FBANDROID: - cxx_library( - name = "fb", - exported_headers = glob([ - "**/*.h", - ]), - header_namespace = "fb", - compiler_flags = [ - "-fexceptions", - ], - linker_flags = [ - "-llog", - ], - preprocessor_flags = [ - "-DDISABLE_CPUCAP", - "-DDISABLE_XPLAT", - ], - srcs = glob([ +profilo_oss_cxx_library( + name = "fb", + srcs = glob( + [ "**/*.cpp", ], excludes = [ "jni/android/*.cpp", - ]), - soname = "libfb.$(ext)", - deps = [ - profilo_path("deps/fbjni:fbjni"), - ], - visibility = [ - "PUBLIC", ], - ) + ), + header_namespace = "fb", + exported_headers = glob([ + "**/*.h", + ]), + compiler_flags = [ + "-fexceptions", + ], + linker_flags = [ + "-llog", + ], + preprocessor_flags = [ + "-DDISABLE_CPUCAP", + "-DDISABLE_XPLAT", + ], + soname = "libfb.$(ext)", + visibility = [ + "PUBLIC", + ], + deps = [ + profilo_path("deps/fbjni:fbjni"), + ], +) diff --git a/deps/fbjni/BUCK b/deps/fbjni/BUCK index 9ab8bfae7..4cecfeb6c 100644 --- a/deps/fbjni/BUCK +++ b/deps/fbjni/BUCK @@ -1,59 +1,57 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_xplat_cxx_library", "profilo_oss_android_library") -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID +profilo_oss_xplat_cxx_library( + name = "fbjni", + srcs = glob([ + "cxx/fbjni/**/*.cpp", + ]), + header_namespace = "", + exported_headers = subdir_glob([ + ("cxx", "fbjni/**/*.h"), + ]), + compiler_flags = [ + "-fexceptions", + "-frtti", + ], + exported_platform_headers = [ + ( + "^(?!android-arm$).*$", + subdir_glob([ + ("cxx", "lyra/**/*.h"), + ]), + ), + ], + exported_platform_linker_flags = [ + ( + "^android", + ["-llog"], + ), + ], + platform_srcs = [ + ( + "^(?!android-arm$).*$", + glob([ + "cxx/lyra/*.cpp", + ]), + ), + ], + visibility = [ + "PUBLIC", + ], +) -if not THIS_IS_FBANDROID: - fb_xplat_cxx_library( - name = "fbjni", - exported_headers = subdir_glob([ - ("cxx", "fbjni/**/*.h"), - ]), - compiler_flags = [ - "-fexceptions", - "-frtti", - ], - srcs = glob([ - "cxx/fbjni/**/*.cpp", - ]), - header_namespace="", - visibility = [ - "PUBLIC", - ], - exported_platform_headers = [ - ( - "^(?!android-arm$).*$", - subdir_glob([ - ("cxx", "lyra/**/*.h"), - ]), - ), - ], - platform_srcs = [ - ( - "^(?!android-arm$).*$", - glob([ - "cxx/lyra/*.cpp", - ]), - ) - ], - exported_platform_linker_flags = [ - ( - "^android", - ["-llog"], - ), - ], - ) - - android_library( - name = "fbjni-java", - srcs = glob([ - "**/*.java", - ]), - visibility = [ - "PUBLIC", - ], - deps = [ - "//deps/jsr-305:jsr-305", - "//deps/proguard:annotations", - "//deps/soloader:soloader", - ], - ) +profilo_oss_android_library( + name = "fbjni-java", + srcs = glob([ + "**/*.java", + ]), + visibility = [ + "PUBLIC", + ], + deps = [ + "//deps/jsr-305:jsr-305", + "//deps/proguard:annotations", + "//deps/soloader:soloader", + ], +) diff --git a/deps/fbtrace/BUCK b/deps/fbtrace/BUCK index 28fc4c8af..0d0e66d15 100644 --- a/deps/fbtrace/BUCK +++ b/deps/fbtrace/BUCK @@ -1,12 +1,9 @@ -load("//build_defs:fb_java_library.bzl", "fb_java_library") +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_java_library") -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID - -if not THIS_IS_FBANDROID: - fb_java_library( - name = "utils", - srcs = ["FbTraceId.java"], - visibility = [ - "PUBLIC", - ], - ) +profilo_oss_java_library( + name = "utils", + srcs = ["FbTraceId.java"], + visibility = [ + "PUBLIC", + ], +) diff --git a/deps/forkjail/BUCK b/deps/forkjail/BUCK index 244f2c116..1f3ecc168 100644 --- a/deps/forkjail/BUCK +++ b/deps/forkjail/BUCK @@ -1,30 +1,29 @@ -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_cxx_library") -if not THIS_IS_FBANDROID: - FORKJAIL_EXPORTED_HEADERS = [ - "ForkJail.h", - "ShmErrorMsg.h", - ] +FORKJAIL_EXPORTED_HEADERS = [ + "ForkJail.h", + "ShmErrorMsg.h", +] - cxx_library( - name = "forkjail", - srcs = glob([ - "ForkJail.cpp", - "ShmErrorMsg.cpp", - ]), - headers = glob( - ["*.h"], - excludes = FORKJAIL_EXPORTED_HEADERS, - ), - header_namespace = "forkjail", - exported_headers = FORKJAIL_EXPORTED_HEADERS, - compiler_flags = [ - "-fexceptions", - "-fPIC", - "-std=gnu++14", - ], - force_static = True, - visibility = [ - "PUBLIC", - ], - ) +profilo_oss_cxx_library( + name = "forkjail", + srcs = glob([ + "ForkJail.cpp", + "ShmErrorMsg.cpp", + ]), + headers = glob( + ["*.h"], + excludes = FORKJAIL_EXPORTED_HEADERS, + ), + header_namespace = "forkjail", + exported_headers = FORKJAIL_EXPORTED_HEADERS, + compiler_flags = [ + "-fexceptions", + "-fPIC", + "-std=gnu++14", + ], + force_static = True, + visibility = [ + "PUBLIC", + ], +) diff --git a/deps/jsr-305/BUCK b/deps/jsr-305/BUCK index f3a54e3bd..33094a1e9 100644 --- a/deps/jsr-305/BUCK +++ b/deps/jsr-305/BUCK @@ -1,16 +1,13 @@ -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_maven_library") -if not THIS_IS_FBANDROID: - load("//buck_imports:maven_library", "maven_library") - - maven_library( - name = "jsr-305", - artifact = "jsr305", - group = "com.google.code.findbugs", - scope = "provided", - sha1 = "5871fb60dc68d67da54a663c3fd636a10a532948", - version = "3.0.0", - visibility = [ - "PUBLIC", - ], - ) +profilo_oss_maven_library( + name = "jsr-305", + artifact = "jsr305", + group = "com.google.code.findbugs", + scope = "provided", + sha1 = "5871fb60dc68d67da54a663c3fd636a10a532948", + version = "3.0.0", + visibility = [ + "PUBLIC", + ], +) diff --git a/deps/keystore/BUCK b/deps/keystore/BUCK index 50908d312..728ca2b85 100644 --- a/deps/keystore/BUCK +++ b/deps/keystore/BUCK @@ -1,11 +1,8 @@ -load("//build_defs:fb_java_library.bzl", "fb_java_library") +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_java_library") -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID - -if not THIS_IS_FBANDROID: - fb_java_library( - name = "debug", - visibility = [ - "PUBLIC", - ], - ) +profilo_oss_java_library( + name = "debug", + visibility = [ + "PUBLIC", + ], +) diff --git a/deps/linker/BUCK b/deps/linker/BUCK index d9efec932..2b31a013e 100644 --- a/deps/linker/BUCK +++ b/deps/linker/BUCK @@ -1,26 +1,30 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_cxx_library") -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID - -if not THIS_IS_FBANDROID: - cxx_library( - name = "linker", - srcs = [ - "linker.cpp", - ], - header_namespace = "linker", - exported_headers = glob(["*.h"]), - preferred_linkage = "static", - visibility = [ - "PUBLIC", - ], - platform_preprocessor_flags = [ - ("android-arm", ["-D__ARM__"]), - ("android-x86", ["-D__X86__"]), - ], - deps = [ - profilo_path("deps/cjni:cjni"), - profilo_path("deps/sig_safe_write:sig_safe_write"), - profilo_path("deps/sigmux:sigmux"), - ], - ) +profilo_oss_cxx_library( + name = "linker", + srcs = [ + "linker.cpp", + ], + header_namespace = "linker", + exported_headers = glob(["*.h"]), + platform_preprocessor_flags = [ + ( + "android-arm", + ["-D__ARM__"], + ), + ( + "android-x86", + ["-D__X86__"], + ), + ], + preferred_linkage = "static", + visibility = [ + "PUBLIC", + ], + deps = [ + profilo_path("deps/cjni:cjni"), + profilo_path("deps/sig_safe_write:sig_safe_write"), + profilo_path("deps/sigmux:sigmux"), + ], +) diff --git a/deps/lss/BUCK b/deps/lss/BUCK index f870b4794..a901beaa7 100644 --- a/deps/lss/BUCK +++ b/deps/lss/BUCK @@ -1,13 +1,12 @@ -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_cxx_library") -if not THIS_IS_FBANDROID: - cxx_library( - name = "linux-syscall-support", - exported_headers = [ - "linux_syscall_support.h", - ], - header_namespace = "", - visibility = [ - "PUBLIC", - ], - ) +profilo_oss_cxx_library( + name = "linux-syscall-support", + header_namespace = "", + exported_headers = [ + "linux_syscall_support.h", + ], + visibility = [ + "PUBLIC", + ], +) diff --git a/deps/museum/5.1.1/BUCK b/deps/museum/5.1.1/BUCK index 764067dad..dc0f412e8 100644 --- a/deps/museum/5.1.1/BUCK +++ b/deps/museum/5.1.1/BUCK @@ -1,60 +1,57 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") -load("//build_defs:fb_xplat_cxx.bzl", "fb_xplat_cxx_library") +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_xplat_cxx_library") -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID +profilo_oss_xplat_cxx_library( + name = "5.1.1-headers", + header_namespace = "", + exported_headers = glob([ + "**/*.h", + ]), + # See README.facebook for why we define the art preprocessor macro + exported_preprocessor_flags = [ + "-Dart=art_5_1_1", + "-Dprivate=public", + "-D__STDC_FORMAT_MACROS", + "-DART_DEFAULT_GC_TYPE_IS_CMS", + "-DIMT_SIZE=64", + "-DBUILDING_LIBART", + "-Wno-unused-local-typedefs", + ], + visibility = [ + profilo_path("..."), + ], +) -if not THIS_IS_FBANDROID: - fb_xplat_cxx_library( - name = "5.1.1-headers", - header_namespace = "", - exported_headers = glob([ - "**/*.h", - ]), - # See README.facebook for why we define the art preprocessor macro - exported_preprocessor_flags = [ - "-Dart=art_5_1_1", - "-Dprivate=public", - "-D__STDC_FORMAT_MACROS", - "-DART_DEFAULT_GC_TYPE_IS_CMS", - "-DIMT_SIZE=64", - "-DBUILDING_LIBART", - "-Wno-unused-local-typedefs", - ], - visibility = [ - profilo_path("..."), - ], - ) - - fb_xplat_cxx_library( - name = "5.1.1", - srcs = glob( - ["**/*.cc"], - ), - header_namespace = "", - compiler_flags = [ - "-fvisibility=hidden", - "-fexceptions", - "-fpack-struct=4", - "-frtti", - "-g", - "-Os", - "-Wextra", - "-Wno-unused-parameter", - "-Wno-format-security", - "-Wno-unused", - "-Wno-missing-field-initializers", - "-Wno-pmf-conversions", - "-Wno-inconsistent-missing-override", - "-Wno-unknown-warning-option", - ], - exported_deps = [ - ":5.1.1-headers", - ], - force_static = True, - visibility = [ - "PUBLIC", - ], - deps = [ - profilo_path("deps/museum:museum"), - ], - ) +profilo_oss_xplat_cxx_library( + name = "5.1.1", + srcs = glob( + ["**/*.cc"], + ), + header_namespace = "", + compiler_flags = [ + "-fvisibility=hidden", + "-fexceptions", + "-fpack-struct=4", + "-frtti", + "-g", + "-Os", + "-Wextra", + "-Wno-unused-parameter", + "-Wno-format-security", + "-Wno-unused", + "-Wno-missing-field-initializers", + "-Wno-pmf-conversions", + "-Wno-inconsistent-missing-override", + "-Wno-unknown-warning-option", + ], + exported_deps = [ + ":5.1.1-headers", + ], + force_static = True, + visibility = [ + "PUBLIC", + ], + deps = [ + profilo_path("deps/museum:museum"), + ], +) diff --git a/deps/museum/6.0.1/BUCK b/deps/museum/6.0.1/BUCK index 361d5f2c3..6f9d28c01 100644 --- a/deps/museum/6.0.1/BUCK +++ b/deps/museum/6.0.1/BUCK @@ -1,60 +1,57 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") -load("//build_defs:fb_xplat_cxx.bzl", "fb_xplat_cxx_library") +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_xplat_cxx_library") -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID +profilo_oss_xplat_cxx_library( + name = "6.0.1-headers", + header_namespace = "", + exported_headers = glob([ + "**/*.h", + ]), + # See README.facebook for why we define the art preprocessor macro + exported_preprocessor_flags = [ + "-Dart=art_6_0_1", + "-Dprivate=public", + "-D__STDC_FORMAT_MACROS", + "-DART_DEFAULT_GC_TYPE_IS_CMS", + "-DIMT_SIZE=64", + "-DBUILDING_LIBART", + "-Wno-unused-local-typedefs", + ], + visibility = [ + profilo_path("..."), + ], +) -if not THIS_IS_FBANDROID: - fb_xplat_cxx_library( - name = "6.0.1-headers", - header_namespace = "", - exported_headers = glob([ - "**/*.h", - ]), - # See README.facebook for why we define the art preprocessor macro - exported_preprocessor_flags = [ - "-Dart=art_6_0_1", - "-Dprivate=public", - "-D__STDC_FORMAT_MACROS", - "-DART_DEFAULT_GC_TYPE_IS_CMS", - "-DIMT_SIZE=64", - "-DBUILDING_LIBART", - "-Wno-unused-local-typedefs", - ], - visibility = [ - profilo_path("..."), - ], - ) - - fb_xplat_cxx_library( - name = "6.0.1", - srcs = glob( - ["**/*.cc"], - ), - header_namespace = "", - compiler_flags = [ - "-fvisibility=hidden", - "-fexceptions", - "-fpack-struct=4", - "-frtti", - "-g", - "-Os", - "-Wextra", - "-Wno-unused-parameter", - "-Wno-format-security", - "-Wno-unused", - "-Wno-missing-field-initializers", - "-Wno-pmf-conversions", - "-Wno-inconsistent-missing-override", - "-Wno-unknown-warning-option", - ], - exported_deps = [ - ":6.0.1-headers", - ], - force_static = True, - visibility = [ - "PUBLIC", - ], - deps = [ - profilo_path("deps/museum:museum"), - ], - ) +profilo_oss_xplat_cxx_library( + name = "6.0.1", + srcs = glob( + ["**/*.cc"], + ), + header_namespace = "", + compiler_flags = [ + "-fvisibility=hidden", + "-fexceptions", + "-fpack-struct=4", + "-frtti", + "-g", + "-Os", + "-Wextra", + "-Wno-unused-parameter", + "-Wno-format-security", + "-Wno-unused", + "-Wno-missing-field-initializers", + "-Wno-pmf-conversions", + "-Wno-inconsistent-missing-override", + "-Wno-unknown-warning-option", + ], + exported_deps = [ + ":6.0.1-headers", + ], + force_static = True, + visibility = [ + "PUBLIC", + ], + deps = [ + profilo_path("deps/museum:museum"), + ], +) diff --git a/deps/museum/7.0.0/BUCK b/deps/museum/7.0.0/BUCK index 0fefd5267..3bc790a13 100644 --- a/deps/museum/7.0.0/BUCK +++ b/deps/museum/7.0.0/BUCK @@ -1,60 +1,57 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") -load("//build_defs:fb_xplat_cxx.bzl", "fb_xplat_cxx_library") +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_xplat_cxx_library") -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID +profilo_oss_xplat_cxx_library( + name = "7.0.0-headers", + header_namespace = "", + exported_headers = glob([ + "**/*.h", + ]), + # See README.facebook for why we define the art preprocessor macro + exported_preprocessor_flags = [ + "-Dart=art_7_0_0", + "-Dprivate=public", + "-D__STDC_FORMAT_MACROS", + "-DART_DEFAULT_GC_TYPE_IS_CMS", + "-DIMT_SIZE=64", + "-DBUILDING_LIBART", + "-Wno-unused-local-typedefs", + ], + visibility = [ + profilo_path("..."), + ], +) -if not THIS_IS_FBANDROID: - fb_xplat_cxx_library( - name = "7.0.0-headers", - header_namespace = "", - exported_headers = glob([ - "**/*.h", - ]), - # See README.facebook for why we define the art preprocessor macro - exported_preprocessor_flags = [ - "-Dart=art_7_0_0", - "-Dprivate=public", - "-D__STDC_FORMAT_MACROS", - "-DART_DEFAULT_GC_TYPE_IS_CMS", - "-DIMT_SIZE=64", - "-DBUILDING_LIBART", - "-Wno-unused-local-typedefs", - ], - visibility = [ - profilo_path("..."), - ], - ) - - fb_xplat_cxx_library( - name = "7.0.0", - srcs = glob( - ["**/*.cc"], - ), - header_namespace = "", - compiler_flags = [ - "-fvisibility=hidden", - "-fexceptions", - "-fpack-struct=4", - "-frtti", - "-g", - "-Os", - "-Wextra", - "-Wno-unused-parameter", - "-Wno-format-security", - "-Wno-unused", - "-Wno-missing-field-initializers", - "-Wno-pmf-conversions", - "-Wno-inconsistent-missing-override", - "-Wno-unknown-warning-option", - ], - exported_deps = [ - ":7.0.0-headers", - ], - force_static = True, - visibility = [ - "PUBLIC", - ], - deps = [ - profilo_path("deps/museum:museum"), - ], - ) +profilo_oss_xplat_cxx_library( + name = "7.0.0", + srcs = glob( + ["**/*.cc"], + ), + header_namespace = "", + compiler_flags = [ + "-fvisibility=hidden", + "-fexceptions", + "-fpack-struct=4", + "-frtti", + "-g", + "-Os", + "-Wextra", + "-Wno-unused-parameter", + "-Wno-format-security", + "-Wno-unused", + "-Wno-missing-field-initializers", + "-Wno-pmf-conversions", + "-Wno-inconsistent-missing-override", + "-Wno-unknown-warning-option", + ], + exported_deps = [ + ":7.0.0-headers", + ], + force_static = True, + visibility = [ + "PUBLIC", + ], + deps = [ + profilo_path("deps/museum:museum"), + ], +) diff --git a/deps/museum/BUCK b/deps/museum/BUCK index bbdd070fc..5895f0d2d 100644 --- a/deps/museum/BUCK +++ b/deps/museum/BUCK @@ -1,38 +1,36 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_xplat_cxx_library") -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID - -if not THIS_IS_FBANDROID: - fb_xplat_cxx_library( - name = "museum", - srcs = glob( - ["*.cpp"], - ), - headers = glob( - ["*.h"], - ), - header_namespace = "museum", - exported_headers = glob( - ["*.h"], - ), - compiler_flags = [ - "-std=gnu++14", - "-fvisibility=hidden", - "-fexceptions", - "-Wextra", - "-Wno-unused-parameter", - "-Wno-format-security", - "-Wno-unused-local-typedef", - "-Wno-unused", - "-Wno-missing-field-initializers", - "-Wno-gnu-alignof-expression", - "-O3", - ], - preferred_linkage = "static", - deps = [ - profilo_path("deps/cppdistract:cppdistract"), - ], - visibility = [ - "PUBLIC", - ], - ) +profilo_oss_xplat_cxx_library( + name = "museum", + srcs = glob( + ["*.cpp"], + ), + headers = glob( + ["*.h"], + ), + header_namespace = "museum", + exported_headers = glob( + ["*.h"], + ), + compiler_flags = [ + "-std=gnu++14", + "-fvisibility=hidden", + "-fexceptions", + "-Wextra", + "-Wno-unused-parameter", + "-Wno-format-security", + "-Wno-unused-local-typedef", + "-Wno-unused", + "-Wno-missing-field-initializers", + "-Wno-gnu-alignof-expression", + "-O3", + ], + preferred_linkage = "static", + visibility = [ + "PUBLIC", + ], + deps = [ + profilo_path("deps/cppdistract:cppdistract"), + ], +) diff --git a/deps/proguard/BUCK b/deps/proguard/BUCK index 1d51b80e4..6594082fd 100644 --- a/deps/proguard/BUCK +++ b/deps/proguard/BUCK @@ -1,20 +1,17 @@ -load("//build_defs:fb_java_library.bzl", "fb_java_library") +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_java_library") -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID +profilo_oss_java_library( + name = "annotations", + srcs = ["DoNotStrip.java"], + visibility = [ + "PUBLIC", + ], +) -if not THIS_IS_FBANDROID: - fb_java_library( - name = "annotations", - srcs = ["DoNotStrip.java"], - visibility = [ - "PUBLIC", - ], - ) - - fb_java_library( - name = "annotations-jni", - srcs = ["jni/DoNotStrip.java"], - visibility = [ - "PUBLIC", - ], - ) +profilo_oss_java_library( + name = "annotations-jni", + srcs = ["jni/DoNotStrip.java"], + visibility = [ + "PUBLIC", + ], +) diff --git a/deps/sig_safe_write/BUCK b/deps/sig_safe_write/BUCK index 62dbdc2e1..41bc09608 100644 --- a/deps/sig_safe_write/BUCK +++ b/deps/sig_safe_write/BUCK @@ -1,22 +1,20 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_cxx_library") -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID - -if not THIS_IS_FBANDROID: - cxx_library( - name = "sig_safe_write", - srcs = [ - "sig_safe_write.c", - ], - header_namespace = "sig_safe_write", - exported_headers = [ - "sig_safe_write.h", - ], - preferred_linkage = "static", - visibility = [ - "PUBLIC", - ], - deps = [ - profilo_path("deps/sigmux:sigmux"), - ], - ) +profilo_oss_cxx_library( + name = "sig_safe_write", + srcs = [ + "sig_safe_write.c", + ], + header_namespace = "sig_safe_write", + exported_headers = [ + "sig_safe_write.h", + ], + preferred_linkage = "static", + visibility = [ + "PUBLIC", + ], + deps = [ + profilo_path("deps/sigmux:sigmux"), + ], +) diff --git a/deps/sigmux/BUCK b/deps/sigmux/BUCK index b2a82112f..4653f29d7 100644 --- a/deps/sigmux/BUCK +++ b/deps/sigmux/BUCK @@ -1,27 +1,25 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_cxx_library") -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID - -if not THIS_IS_FBANDROID: - cxx_library( - name = "sigmux", - exported_headers = [ - "sigmux.h", - ], - srcs = [ - "sigmux.c", - "phaser.c", - ], - header_namespace = "", - headers = [ - "phaser.h", - ], - soname = "libsigmux.$(ext)", - preferred_linkage = "shared", - visibility = [ - "PUBLIC", - ], - deps = [ - profilo_path("deps/lss:linux-syscall-support"), - ], - ) +profilo_oss_cxx_library( + name = "sigmux", + srcs = [ + "phaser.c", + "sigmux.c", + ], + headers = [ + "phaser.h", + ], + header_namespace = "", + exported_headers = [ + "sigmux.h", + ], + preferred_linkage = "shared", + soname = "libsigmux.$(ext)", + visibility = [ + "PUBLIC", + ], + deps = [ + profilo_path("deps/lss:linux-syscall-support"), + ], +) diff --git a/deps/soloader/BUCK b/deps/soloader/BUCK index 4d5312bb4..e3d011090 100644 --- a/deps/soloader/BUCK +++ b/deps/soloader/BUCK @@ -1,17 +1,14 @@ -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_maven_library") -if not THIS_IS_FBANDROID: - load("//buck_imports:maven_library", "maven_library") - - maven_library( - name = "soloader", - artifact = "soloader", - group = "com.facebook.soloader", - scope = "compile", - packaging = "aar", - sha1 = "2f27b33862c38f8197536a189f7a8f0be0839561", - version = "0.2.0", - visibility = [ - "PUBLIC", - ], - ) +profilo_oss_maven_library( + name = "soloader", + artifact = "soloader", + group = "com.facebook.soloader", + packaging = "aar", + scope = "compile", + sha1 = "2f27b33862c38f8197536a189f7a8f0be0839561", + version = "0.2.0", + visibility = [ + "PUBLIC", + ], +) diff --git a/deps/xplat_init/BUCK b/deps/xplat_init/BUCK index 546f2d1b9..c38e36665 100644 --- a/deps/xplat_init/BUCK +++ b/deps/xplat_init/BUCK @@ -1,22 +1,20 @@ load("//buck_imports:profilo_path.bzl", "profilo_path") +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_cxx_library") -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID - -if not THIS_IS_FBANDROID: - cxx_library( - name = "xplat_init", - exported_headers = [ - "xplat_init.h", - ], - srcs = [ - "xplat_init.cpp", - ], - header_namespace = "fb", - preferred_linkage = "static", - visibility = [ - "PUBLIC", - ], - deps = [ - profilo_path("deps/fbjni:fbjni"), - ], - ) +profilo_oss_cxx_library( + name = "xplat_init", + srcs = [ + "xplat_init.cpp", + ], + header_namespace = "fb", + exported_headers = [ + "xplat_init.h", + ], + preferred_linkage = "static", + visibility = [ + "PUBLIC", + ], + deps = [ + profilo_path("deps/fbjni:fbjni"), + ], +) diff --git a/deps/zip/BUCK b/deps/zip/BUCK index 30bc6d4af..829e9ad2b 100644 --- a/deps/zip/BUCK +++ b/deps/zip/BUCK @@ -1,12 +1,11 @@ -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_android_library") -if not THIS_IS_FBANDROID: - android_library( - name = "zip", - srcs = [ - "ZipHelper.java", - ], - visibility = [ - "PUBLIC", - ], - ) +profilo_oss_android_library( + name = "zip", + srcs = [ + "ZipHelper.java", + ], + visibility = [ + "PUBLIC", + ], +) diff --git a/deps/zstr/BUCK b/deps/zstr/BUCK index 25e5202d9..cbae56219 100644 --- a/deps/zstr/BUCK +++ b/deps/zstr/BUCK @@ -1,20 +1,19 @@ -include_defs("//build_defs/fb_xplat_cxx.bzl") # THIS_IS_FBANDROID +load("//build_defs:profilo_oss_defs.bzl", "profilo_oss_cxx_library") -if not THIS_IS_FBANDROID: - cxx_library( - name = "zstr", - header_namespace = "zstr", - exported_headers = subdir_glob([ - ("src", "strict_fstream.hpp"), - ("src", "zstr.hpp"), - ]), - exported_linker_flags = [ - "-lz", - ], - licenses = [ - "LICENSE", - ], - visibility = [ - "PUBLIC", - ], - ) +profilo_oss_cxx_library( + name = "zstr", + header_namespace = "zstr", + exported_headers = subdir_glob([ + ("src", "strict_fstream.hpp"), + ("src", "zstr.hpp"), + ]), + exported_linker_flags = [ + "-lz", + ], + licenses = [ + "LICENSE", + ], + visibility = [ + "PUBLIC", + ], +)