From 7d5383eea89c8addcc553ab52b2db9e908ebab2f Mon Sep 17 00:00:00 2001 From: David Vacca Date: Fri, 7 Aug 2020 19:45:52 -0700 Subject: [PATCH] Extend 'textlayoutmanager' module to compile in OSS Summary: This diff extends the 'textlayoutmanager' module to compile in OSS As part of this diff I also moved Android files in order to make the module compatible with Android.mk system changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D22963706 fbshipit-source-id: 14a7309f589fe12c21131c7d5cef02b4323d4a93 --- .../src/main/jni/react/jni/Android.mk | 21 +--------- .../renderer/textlayoutmanager/Android.mk | 40 +++++++++++++++++++ .../react/renderer/textlayoutmanager/BUCK | 6 +-- .../textlayoutmanager}/TextLayoutManager.cpp | 0 .../textlayoutmanager}/TextLayoutManager.h | 0 5 files changed, 44 insertions(+), 23 deletions(-) create mode 100644 ReactCommon/react/renderer/textlayoutmanager/Android.mk rename ReactCommon/react/renderer/textlayoutmanager/platform/android/{ => react/renderer/textlayoutmanager}/TextLayoutManager.cpp (100%) rename ReactCommon/react/renderer/textlayoutmanager/platform/android/{ => react/renderer/textlayoutmanager}/TextLayoutManager.h (100%) diff --git a/ReactAndroid/src/main/jni/react/jni/Android.mk b/ReactAndroid/src/main/jni/react/jni/Android.mk index 4d566ebbbcf..b50eefee9ce 100644 --- a/ReactAndroid/src/main/jni/react/jni/Android.mk +++ b/ReactAndroid/src/main/jni/react/jni/Android.mk @@ -22,7 +22,7 @@ LOCAL_CFLAGS += -fexceptions -frtti -Wno-unused-lambda-capture LOCAL_LDLIBS += -landroid # The dynamic libraries (.so files) that this module depends on. -LOCAL_SHARED_LIBRARIES := libfolly_json libfb libfbjni libglog_init libyoga libreact_utils libreact_render_debug libreact_render_graphics libreact_render_core libreact_render_mapbuffer react_render_componentregistry libreact_render_components_view libreact_render_components_view libreact_render_components_unimplementedview libreact_render_components_root libreact_render_components_scrollview libbetter libreact_render_attributedstring libreact_render_uimanager libreact_render_templateprocessor libreact_render_scheduler react_render_animations react_render_imagemanager +LOCAL_SHARED_LIBRARIES := libfolly_json libfb libfbjni libglog_init libyoga # The static libraries (.a files) that this module depends on. LOCAL_STATIC_LIBRARIES := libreactnative libcallinvokerholder libruntimeexecutor @@ -74,25 +74,6 @@ $(call import-module,reactperflogger) $(call import-module,hermes) $(call import-module,runtimeexecutor) -# Fabric: -$(call import-module,react/utils) -$(call import-module,react/renderer/animations) -$(call import-module,react/renderer/attributedstring) -$(call import-module,react/renderer/componentregistry) -$(call import-module,react/renderer/core) -$(call import-module,react/renderer/components/root) -$(call import-module,react/renderer/components/scrollview) -$(call import-module,react/renderer/components/unimplementedview) -$(call import-module,react/renderer/components/view) -$(call import-module,react/renderer/debug) -$(call import-module,react/renderer/graphics) -$(call import-module,react/renderer/imagemanager) -$(call import-module,react/renderer/mapbuffer) -$(call import-module,react/renderer/mounting) -$(call import-module,react/renderer/scheduler) -$(call import-module,react/renderer/templateprocessor) -$(call import-module,react/renderer/uimanager) - include $(REACT_SRC_DIR)/reactperflogger/jni/Android.mk include $(REACT_SRC_DIR)/turbomodule/core/jni/Android.mk diff --git a/ReactCommon/react/renderer/textlayoutmanager/Android.mk b/ReactCommon/react/renderer/textlayoutmanager/Android.mk new file mode 100644 index 00000000000..aacae6e76af --- /dev/null +++ b/ReactCommon/react/renderer/textlayoutmanager/Android.mk @@ -0,0 +1,40 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := react_render_textlayoutmanager + +LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp $(LOCAL_PATH)/platform/android/react/renderer/textlayoutmanager/*.cpp) + +LOCAL_SHARED_LIBRARIES := libreactnativejni libreact_utils libfb libfbjni libreact_render_uimanager libreact_render_componentregistry libreact_render_attributedstring libfolly_json libyoga libfolly_json libreact_render_core libreact_render_debug libreact_render_graphics + +LOCAL_STATIC_LIBRARIES := + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../ $(LOCAL_PATH)/platform/cxx/android/ + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../ $(LOCAL_PATH)/platform/cxx/android/ + +LOCAL_CFLAGS := \ + -DLOG_TAG=\"Fabric\" + +LOCAL_CFLAGS += -fexceptions -frtti -std=c++14 -Wall + +include $(BUILD_SHARED_LIBRARY) + +$(call import-module,glog) +$(call import-module,fbjni) +$(call import-module,fb) +$(call import-module,folly) +$(call import-module,react/renderer/componentregistry) +$(call import-module,react/renderer/core) +$(call import-module,react/renderer/attributedstring) +$(call import-module,react/renderer/debug) +$(call import-module,react/renderer/graphics) +$(call import-module,react/renderer/uimanager) +$(call import-module,react/utils) +$(call import-module,yogajni) diff --git a/ReactCommon/react/renderer/textlayoutmanager/BUCK b/ReactCommon/react/renderer/textlayoutmanager/BUCK index 3d8d3358d6a..6b1fa35b904 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/BUCK +++ b/ReactCommon/react/renderer/textlayoutmanager/BUCK @@ -65,19 +65,19 @@ rn_xplat_cxx_library( ], fbandroid_exported_headers = subdir_glob( [ - ("platform/android", "*.h"), + ("platform/android/react/renderer/textlayoutmanager", "**/*.h"), ], prefix = "react/renderer/textlayoutmanager", ), fbandroid_headers = subdir_glob( [ - ("platform/android", "**/*.h"), + ("platform/android/react/renderer/textlayoutmanager", "**/*.h"), ], prefix = "", ), fbandroid_srcs = glob( [ - "platform/android/**/*.cpp", + "platform/android/react/renderer/textlayoutmanager/**/*.cpp", ], ), fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, diff --git a/ReactCommon/react/renderer/textlayoutmanager/platform/android/TextLayoutManager.cpp b/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp similarity index 100% rename from ReactCommon/react/renderer/textlayoutmanager/platform/android/TextLayoutManager.cpp rename to ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp diff --git a/ReactCommon/react/renderer/textlayoutmanager/platform/android/TextLayoutManager.h b/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.h similarity index 100% rename from ReactCommon/react/renderer/textlayoutmanager/platform/android/TextLayoutManager.h rename to ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.h