File tree Expand file tree Collapse file tree 12 files changed +223
-12
lines changed
common/cpp/react/renderer/components/RNCSlider Expand file tree Collapse file tree 12 files changed +223
-12
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ android {
55
55
sourceSets {
56
56
main {
57
57
if (isNewArchitectureEnabled()) {
58
- java. srcDirs + = [' src/newarch' ]
58
+ java. srcDirs + = [' src/newarch' , " ${ project.buildDir } /generated/source/codegen/java " ]
59
59
} else {
60
60
java. srcDirs + = [' src/oldarch' ]
61
61
}
@@ -76,7 +76,7 @@ dependencies {
76
76
if (isNewArchitectureEnabled()) {
77
77
react {
78
78
jsRootDir = file(" ../src" )
79
- libraryName = " ReactSlider "
79
+ libraryName = " RNCSlider "
80
80
codegenJavaPackageName = " com.reactnativecommunity.slider"
81
81
}
82
82
}
Original file line number Diff line number Diff line change
1
+ cmake_minimum_required (VERSION 3.13)
2
+ set (CMAKE_VERBOSE_MAKEFILE ON )
3
+
4
+ set (LIB_LITERAL RNCSlider)
5
+ set (LIB_TARGET_NAME react_codegen_${LIB_LITERAL} )
6
+
7
+ set (LIB_ANDROID_DIR ${CMAKE_CURRENT_SOURCE_DIR} /../../..)
8
+ set (LIB_COMMON_DIR ${LIB_ANDROID_DIR} /../common/cpp)
9
+ set (LIB_ANDROID_GENERATED_JNI_DIR ${LIB_ANDROID_DIR} /build /generated /source /codegen/jni)
10
+ set (LIB_ANDROID_GENERATED_COMPONENTS_DIR ${LIB_ANDROID_GENERATED_JNI_DIR} /react/renderer/components/${LIB_LITERAL} )
11
+
12
+ add_compile_options (
13
+ -fexceptions
14
+ -frtti
15
+ -std=c++20
16
+ -Wall
17
+ -Wpedantic
18
+ -Wno-gnu-zero-variadic-macro-arguments
19
+ )
20
+
21
+ file (GLOB LIB_CUSTOM_SRCS CONFIGURE_DEPENDS *.cpp ${LIB_COMMON_DIR} /react/renderer/components/${LIB_LITERAL} /*.cpp)
22
+ file (GLOB LIB_CODEGEN_SRCS CONFIGURE_DEPENDS ${LIB_ANDROID_GENERATED_JNI_DIR} /*.cpp ${LIB_ANDROID_GENERATED_COMPONENTS_DIR} /*.cpp)
23
+
24
+ add_library (
25
+ ${LIB_TARGET_NAME}
26
+ SHARED
27
+ ${LIB_CUSTOM_SRCS}
28
+ ${LIB_CODEGEN_SRCS}
29
+ )
30
+
31
+ target_include_directories (
32
+ ${LIB_TARGET_NAME}
33
+ PUBLIC
34
+ .
35
+ ${LIB_COMMON_DIR}
36
+ ${LIB_ANDROID_GENERATED_JNI_DIR}
37
+ ${LIB_ANDROID_GENERATED_COMPONENTS_DIR}
38
+ )
39
+
40
+ target_link_libraries (
41
+ ${LIB_TARGET_NAME}
42
+ fbjni
43
+ folly_runtime
44
+ glog
45
+ jsi
46
+ react_codegen_rncore
47
+ react_debug
48
+ react_render_componentregistry
49
+ react_render_core
50
+ react_render_debug
51
+ react_render_graphics
52
+ react_render_imagemanager
53
+ react_render_mapbuffer
54
+ react_render_textlayoutmanager
55
+ react_utils
56
+ react_nativemodule_core
57
+ rrc_image
58
+ turbomodulejsijni
59
+ rrc_text
60
+ rrc_textinput
61
+ rrc_view
62
+ yoga
63
+ )
64
+
65
+ target_compile_options (
66
+ ${LIB_TARGET_NAME}
67
+ PRIVATE
68
+ -DLOG_TAG=\"ReactNative\"
69
+ -fexceptions
70
+ -frtti
71
+ -std=c++20
72
+ -Wall
73
+ )
74
+
75
+ target_include_directories (
76
+ ${CMAKE_PROJECT_NAME}
77
+ PUBLIC
78
+ ${CMAKE_CURRENT_SOURCE_DIR}
79
+ )
Original file line number Diff line number Diff line change
1
+ #pragma once
2
+
3
+ #include < ReactCommon/JavaTurboModule.h>
4
+ #include < ReactCommon/TurboModule.h>
5
+ #include < jsi/jsi.h>
6
+ #include < react/renderer/components/RNCSlider/ComponentDescriptors.h>
7
+
8
+ namespace facebook {
9
+ namespace react {
10
+
11
+ JSI_EXPORT
12
+ std::shared_ptr<TurboModule> RNCSlider_ModuleProvider (
13
+ const std::string &moduleName,
14
+ const JavaTurboModule::InitParams ¶ms);
15
+
16
+ } // namespace react
17
+ } // namespace facebook
18
+
Original file line number Diff line number Diff line change
1
+ #pragma once
2
+
3
+ #include < react/renderer/components/RNCSlider/RNCSliderShadowNode.h>
4
+ #include < react/renderer/core/ConcreteComponentDescriptor.h>
5
+
6
+ namespace facebook {
7
+ namespace react {
8
+
9
+ using RNCSliderComponentDescriptor = ConcreteComponentDescriptor<RNCSliderShadowNode>;
10
+
11
+ } // namespace react
12
+ } // namespace facebook
Original file line number Diff line number Diff line change
1
+ #include " RNCSliderShadowNode.h"
2
+
3
+ namespace facebook {
4
+ namespace react {
5
+
6
+ extern const char RNCSliderComponentName[] = " RNCSlider" ;
7
+
8
+ } // namespace react
9
+ } // namespace facebook
Original file line number Diff line number Diff line change
1
+ #pragma once
2
+
3
+ #include < jsi/jsi.h>
4
+ #include < react/renderer/components/rncore/EventEmitters.h>
5
+ #include < react/renderer/components/RNCSlider/RNCSliderState.h>
6
+ #include < react/renderer/components/RNCSlider/Props.h>
7
+ #include < react/renderer/components/view/ConcreteViewShadowNode.h>
8
+
9
+ namespace facebook {
10
+ namespace react {
11
+
12
+ JSI_EXPORT extern const char RNCSliderComponentName[];
13
+
14
+ /*
15
+ * `ShadowNode` for <RNCSlider> component.
16
+ */
17
+ class JSI_EXPORT RNCSliderShadowNode final
18
+ : public ConcreteViewShadowNode<
19
+ RNCSliderComponentName,
20
+ RNCSliderProps,
21
+ ViewEventEmitter,
22
+ RNCSliderState> {
23
+ using ConcreteViewShadowNode::ConcreteViewShadowNode;
24
+ };
25
+
26
+ } // namespace react
27
+ } // namespace facebook
Original file line number Diff line number Diff line change
1
+ #include " RNCSliderState.h"
2
+
3
+ namespace facebook {
4
+ namespace react {
5
+
6
+
7
+
8
+ } // namespace react
9
+ } // namespace facebook
Original file line number Diff line number Diff line change
1
+ #pragma once
2
+
3
+ #ifdef ANDROID
4
+ #include < folly/dynamic.h>
5
+ #include < react/renderer/mapbuffer/MapBuffer.h>
6
+ #include < react/renderer/mapbuffer/MapBufferBuilder.h>
7
+ #endif
8
+
9
+ namespace facebook {
10
+ namespace react {
11
+
12
+ class RNCSliderState {
13
+ public:
14
+ RNCSliderState () = default ;
15
+
16
+ #ifdef ANDROID
17
+ RNCSliderState (RNCSliderState const &previousState, folly::dynamic data){};
18
+ folly::dynamic getDynamic () const {
19
+ return {};
20
+ };
21
+ MapBuffer getMapBuffer () const {
22
+ return MapBufferBuilder::EMPTY ();
23
+ };
24
+ #endif
25
+ };
26
+
27
+ } // namespace react
28
+ } // namespace facebook
Original file line number Diff line number Diff line change 64
64
"jsxBracketSameLine" : true
65
65
},
66
66
"codegenConfig" : {
67
- "libraries" : [
68
- {
69
- "name" : " RNCSlider" ,
70
- "type" : " components" ,
71
- "jsSrcsDir" : " src"
72
- }
73
- ]
67
+ "name" : " RNCSlider" ,
68
+ "type" : " components" ,
69
+ "jsSrcsDir" : " src" ,
70
+ "android" : {
71
+ "javaPackageName" : " com.reactnativecommunity.slider"
72
+ }
74
73
}
75
74
}
Original file line number Diff line number Diff line change @@ -16,6 +16,13 @@ Pod::Spec.new do |s|
16
16
17
17
s . source = { :git => "https://github.com/callstack/react-native-slider.git" , :tag => "v#{ s . version } " }
18
18
s . source_files = "ios/**/*.{h,m,mm}"
19
+
20
+ s . subspec "common" do |ss |
21
+ ss . source_files = "common/cpp/**/*.{cpp,h}"
22
+ ss . header_dir = "RNCSlider"
23
+ ss . pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\" $(PODS_TARGET_SRCROOT)/common/cpp\" " }
24
+ end
25
+
19
26
if defined? ( install_modules_dependencies )
20
27
install_modules_dependencies ( s )
21
28
else
You can’t perform that action at this time.
0 commit comments