react-native-reanimated 2.12.0 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +1 -0
  2. package/Common/cpp/Tools/ReanimatedVersion.cpp +17 -0
  3. package/Common/cpp/Tools/ReanimatedVersion.h +11 -0
  4. package/RNReanimated.podspec +2 -1
  5. package/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
  6. package/android/.gradle/7.5.1/checksums/md5-checksums.bin +0 -0
  7. package/android/.gradle/7.5.1/checksums/sha1-checksums.bin +0 -0
  8. package/android/.gradle/7.5.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  9. package/android/.gradle/7.5.1/executionHistory/executionHistory.bin +0 -0
  10. package/android/.gradle/7.5.1/executionHistory/executionHistory.lock +0 -0
  11. package/android/.gradle/7.5.1/fileHashes/fileHashes.bin +0 -0
  12. package/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
  13. package/android/.gradle/7.5.1/fileHashes/resourceHashesCache.bin +0 -0
  14. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  15. package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
  16. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  17. package/android/.gradle/file-system.probe +0 -0
  18. package/android/CMakeLists.txt +192 -189
  19. package/android/build.gradle +395 -317
  20. package/android/react-native-reanimated-67-hermes.aar +0 -0
  21. package/android/react-native-reanimated-67-jsc.aar +0 -0
  22. package/android/react-native-reanimated-68-hermes.aar +0 -0
  23. package/android/react-native-reanimated-68-jsc.aar +0 -0
  24. package/android/react-native-reanimated-69-hermes.aar +0 -0
  25. package/android/react-native-reanimated-69-jsc.aar +0 -0
  26. package/android/react-native-reanimated-70-hermes.aar +0 -0
  27. package/android/react-native-reanimated-70-jsc.aar +0 -0
  28. package/android/react-native-reanimated-71-hermes.aar +0 -0
  29. package/android/react-native-reanimated-71-jsc.aar +0 -0
  30. package/android/src/main/cpp/NativeProxy.cpp +8 -0
  31. package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +5 -4
  32. package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorContainer.java +1 -1
  33. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/70/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +16 -0
  34. package/android/src/{main/java → reactNativeVersionPatch/ReanimatedUIManager/70}/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +0 -0
  35. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +63 -0
  36. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +271 -0
  37. package/android/src/reactNativeVersionPatch/nativeHierarchyManager/latest/com/swmansion/reanimated/layoutReanimation/ReanimatedNativeHierarchyManager.java +3 -30
  38. package/ios/REAModule.mm +11 -7
  39. package/ios/native/REAInitializer.mm +4 -0
  40. package/lib/createAnimatedComponent.js +5 -0
  41. package/lib/reanimated2/Colors.js +27 -11
  42. package/lib/reanimated2/NativeReanimated/NativeReanimated.js +4 -0
  43. package/lib/reanimated2/animation/util.js +15 -15
  44. package/lib/reanimated2/globals.d.ts +2 -0
  45. package/lib/reanimated2/interpolateColor.js +79 -20
  46. package/lib/reanimated2/jestUtils.js +14 -7
  47. package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +16 -18
  48. package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +8 -10
  49. package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +15 -10
  50. package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +8 -10
  51. package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +24 -18
  52. package/lib/reanimated2/platform-specific/checkVersion.js +24 -0
  53. package/lib/reanimated2/platform-specific/checkVersion.web.js +6 -0
  54. package/lib/types/{Animated.d.ts → lib/Animated.d.ts} +0 -0
  55. package/lib/types/{ConfigHelper.d.ts → lib/ConfigHelper.d.ts} +0 -0
  56. package/lib/types/{ReanimatedEventEmitter.d.ts → lib/ReanimatedEventEmitter.d.ts} +0 -0
  57. package/lib/types/{ReanimatedModule.d.ts → lib/ReanimatedModule.d.ts} +0 -0
  58. package/lib/types/{ReanimatedModule.macos.d.ts → lib/ReanimatedModule.macos.d.ts} +0 -0
  59. package/lib/types/{ReanimatedModule.native.d.ts → lib/ReanimatedModule.native.d.ts} +0 -0
  60. package/lib/types/{ReanimatedModule.windows.d.ts → lib/ReanimatedModule.windows.d.ts} +0 -0
  61. package/lib/types/{ReanimatedModuleCompat.d.ts → lib/ReanimatedModuleCompat.d.ts} +0 -0
  62. package/lib/types/{createAnimatedComponent.d.ts → lib/createAnimatedComponent.d.ts} +0 -0
  63. package/lib/types/{index.d.ts → lib/index.d.ts} +0 -0
  64. package/lib/types/{index.web.d.ts → lib/index.web.d.ts} +0 -0
  65. package/lib/types/{reanimated2 → lib/reanimated2}/Bezier.d.ts +0 -0
  66. package/lib/types/{reanimated2 → lib/reanimated2}/Colors.d.ts +5 -3
  67. package/lib/types/{reanimated2 → lib/reanimated2}/Easing.d.ts +0 -0
  68. package/lib/types/{reanimated2 → lib/reanimated2}/NativeMethods.d.ts +0 -0
  69. package/lib/types/{reanimated2 → lib/reanimated2}/NativeReanimated/NativeReanimated.d.ts +0 -0
  70. package/lib/types/{reanimated2 → lib/reanimated2}/NativeReanimated/index.d.ts +0 -0
  71. package/lib/types/{reanimated2 → lib/reanimated2}/PlatformChecker.d.ts +0 -0
  72. package/lib/types/{reanimated2 → lib/reanimated2}/PropAdapters.d.ts +0 -0
  73. package/lib/types/{reanimated2 → lib/reanimated2}/UpdateProps.d.ts +0 -0
  74. package/lib/types/{reanimated2 → lib/reanimated2}/ViewDescriptorsSet.d.ts +0 -0
  75. package/lib/types/{reanimated2 → lib/reanimated2}/WorkletEventHandler.d.ts +0 -0
  76. package/lib/types/{reanimated2 → lib/reanimated2}/__mocks__/MutableValue.d.ts +0 -0
  77. package/lib/types/{reanimated2 → lib/reanimated2}/__mocks__/NativeReanimated.d.ts +0 -0
  78. package/lib/types/{reanimated2 → lib/reanimated2}/animation/commonTypes.d.ts +0 -0
  79. package/lib/types/{reanimated2 → lib/reanimated2}/animation/decay.d.ts +0 -0
  80. package/lib/types/{reanimated2 → lib/reanimated2}/animation/delay.d.ts +0 -0
  81. package/lib/types/{reanimated2 → lib/reanimated2}/animation/index.d.ts +0 -0
  82. package/lib/types/{reanimated2 → lib/reanimated2}/animation/repeat.d.ts +0 -0
  83. package/lib/types/{reanimated2 → lib/reanimated2}/animation/sequence.d.ts +0 -0
  84. package/lib/types/{reanimated2 → lib/reanimated2}/animation/spring.d.ts +0 -0
  85. package/lib/types/{reanimated2 → lib/reanimated2}/animation/styleAnimation.d.ts +0 -0
  86. package/lib/types/{reanimated2 → lib/reanimated2}/animation/timing.d.ts +0 -0
  87. package/lib/types/{reanimated2 → lib/reanimated2}/animation/util.d.ts +0 -0
  88. package/lib/types/{reanimated2 → lib/reanimated2}/commonTypes.d.ts +0 -0
  89. package/lib/types/{reanimated2 → lib/reanimated2}/component/FlatList.d.ts +0 -0
  90. package/lib/types/{reanimated2 → lib/reanimated2}/component/Image.d.ts +0 -0
  91. package/lib/types/{reanimated2 → lib/reanimated2}/component/ScrollView.d.ts +0 -0
  92. package/lib/types/{reanimated2 → lib/reanimated2}/component/Text.d.ts +0 -0
  93. package/lib/types/{reanimated2 → lib/reanimated2}/component/View.d.ts +0 -0
  94. package/lib/types/{reanimated2 → lib/reanimated2}/core.d.ts +0 -0
  95. package/lib/types/{reanimated2 → lib/reanimated2}/frameCallback/FrameCallbackRegistryJS.d.ts +0 -0
  96. package/lib/types/{reanimated2 → lib/reanimated2}/frameCallback/FrameCallbackRegistryUI.d.ts +0 -0
  97. package/lib/types/{reanimated2 → lib/reanimated2}/hook/Hooks.d.ts +0 -0
  98. package/lib/types/{reanimated2 → lib/reanimated2}/hook/commonTypes.d.ts +0 -0
  99. package/lib/types/{reanimated2 → lib/reanimated2}/hook/index.d.ts +0 -0
  100. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedGestureHandler.d.ts +0 -0
  101. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedKeyboard.d.ts +0 -0
  102. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedReaction.d.ts +0 -0
  103. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedRef.d.ts +0 -0
  104. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedScrollHandler.d.ts +0 -0
  105. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedSensor.d.ts +0 -0
  106. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedStyle.d.ts +0 -0
  107. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useDerivedValue.d.ts +0 -0
  108. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useFrameCallback.d.ts +0 -0
  109. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useScrollViewOffset.d.ts +0 -0
  110. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useSharedValue.d.ts +0 -0
  111. package/lib/types/{reanimated2 → lib/reanimated2}/hook/utils.d.ts +0 -0
  112. package/lib/types/{reanimated2 → lib/reanimated2}/index.d.ts +0 -0
  113. package/lib/types/{reanimated2 → lib/reanimated2}/interpolateColor.d.ts +8 -2
  114. package/lib/types/{reanimated2 → lib/reanimated2}/interpolation.d.ts +0 -0
  115. package/lib/types/{reanimated2 → lib/reanimated2}/jestUtils.d.ts +0 -0
  116. package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/JSReanimated.d.ts +0 -0
  117. package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/Mapper.d.ts +0 -0
  118. package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/MapperRegistry.d.ts +0 -0
  119. package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/MutableValue.d.ts +0 -0
  120. package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/commonTypes.d.ts +0 -0
  121. package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/global.d.ts +0 -0
  122. package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/index.d.ts +0 -0
  123. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/LayoutAnimationRepository.d.ts +0 -0
  124. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +0 -0
  125. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +0 -0
  126. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/animationBuilder/Keyframe.d.ts +0 -0
  127. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/animationBuilder/commonTypes.d.ts +4 -0
  128. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/animationBuilder/index.d.ts +0 -0
  129. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Bounce.d.ts +0 -0
  130. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Default.d.ts +0 -0
  131. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Fade.d.ts +0 -0
  132. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Flip.d.ts +0 -0
  133. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Lightspeed.d.ts +0 -0
  134. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Pinwheel.d.ts +0 -0
  135. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Roll.d.ts +0 -0
  136. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Rotate.d.ts +0 -0
  137. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Slide.d.ts +0 -0
  138. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Stretch.d.ts +0 -0
  139. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Zoom.d.ts +0 -0
  140. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/index.d.ts +0 -0
  141. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +0 -0
  142. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +0 -0
  143. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/FadingTransition.d.ts +0 -0
  144. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +0 -0
  145. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/LinearTransition.d.ts +0 -0
  146. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +0 -0
  147. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/index.d.ts +0 -0
  148. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/index.d.ts +0 -0
  149. package/lib/types/{reanimated2 → lib/reanimated2}/mock.d.ts +0 -0
  150. package/lib/types/{reanimated2 → lib/reanimated2}/platform-specific/RNRenderer.d.ts +0 -0
  151. package/lib/types/{reanimated2 → lib/reanimated2}/platform-specific/RNRenderer.web.d.ts +0 -0
  152. package/lib/types/lib/reanimated2/platform-specific/checkVersion.d.ts +4 -0
  153. package/lib/types/lib/reanimated2/platform-specific/checkVersion.web.d.ts +5 -0
  154. package/lib/types/{reanimated2 → lib/reanimated2}/utils.d.ts +0 -0
  155. package/lib/types/{setAndForwardRef.d.ts → lib/setAndForwardRef.d.ts} +0 -0
  156. package/package.json +8 -8
  157. package/plugin.js +7 -3
  158. package/react-native-reanimated.d.ts +11 -2
  159. package/scripts/reanimated_utils.rb +7 -3
  160. package/src/createAnimatedComponent.tsx +7 -0
  161. package/src/reanimated2/Colors.ts +38 -11
  162. package/src/reanimated2/NativeReanimated/NativeReanimated.ts +4 -0
  163. package/src/reanimated2/animation/util.ts +26 -15
  164. package/src/reanimated2/globals.d.ts +2 -0
  165. package/src/reanimated2/interpolateColor.ts +105 -21
  166. package/src/reanimated2/jestUtils.ts +14 -6
  167. package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +4 -0
  168. package/src/reanimated2/layoutReanimation/defaultAnimations/Bounce.ts +16 -19
  169. package/src/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.ts +14 -11
  170. package/src/reanimated2/layoutReanimation/defaultAnimations/Roll.ts +21 -11
  171. package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +32 -11
  172. package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +36 -19
  173. package/src/reanimated2/platform-specific/checkVersion.ts +28 -0
  174. package/src/reanimated2/platform-specific/checkVersion.web.ts +6 -0
  175. package/android/react-native-reanimated-66-hermes.aar +0 -0
  176. package/android/react-native-reanimated-66-jsc.aar +0 -0
@@ -3,6 +3,7 @@
3
3
  #include <memory>
4
4
  #include <thread>
5
5
  #include <unordered_map>
6
+ #include <utility>
6
7
 
7
8
  #include "EventHandlerRegistry.h"
8
9
  #include "FeaturesConfig.h"
@@ -0,0 +1,17 @@
1
+ #include "ReanimatedVersion.h"
2
+
3
+ #ifdef REANIMATED_VERSION
4
+ #define STRINGIZE(x) #x
5
+ #define STRINGIZE2(x) STRINGIZE(x)
6
+ #define REANIMATED_VERSION_STRING STRINGIZE2(REANIMATED_VERSION)
7
+ #endif // REANIMATED_VERSION
8
+
9
+ using namespace facebook;
10
+
11
+ namespace reanimated {
12
+
13
+ jsi::String getReanimatedVersionString(jsi::Runtime &rt) {
14
+ return jsi::String::createFromUtf8(rt, REANIMATED_VERSION_STRING);
15
+ }
16
+
17
+ }; // namespace reanimated
@@ -0,0 +1,11 @@
1
+ #pragma once
2
+
3
+ #include <jsi/jsi.h>
4
+
5
+ using namespace facebook;
6
+
7
+ namespace reanimated {
8
+
9
+ jsi::String getReanimatedVersionString(jsi::Runtime &rt);
10
+
11
+ };
@@ -10,6 +10,7 @@ folly_prefix = config[:react_native_minor_version] >= 64 ? 'RCT-' : ''
10
10
  folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DREACT_NATIVE_MINOR_VERSION=' + config[:react_native_minor_version].to_s
11
11
  folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
12
12
  boost_compiler_flags = '-Wno-documentation'
13
+ version_flag = '-DREANIMATED_VERSION=' + reanimated_package_json["version"]
13
14
 
14
15
  Pod::Spec.new do |s|
15
16
 
@@ -43,7 +44,7 @@ Pod::Spec.new do |s|
43
44
  s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
44
45
  s.xcconfig = {
45
46
  "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/#{folly_prefix}Folly\" \"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-hermes\" \"${PODS_ROOT}/Headers/Public/hermes-engine\" \"$(PODS_ROOT)/#{config[:react_native_common_dir]}\"",
46
- "OTHER_CFLAGS" => "$(inherited)" + " " + folly_flags
47
+ "OTHER_CFLAGS" => "$(inherited)" + " " + folly_flags + " " + version_flag
47
48
  }
48
49
 
49
50
  s.requires_arc = true
@@ -1,2 +1,2 @@
1
- #Thu Oct 27 10:05:12 UTC 2022
1
+ #Wed Jan 11 16:23:50 UTC 2023
2
2
  gradle.version=7.5.1
Binary file
@@ -3,20 +3,31 @@ cmake_minimum_required(VERSION 3.8)
3
3
 
4
4
  set (CMAKE_VERBOSE_MAKEFILE ON)
5
5
  set (CMAKE_CXX_STANDARD 17)
6
- set (DEFAULT_FLAGS "-DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_HAVE_MEMRCHR=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1 -DANDROID -DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION} -fexceptions -fno-omit-frame-pointer -frtti -Wno-sign-compare -std=c++17 -Wall -Werror")
7
- if(${IS_NEW_ARCHITECTURE_ENABLED})
8
- set (ALL_FLAGS "${DEFAULT_FLAGS} -DRCT_NEW_ARCH_ENABLED")
6
+
7
+ # default CMAKE_CXX_FLAGS: "-g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-protector-all"
8
+
9
+ if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71)
10
+ include("${REACT_NATIVE_DIR}/ReactAndroid/cmake-utils/folly-flags.cmake")
11
+ add_compile_options(${folly_FLAGS})
9
12
  else()
10
- set (ALL_FLAGS ${DEFAULT_FLAGS})
13
+ set(folly_FLAGS "-DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_HAVE_MEMRCHR=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1")
14
+ string(APPEND CMAKE_CXX_FLAGS " ${folly_FLAGS}")
11
15
  endif()
12
- if(${CMAKE_BUILD_TYPE} STREQUAL "Debug" AND NOT ${REANIMATED_PACKAGE_BUILD} STREQUAL "1")
13
- set (ALL_FLAGS "${ALL_FLAGS} -DDEBUG")
16
+
17
+ string(APPEND CMAKE_CXX_FLAGS " -DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION} -DREANIMATED_VERSION=${REANIMATED_VERSION} -DHERMES_ENABLE_DEBUGGER=${HERMES_ENABLE_DEBUGGER}")
18
+
19
+ string(APPEND CMAKE_CXX_FLAGS " -fexceptions -fno-omit-frame-pointer -frtti -fstack-protector-all -std=c++17 -Wall -Werror")
20
+
21
+ if(${IS_NEW_ARCHITECTURE_ENABLED})
22
+ string(APPEND CMAKE_CXX_FLAGS " -DRCT_NEW_ARCH_ENABLED")
14
23
  endif()
15
- set (CMAKE_CXX_FLAGS ${ALL_FLAGS})
16
24
 
17
25
  if(${CMAKE_BUILD_TYPE} STREQUAL "Debug" AND NOT ${REANIMATED_PACKAGE_BUILD} STREQUAL "1")
18
- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
19
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
26
+ string(APPEND CMAKE_CXX_FLAGS " -DDEBUG")
27
+ endif()
28
+
29
+ if(${REANIMATED_PACKAGE_BUILD} STREQUAL "1")
30
+ string(REPLACE "-g " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
20
31
  endif()
21
32
 
22
33
  set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
@@ -25,37 +36,39 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
25
36
  set (PACKAGE_NAME "reanimated")
26
37
  set (BUILD_DIR ${CMAKE_SOURCE_DIR}/build)
27
38
  set (SRC_DIR ${CMAKE_SOURCE_DIR}/src)
28
-
29
39
  set (COMMON_SRC_DIR "${CMAKE_SOURCE_DIR}/../Common")
30
- if(${IS_NEW_ARCHITECTURE_ENABLED})
31
- if(${CLIENT_SIDE_BUILD})
32
- set (RN_SO_DIR "${CMAKE_SOURCE_DIR}/../../../android/app/build/react-ndk/exported")
33
- set (FBJNI_HEADERS_DIR "${REACT_NATIVE_DIR}/ReactAndroid/src/main/jni/first-party/fbjni/headers")
34
- else()
35
- # Reanimated Playground app
36
- set (RN_SO_DIR "${CMAKE_SOURCE_DIR}/../${PLAYGROUND_APP_NAME}/android/app/build/react-ndk/exported")
37
- set (FBJNI_HEADERS_DIR "${REACT_NATIVE_DIR}/ReactAndroid/src/main/jni/first-party/fbjni/headers")
38
40
 
41
+ file(GLOB_RECURSE SOURCES_COMMON CONFIGURE_DEPENDS "${COMMON_SRC_DIR}/cpp/**.cpp")
42
+ file(GLOB_RECURSE SOURCES_ANDROID CONFIGURE_DEPENDS "${SRC_DIR}/main/cpp/**.cpp")
43
+
44
+ if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71)
45
+ # Consume shared libraries and headers from prefabs
46
+ find_package(fbjni REQUIRED CONFIG)
47
+ find_package(ReactAndroid REQUIRED CONFIG)
48
+ if(${JS_RUNTIME} STREQUAL "hermes")
49
+ find_package(hermes-engine REQUIRED CONFIG)
39
50
  endif()
40
51
  else()
41
- set (RN_SO_DIR ${REACT_NATIVE_DIR}/ReactAndroid/src/main/jni/first-party/react/jni)
42
- set (FBJNI_HEADERS_DIR "${REACT_NATIVE_DIR}/ReactAndroid/src/main/jni/first-party/fbjni/headers")
52
+ # Consume shared libraries from found .so files
53
+ if(${IS_NEW_ARCHITECTURE_ENABLED})
54
+ if(${CLIENT_SIDE_BUILD})
55
+ set (RN_SO_DIR "${CMAKE_SOURCE_DIR}/../../../android/app/build/react-ndk/exported")
56
+ set (FBJNI_HEADERS_DIR "${REACT_NATIVE_DIR}/ReactAndroid/src/main/jni/first-party/fbjni/headers")
57
+ else()
58
+ # Reanimated Playground app
59
+ set (RN_SO_DIR "${CMAKE_SOURCE_DIR}/../${PLAYGROUND_APP_NAME}/android/app/build/react-ndk/exported")
60
+ set (FBJNI_HEADERS_DIR "${REACT_NATIVE_DIR}/ReactAndroid/src/main/jni/first-party/fbjni/headers")
61
+ endif()
62
+ else()
63
+ set (RN_SO_DIR ${REACT_NATIVE_DIR}/ReactAndroid/src/main/jni/first-party/react/jni)
64
+ set (FBJNI_HEADERS_DIR "${REACT_NATIVE_DIR}/ReactAndroid/src/main/jni/first-party/fbjni/headers")
65
+ endif()
66
+ file (GLOB LIBRN_DIR "${RN_SO_DIR}/${ANDROID_ABI}")
43
67
  endif()
44
68
 
45
- file (GLOB LIBRN_DIR "${RN_SO_DIR}/${ANDROID_ABI}")
46
-
47
- file(GLOB_RECURSE SOURCES_COMMON CONFIGURE_DEPENDS "${COMMON_SRC_DIR}/cpp/**.cpp")
48
- file(GLOB_RECURSE SOURCES_ANDROID CONFIGURE_DEPENDS "${SRC_DIR}/main/cpp/**.cpp")
49
-
50
69
  if(${REACT_NATIVE_MINOR_VERSION} LESS 66)
51
- set (
52
- INCLUDE_JSI_CPP
53
- "${REACT_NATIVE_DIR}/ReactCommon/jsi/jsi/jsi.cpp"
54
- )
55
- set (
56
- INCLUDE_JSIDYNAMIC_CPP
57
- "${REACT_NATIVE_DIR}/ReactCommon/jsi/jsi/JSIDynamic.cpp"
58
- )
70
+ set(INCLUDE_JSI_CPP "${REACT_NATIVE_DIR}/ReactCommon/jsi/jsi/jsi.cpp")
71
+ set(INCLUDE_JSIDYNAMIC_CPP "${REACT_NATIVE_DIR}/ReactCommon/jsi/jsi/JSIDynamic.cpp")
59
72
  endif()
60
73
 
61
74
  add_library(
@@ -69,33 +82,14 @@ add_library(
69
82
 
70
83
  # includes
71
84
 
72
- file (GLOB LIBFBJNI_INCLUDE_DIR ${FBJNI_HEADERS_DIR})
73
-
74
85
  target_include_directories(
75
86
  ${PACKAGE_NAME}
76
87
  PRIVATE
77
- "${LIBFBJNI_INCLUDE_DIR}"
78
- "${BUILD_DIR}/third-party-ndk/boost/boost_${BOOST_VERSION}"
79
- "${BUILD_DIR}/third-party-ndk/double-conversion"
80
- "${BUILD_DIR}/third-party-ndk/folly"
81
- "${BUILD_DIR}/third-party-ndk/glog/exported"
82
- "${REACT_NATIVE_DIR}/React"
83
- "${REACT_NATIVE_DIR}/React/Base"
84
- "${REACT_NATIVE_DIR}/ReactAndroid/src/main/jni"
85
- "${REACT_NATIVE_DIR}/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni"
86
- "${REACT_NATIVE_DIR}/ReactAndroid/src/main/java/com/facebook/react/fabric/jni"
87
- "${REACT_NATIVE_DIR}/ReactCommon"
88
- "${REACT_NATIVE_DIR}/ReactCommon/callinvoker"
89
- "${REACT_NATIVE_DIR}/ReactCommon/jsi"
90
- "${REACT_NATIVE_DIR}/ReactCommon/react/renderer/graphics/platform/cxx"
91
- "${REACT_NATIVE_DIR}/ReactCommon/runtimeexecutor"
92
- "${REACT_NATIVE_DIR}/ReactCommon/turbomodule/core"
93
- "${REACT_NATIVE_DIR}/ReactCommon/turbomodule"
94
- "${REACT_NATIVE_DIR}/ReactCommon/yoga"
95
88
  "${COMMON_SRC_DIR}/cpp/Tools"
96
89
  "${COMMON_SRC_DIR}/cpp/SpecTools"
97
90
  "${COMMON_SRC_DIR}/cpp/NativeModules"
98
91
  "${COMMON_SRC_DIR}/cpp/SharedItems"
92
+ "${COMMON_SRC_DIR}/cpp/ReanimatedRuntime"
99
93
  "${COMMON_SRC_DIR}/cpp/Registries"
100
94
  "${COMMON_SRC_DIR}/cpp/LayoutAnimations"
101
95
  "${COMMON_SRC_DIR}/cpp/AnimatedSensor"
@@ -104,157 +98,165 @@ target_include_directories(
104
98
  "${SRC_DIR}/main/cpp"
105
99
  )
106
100
 
107
- find_library(
108
- LOG_LIB
109
- log
110
- )
111
- find_library(
112
- REACT_NATIVE_JNI_LIB
113
- reactnativejni
114
- PATHS ${LIBRN_DIR}
115
- NO_CMAKE_FIND_ROOT_PATH
116
- )
117
- find_library(
118
- GLOG_LIB
119
- glog
120
- PATHS ${LIBRN_DIR}
121
- NO_CMAKE_FIND_ROOT_PATH
122
- )
123
- find_library(
124
- FBJNI_LIB
125
- fbjni
126
- PATHS ${LIBRN_DIR}
127
- NO_CMAKE_FIND_ROOT_PATH
128
- )
129
-
130
- if(${REACT_NATIVE_MINOR_VERSION} LESS 69)
131
- find_library(
132
- FOLLY_LIB
133
- folly_json
134
- PATHS ${LIBRN_DIR}
135
- NO_CMAKE_FIND_ROOT_PATH
101
+ if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71)
102
+ target_include_directories(
103
+ ${PACKAGE_NAME}
104
+ PRIVATE
105
+ "${REACT_NATIVE_DIR}/ReactAndroid/src/main/jni/react/turbomodule"
106
+ "${REACT_NATIVE_DIR}/ReactCommon"
107
+ "${REACT_NATIVE_DIR}/ReactCommon/callinvoker"
108
+ "${REACT_NATIVE_DIR}/ReactCommon/react/renderer/graphics/platform/cxx"
109
+ "${REACT_NATIVE_DIR}/ReactCommon/runtimeexecutor"
110
+ "${REACT_NATIVE_DIR}/ReactCommon/yoga"
136
111
  )
137
112
  else()
138
- find_library(
139
- FOLLY_LIB
140
- folly_runtime
141
- PATHS ${LIBRN_DIR}
142
- NO_CMAKE_FIND_ROOT_PATH
113
+ file(GLOB LIBFBJNI_INCLUDE_DIR ${FBJNI_HEADERS_DIR})
114
+ target_include_directories(
115
+ ${PACKAGE_NAME}
116
+ PRIVATE
117
+ "${LIBFBJNI_INCLUDE_DIR}"
118
+ "${BUILD_DIR}/third-party-ndk/boost/boost_${BOOST_VERSION}"
119
+ "${BUILD_DIR}/third-party-ndk/double-conversion"
120
+ "${BUILD_DIR}/third-party-ndk/folly"
121
+ "${BUILD_DIR}/third-party-ndk/glog/exported"
122
+ "${REACT_NATIVE_DIR}/React"
123
+ "${REACT_NATIVE_DIR}/React/Base"
124
+ "${REACT_NATIVE_DIR}/ReactAndroid/src/main/jni"
125
+ "${REACT_NATIVE_DIR}/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni"
126
+ "${REACT_NATIVE_DIR}/ReactAndroid/src/main/java/com/facebook/react/fabric/jni"
127
+ "${REACT_NATIVE_DIR}/ReactCommon"
128
+ "${REACT_NATIVE_DIR}/ReactCommon/callinvoker"
129
+ "${REACT_NATIVE_DIR}/ReactCommon/jsi"
130
+ "${REACT_NATIVE_DIR}/ReactCommon/hermes"
131
+ "${REACT_NATIVE_DIR}/ReactCommon/react/renderer/graphics/platform/cxx"
132
+ "${REACT_NATIVE_DIR}/ReactCommon/runtimeexecutor"
133
+ "${REACT_NATIVE_DIR}/ReactCommon/turbomodule/core"
134
+ "${REACT_NATIVE_DIR}/ReactCommon/turbomodule"
135
+ "${REACT_NATIVE_DIR}/ReactCommon/yoga"
143
136
  )
144
137
  endif()
145
138
 
146
- if(${REACT_NATIVE_MINOR_VERSION} LESS 66)
147
- set (JSI_LIB "")
148
- else()
149
- find_library(
150
- JSI_LIB
151
- jsi
152
- PATHS ${LIBRN_DIR}
153
- NO_CMAKE_FIND_ROOT_PATH
154
- )
155
- endif()
139
+ # build shared lib
156
140
 
157
- if(${IS_NEW_ARCHITECTURE_ENABLED})
158
- find_library(
159
- REACT_RENDER_UIMANAGER
160
- react_render_uimanager
161
- PATHS ${LIBRN_DIR}
162
- NO_CMAKE_FIND_ROOT_PATH
163
- )
164
- find_library(
165
- REACT_RENDER_MOUNTING
166
- react_render_mounting
167
- PATHS ${LIBRN_DIR}
168
- NO_CMAKE_FIND_ROOT_PATH
169
- )
170
- find_library(
171
- REACT_RENDER_COMPONENTREGISTRY
172
- react_render_componentregistry
173
- PATHS ${LIBRN_DIR}
174
- NO_CMAKE_FIND_ROOT_PATH
175
- )
176
- find_library(
177
- REACT_RENDER_CORE
178
- react_render_core
179
- PATHS ${LIBRN_DIR}
180
- NO_CMAKE_FIND_ROOT_PATH
181
- )
182
- find_library(
183
- REACT_DEBUG
184
- react_debug
185
- PATHS ${LIBRN_DIR}
186
- NO_CMAKE_FIND_ROOT_PATH
187
- )
188
- find_library(
189
- REACT_RENDER_DEBUG
190
- react_render_debug
191
- PATHS ${LIBRN_DIR}
192
- NO_CMAKE_FIND_ROOT_PATH
141
+ set_target_properties(${PACKAGE_NAME} PROPERTIES LINKER_LANGUAGE CXX)
142
+
143
+ target_link_libraries(
144
+ ${PACKAGE_NAME}
145
+ log
146
+ android
147
+ )
148
+
149
+ if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71)
150
+ target_link_libraries(
151
+ ${PACKAGE_NAME}
152
+ ReactAndroid::folly_runtime
153
+ ReactAndroid::glog
154
+ ReactAndroid::jsi
155
+ ReactAndroid::reactnativejni
156
+ fbjni::fbjni
193
157
  )
158
+ else()
159
+ if(${REACT_NATIVE_MINOR_VERSION} LESS 66)
160
+ set (JSI_LIB "")
161
+ else()
162
+ find_library(
163
+ JSI_LIB
164
+ jsi
165
+ PATHS ${LIBRN_DIR}
166
+ NO_CMAKE_FIND_ROOT_PATH
167
+ )
168
+ endif()
169
+
194
170
  find_library(
195
- RRC_ROOT
196
- rrc_root
171
+ GLOG_LIB
172
+ glog
197
173
  PATHS ${LIBRN_DIR}
198
174
  NO_CMAKE_FIND_ROOT_PATH
199
175
  )
176
+
200
177
  find_library(
201
- RRC_VIEW
202
- rrc_view
178
+ FBJNI_LIB
179
+ fbjni
203
180
  PATHS ${LIBRN_DIR}
204
181
  NO_CMAKE_FIND_ROOT_PATH
205
182
  )
183
+
184
+ if(${REACT_NATIVE_MINOR_VERSION} LESS 69)
185
+ find_library(
186
+ FOLLY_LIB
187
+ folly_json
188
+ PATHS ${LIBRN_DIR}
189
+ NO_CMAKE_FIND_ROOT_PATH
190
+ )
191
+ else()
192
+ find_library(
193
+ FOLLY_LIB
194
+ folly_runtime
195
+ PATHS ${LIBRN_DIR}
196
+ NO_CMAKE_FIND_ROOT_PATH
197
+ )
198
+ endif()
199
+
206
200
  find_library(
207
- REACT_RENDER_SCHEDULER
208
- react_render_scheduler
201
+ REACTNATIVEJNI_LIB
202
+ reactnativejni
209
203
  PATHS ${LIBRN_DIR}
210
204
  NO_CMAKE_FIND_ROOT_PATH
211
205
  )
212
- find_library(
213
- FABRICJNI
214
- fabricjni
215
- PATHS ${LIBRN_DIR}
216
- NO_CMAKE_FIND_ROOT_PATH
206
+
207
+ target_link_libraries(
208
+ ${PACKAGE_NAME}
209
+ ${JSI_LIB}
210
+ ${GLOG_LIB}
211
+ ${FBJNI_LIB}
212
+ ${FOLLY_LIB}
213
+ ${REACTNATIVEJNI_LIB}
217
214
  )
218
215
  endif()
219
216
 
220
- # build shared lib
221
-
222
- set_target_properties(${PACKAGE_NAME} PROPERTIES LINKER_LANGUAGE CXX)
223
-
224
-
225
- target_link_libraries(
226
- ${PACKAGE_NAME}
227
- ${LOG_LIB}
228
- ${JSI_LIB}
229
- ${GLOG_LIB}
230
- ${FBJNI_LIB}
231
- ${FOLLY_LIB}
232
- ${REACT_NATIVE_JNI_LIB}
233
- android
234
- )
235
-
236
217
  if(${JS_RUNTIME} STREQUAL "hermes")
237
218
  string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_HERMES=1")
238
- if(${REACT_NATIVE_MINOR_VERSION} LESS 69)
239
- # From `hermes-engine` npm package
219
+ if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71)
220
+ # From prefab from module `com.facebook.react:hermes-android`
221
+ set(HERMES_LIB hermes-engine::libhermes)
222
+ elseif(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 69)
223
+ # Bundled Hermes from module `com.facebook.react:hermes-engine` or project `:ReactAndroid:hermes-engine`
240
224
  target_include_directories(
241
225
  ${PACKAGE_NAME}
242
226
  PRIVATE
243
- "${JS_RUNTIME_DIR}/android/include"
227
+ "${JS_RUNTIME_DIR}/API"
228
+ "${JS_RUNTIME_DIR}/public"
244
229
  )
230
+ set(HERMES_LIB "${BUILD_DIR}/third-party-ndk/hermes/jni/${ANDROID_ABI}/libhermes.so")
245
231
  else()
246
- # Bundled Hermes from module `com.facebook.react:hermes-engine` or project `:ReactAndroid:hermes-engine`
232
+ # From `hermes-engine` npm package
247
233
  target_include_directories(
248
234
  ${PACKAGE_NAME}
249
235
  PRIVATE
250
- "${JS_RUNTIME_DIR}/API"
251
- "${JS_RUNTIME_DIR}/public"
236
+ "${JS_RUNTIME_DIR}/android/include"
252
237
  )
238
+ set(HERMES_LIB "${BUILD_DIR}/third-party-ndk/hermes/jni/${ANDROID_ABI}/libhermes.so")
253
239
  endif()
254
240
  target_link_libraries(
255
241
  ${PACKAGE_NAME}
256
- "${BUILD_DIR}/third-party-ndk/hermes/jni/${ANDROID_ABI}/libhermes.so"
242
+ ${HERMES_LIB}
257
243
  )
244
+ if (${HERMES_ENABLE_DEBUGGER})
245
+ if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71)
246
+ set(HERMES_EXECUTOR_LIB ReactAndroid::hermes_executor)
247
+ else()
248
+ find_library(
249
+ HERMES_EXECUTOR_LIB
250
+ hermes-executor-debug
251
+ PATHS ${LIBRN_DIR}
252
+ NO_CMAKE_FIND_ROOT_PATH
253
+ )
254
+ endif()
255
+ target_link_libraries(
256
+ ${PACKAGE_NAME}
257
+ ${HERMES_EXECUTOR_LIB}
258
+ )
259
+ endif()
258
260
  elseif(${JS_RUNTIME} STREQUAL "v8")
259
261
  string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_V8=1")
260
262
  target_include_directories(
@@ -273,33 +275,33 @@ elseif(${JS_RUNTIME} STREQUAL "v8")
273
275
  ${PACKAGE_NAME}
274
276
  ${V8EXECUTOR_LIB}
275
277
  )
276
- else()
278
+ elseif(${JS_RUNTIME} STREQUAL "jsc")
277
279
  string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_JSC=1")
278
- find_library(
279
- JSEXECUTOR_LIB
280
- jscexecutor
281
- PATHS ${LIBRN_DIR}
282
- NO_CMAKE_FIND_ROOT_PATH
283
- )
284
- target_link_libraries(
285
- ${PACKAGE_NAME}
286
- ${JSEXECUTOR_LIB}
287
- )
280
+ if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71)
281
+ set(JSEXECUTOR_LIB ReactAndroid::jscexecutor)
282
+ else()
283
+ find_library(
284
+ JSEXECUTOR_LIB
285
+ jscexecutor
286
+ PATHS ${LIBRN_DIR}
287
+ NO_CMAKE_FIND_ROOT_PATH
288
+ )
289
+ endif()
290
+ target_link_libraries(${PACKAGE_NAME} ${JSEXECUTOR_LIB})
291
+ else()
292
+ message(FATAL_ERROR "Unknown JS runtime ${JS_RUNTIME}.")
288
293
  endif()
289
294
 
290
295
  if(${IS_NEW_ARCHITECTURE_ENABLED})
291
296
  target_link_libraries(
292
297
  ${PACKAGE_NAME}
293
- ${REACT_RENDER_UIMANAGER}
294
- ${REACT_RENDER_MOUNTING}
295
- ${REACT_RENDER_COMPONENTREGISTRY}
296
- ${REACT_RENDER_CORE}
297
- ${REACT_DEBUG}
298
- ${REACT_RENDER_DEBUG}
299
- ${RRC_ROOT}
300
- ${RRC_VIEW}
301
- ${FABRICJNI}
302
- ${REACT_RENDER_SCHEDULER}
298
+ ReactAndroid::fabricjni
299
+ ReactAndroid::react_debug
300
+ ReactAndroid::react_render_core
301
+ ReactAndroid::react_render_mounting
302
+ ReactAndroid::react_render_scheduler
303
+ ReactAndroid::react_render_uimanager
304
+ ReactAndroid::rrc_view
303
305
  )
304
306
  endif()
305
307
 
@@ -318,4 +320,5 @@ endif()
318
320
  set (ignoreMe "${CLIENT_SIDE_BUILD}")
319
321
  set (ignoreMe "${JS_RUNTIME_DIR}")
320
322
  set (ignoreMe "${PLAYGROUND_APP_NAME}")
321
- set (ignoreMe "${HERMES_ENABLE_DEBUGGER}")
323
+ set (ignoreMe "${REANIMATED_PACKAGE_BUILD}")
324
+ set (ignoreMe "${BOOST_VERSION}")