Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: more header path issues #121

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions ios/RNIContextMenuButton/RNIContextMenuButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
// Created by Dominic Go on 8/24/24.
//

#if __has_include(<react_native_ios_utilities/RNIBaseView.h>)
#import <react_native_ios_utilities/RNIBaseView.h>
#else
#import <react-native-ios-utilities/RNIBaseView.h>
#endif
#import "../RNIHeaderUtils.h"

#import RNI_INCLUDE_HEADER(RNIBaseView.h)

#if RCT_NEW_ARCH_ENABLED
#import <React/RCTViewComponentView.h>
Expand Down
20 changes: 6 additions & 14 deletions ios/RNIContextMenuButton/RNIContextMenuButton.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,16 @@

#import "RNIContextMenuButton.h"
#import "../Swift.h"
#import "../RNIHeaderUtils.h"

#if __has_include(<react_native_ios_utilities/RNIBaseView.h>)
#import <react_native_ios_utilities/RNIBaseView.h>
#import <react_native_ios_utilities/RNIContentViewParentDelegate.h>
#import <react_native_ios_utilities/UIApplication+RNIHelpers.h>
#import <react_native_ios_utilities/RNIObjcUtils.h>
#else
#import <react-native-ios-utilities/RNIBaseView.h>
#import <react-native-ios-utilities/RNIContentViewParentDelegate.h>
#import <react-native-ios-utilities/UIApplication+RNIHelpers.h>
#import <react-native-ios-utilities/RNIObjcUtils.h>
#endif
#import RNI_INCLUDE_HEADER(RNIContentViewParentDelegate.h)
#import RNI_INCLUDE_HEADER(UIApplication+RNIHelpers.h)
#import RNI_INCLUDE_HEADER(RNIObjcUtils.h)

#if RCT_NEW_ARCH_ENABLED
#include "RNIContextMenuButtonComponentDescriptor.h"

#include <react_native_ios_utilities/RNIBaseViewState.h>
#include <react_native_ios_utilities/RNIBaseViewProps.h>
#import RNI_INCLUDE_HEADER(RNIBaseViewState.h)
#import RNI_INCLUDE_HEADER(RNIBaseViewProps.h)

#import <React/RCTConversions.h>
#import <React/RCTFabricComponentsPlugins.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

#include "RNIContextMenuButtonShadowNode.h"
#include "RNIBaseViewComponentDescriptor.h"
#include "../RNIHeaderUtils.h"

#include <react_native_ios_utilities/RNIBaseViewState.h>
#import RNI_INCLUDE_HEADER(RNIBaseViewState.h)

#include <react/renderer/core/ConcreteComponentDescriptor.h>

Expand Down
10 changes: 6 additions & 4 deletions ios/RNIContextMenuButton/RNIContextMenuButtonShadowNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
#if __cplusplus
#pragma once

#include <react_native_ios_utilities/RNIBaseViewShadowNode.h>
#include <react_native_ios_utilities/RNIBaseViewProps.h>
#include <react_native_ios_utilities/RNIBaseViewEventEmitter.h>
#include "../RNIHeaderUtils.h"

#import RNI_INCLUDE_HEADER(RNIBaseViewShadowNode.h)
#import RNI_INCLUDE_HEADER(RNIBaseViewProps.h)
#import RNI_INCLUDE_HEADER(RNIBaseViewEventEmitter.h)

#include <react/renderer/components/RNIContextMenuViewSpec/EventEmitters.h>
#include <react/renderer/components/RNIContextMenuViewSpec/Props.h>
Expand All @@ -28,7 +30,7 @@ class JSI_EXPORT RNIContextMenuButtonShadowNode final :

public:
using RNIBaseViewShadowNode::RNIBaseViewShadowNode;

static RNIBaseViewState initialStateData(
const Props::Shared&r , // props
const ShadowNodeFamily::Shared&, // family
Expand Down
8 changes: 3 additions & 5 deletions ios/RNIContextMenuButton/RNIContextMenuButtonViewManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
#import "RNIContextMenuButton.h"
#import <objc/runtime.h>

#if __has_include(<react_native_ios_utilities/RNIBaseViewUtils.h>)
#import <react_native_ios_utilities/RNIBaseViewUtils.h>
#else
#import <react-native-ios-utilities/RNIBaseViewUtils.h>
#endif
#import "../RNIHeaderUtils.h"

#import RNI_INCLUDE_HEADER(RNIBaseViewUtils.h)

#import "RCTBridge.h"
#import <React/RCTViewManager.h>
Expand Down
8 changes: 3 additions & 5 deletions ios/RNIContextMenuView/RNIContextMenuView.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
// Created by Dominic Go on 8/24/24.
//

#if __has_include(<react_native_ios_utilities/RNIBaseView.h>)
#import <react_native_ios_utilities/RNIBaseView.h>
#else
#import <react-native-ios-utilities/RNIBaseView.h>
#endif
#import "../RNIHeaderUtils.h"

#import RNI_INCLUDE_HEADER(RNIBaseView.h)

#if RCT_NEW_ARCH_ENABLED
#import <React/RCTViewComponentView.h>
Expand Down
28 changes: 11 additions & 17 deletions ios/RNIContextMenuView/RNIContextMenuView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,22 @@
#import "RNIContextMenuView.h"
#import "../Swift.h"

#if __has_include(<react_native_ios_utilities/RNIBaseView.h>)
#import <react_native_ios_utilities/RNIBaseView.h>
#import <react_native_ios_utilities/RNIContentViewParentDelegate.h>
#import <react_native_ios_utilities/UIApplication+RNIHelpers.h>
#import <react_native_ios_utilities/RNIObjcUtils.h>
#else
#import <react-native-ios-utilities/RNIBaseView.h>
#import <react-native-ios-utilities/RNIContentViewParentDelegate.h>
#import <react-native-ios-utilities/UIApplication+RNIHelpers.h>
#import <react-native-ios-utilities/RNIObjcUtils.h>
#import "../RNIHeaderUtils.h"

#import RNI_INCLUDE_HEADER(RNIBaseView.h)
#import RNI_INCLUDE_HEADER(RNIContentViewParentDelegate.h)
#import RNI_INCLUDE_HEADER(UIApplication+RNIHelpers.h)
#import RNI_INCLUDE_HEADER(RNIObjcUtils.h)

#if RCT_NEW_ARCH_ENABLED
#import RNI_INCLUDE_HEADER(RNIBaseViewState.h)
#endif

#if RCT_NEW_ARCH_ENABLED
#include "RNIContextMenuViewComponentDescriptor.h"

#if __has_include(<react_native_ios_utilities/RNIBaseViewState.h>)
#include <react_native_ios_utilities/RNIBaseViewState.h>
#include <react_native_ios_utilities/RNIBaseViewProps.h>
#else
#include <react-native-ios-utilities/RNIBaseViewState.h>
#include <react-native-ios-utilities/RNIBaseViewProps.h>
#endif
#import RNI_INCLUDE_HEADER(RNIBaseViewState.h)
#import RNI_INCLUDE_HEADER(RNIBaseViewProps.h)

#import <React/RCTConversions.h>
#import <React/RCTFabricComponentsPlugins.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@
#if __cplusplus
#pragma once


#include "RNIContextMenuViewShadowNode.h"
#include "RNIBaseViewComponentDescriptor.h"

#if __has_include(<react_native_ios_utilities/RNIBaseViewComponentDescriptor.h>)
#include <react_native_ios_utilities/RNIBaseViewComponentDescriptor.h>
#include <react_native_ios_utilities/RNIBaseViewState.h>
#else
#include <react-native-ios-utilities/RNIBaseViewComponentDescriptor.h>
#include <react-native-ios-utilities/RNIBaseViewState.h>
#endif

#include <react/renderer/core/ConcreteComponentDescriptor.h>

Expand All @@ -23,7 +29,7 @@ class RNIContextMenuViewComponentDescriptor final : public RNIBaseViewComponentD
RNIContextMenuViewShadowNode,
RNIContextMenuViewComponentName
> {

public:
using RNIBaseViewComponentDescriptor::RNIBaseViewComponentDescriptor;
};
Expand Down
8 changes: 3 additions & 5 deletions ios/RNIContextMenuView/RNIContextMenuViewManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
#import "RNIContextMenuView.h"
#import <objc/runtime.h>

#if __has_include(<react_native_ios_utilities/RNIBaseViewUtils.h>)
#import <react_native_ios_utilities/RNIBaseViewUtils.h>
#else
#import <react-native-ios-utilities/RNIBaseViewUtils.h>
#endif
#import "../RNIHeaderUtils.h"

#import RNI_INCLUDE_HEADER(RNIBaseViewUtils.h)

#import "RCTBridge.h"
#import <React/RCTViewManager.h>
Expand Down
10 changes: 6 additions & 4 deletions ios/RNIContextMenuView/RNIContextMenuViewShadowNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
#if __cplusplus
#pragma once

#include <react_native_ios_utilities/RNIBaseViewShadowNode.h>
#include <react_native_ios_utilities/RNIBaseViewProps.h>
#include <react_native_ios_utilities/RNIBaseViewEventEmitter.h>
#include "../RNIHeaderUtils.h"

#import RNI_INCLUDE_HEADER(RNIBaseViewShadowNode.h)
#import RNI_INCLUDE_HEADER(RNIBaseViewProps.h)
#import RNI_INCLUDE_HEADER(RNIBaseViewEventEmitter.h)

#include <react/renderer/components/RNIContextMenuViewSpec/EventEmitters.h>
#include <react/renderer/components/RNIContextMenuViewSpec/Props.h>
Expand All @@ -28,7 +30,7 @@ class JSI_EXPORT RNIContextMenuViewShadowNode final :

public:
using RNIBaseViewShadowNode::RNIBaseViewShadowNode;

static RNIBaseViewState initialStateData(
const Props::Shared&r , // props
const ShadowNodeFamily::Shared&, // family
Expand Down
7 changes: 7 additions & 0 deletions ios/RNIHeaderUtils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once

#if __has_include(<react_native_ios_utilities/header>)
#define RNI_INCLUDE_HEADER(header) <react_native_ios_utilities/header>
#else
#define RNI_INCLUDE_HEADER(header) <react-native-ios-utilities/header>
#endif
4 changes: 0 additions & 4 deletions ios/Swift.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
//
// Created by Dominic Go on 8/24/24.
//

// When `use_frameworks!` is used, the generated Swift header is inside
// the module.
// Otherwise, it's available only locally with double-quoted imports.
#if __has_include(<react_native_ios_context_menu/react_native_ios_context_menu-Swift.h>)
#import <react_native_ios_context_menu/react_native_ios_context_menu-Swift.h>

Expand Down
8 changes: 4 additions & 4 deletions react-native-ios-context-menu.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ Pod::Spec.new do |s|
'"${PODS_CONFIGURATION_BUILD_DIR}/react-native-ios-utilities/**"',
'"${PODS_CONFIGURATION_BUILD_DIR}/react-native-ios-utilities/Swift Compatibility Header"',
'"${PODS_CONFIGURATION_BUILD_DIR}/react-native-ios-context-menu/Swift Compatibility Header"',

#'"$(PODS_ROOT)/Headers/Private/react-native-ios-utilities"',
#'"$(PODS_ROOT)/Headers/Public/react-native-ios-utilities"',

'"$(PODS_ROOT)/Headers/Private/React-bridging/react/bridging"',
'"$(PODS_CONFIGURATION_BUILD_DIR)/React-bridging/react_bridging.framework/Headers"',
'"$(PODS_ROOT)/Headers/Private/Yoga"',
]

if fabric_enabled && ENV['USE_FRAMEWORKS']
user_header_search_paths << "\"$(PODS_ROOT)/DoubleConversion\""
user_header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\""
Expand All @@ -91,7 +91,7 @@ Pod::Spec.new do |s|
"HEADER_SEARCH_PATHS" => user_header_search_paths,
}

# s.xcconfig = {
# s.xcconfig = {
# 'HEADER_SEARCH_PATHS' => [
# '"${PODS_CONFIGURATION_BUILD_DIR}/react-native-ios-utilities/Swift Compatibility Header"',
# '"${PODS_CONFIGURATION_BUILD_DIR}/react-native-ios-utilities/**"',
Expand Down Expand Up @@ -138,5 +138,5 @@ Pod::Spec.new do |s|

s.exclude_files = exclude_files
s.compiler_flags = compiler_flags
s.private_header_files = ['ios/**/*+Private.h', 'ios/**/Swift.h']
s.private_header_files = ['ios/**/*+Private.h', 'ios/**/Swift.h', 'ios/**/RNIHeaderUtils.h']
end
Loading