Files
react-native/packages/react-native/scripts/cocoapods/autolinking_utils.rb
T
Blake Friedman c884d19a50 Moved @react-native-community script internally into react-native/scripts
Summary:
This decouples the listing of modules from the linking of those modules into Cocoapods. I've made this backwards compatible, but our internal template wont lean on the community config.

The user can now override how they capture a list of React Native modules, providing an escape hatch for Framework authors to build on.

Changelog: [General][iOS] Use our fork of the react-native-communti/cli-platform-ios use_native_modues.rb script

Reviewed By: cipolleschi

Differential Revision: D56242486

fbshipit-source-id: 78505669ab6abd6718348388c3bfba3290f7071b
2024-04-23 09:50:17 -07:00

26 lines
769 B
Ruby

# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class AutolinkingUtils
def self.nested_path_exists?(object, *path)
path.reduce(object) do |obj, method|
return false unless obj.respond_to?(method)
obj.public_send(method)
end
return true
end
def self.is_platform_supported?(current_target_definition, spec)
platform = current_target_definition.platform
if !platform
# Historically we've supported platforms that aren't specifically excluded.
return true
end
return spec.supported_on_platform?(platform.name)
end
end