Files
react-native/scripts/cocoapods/__tests__/test_utils/SpecMock.rb
T
Riccardo Cipolleschi 82e9c6ad61 Simplify the dependencies migration for new libraries (#34619)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34619

When it comes to migrate existing libraries, users needs to update their .podspec files with a bunch [of changes](https://reactnative.dev/docs/0.69/new-architecture-library-ios#add-folly-and-other-dependencies).
This diff groups those changes in a single function, so that contributors can just invoke that function to prepare their dependencies.

## Changelog

[iOS][Changed] - Add function to simplify podspecs

Reviewed By: cortinico

Differential Revision: D39312203

fbshipit-source-id: ed631839e07d472a1fdcba33310f9b1d94fe2fd7
2022-09-09 04:25:56 -07:00

31 lines
783 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 SpecMock
attr_accessor :compiler_flags
attr_accessor :pod_target_xcconfig
attr_reader :dependencies
def initialize
@compiler_flags = ""
@pod_target_xcconfig = Hash.new
@dependencies = []
end
def dependency(dependency_name, version = nil)
toPush = {"dependency_name": dependency_name}
toPush["version"] = version if version
@dependencies.push(toPush)
end
def to_hash
return {
"compiler_flags" => @compiler_flags,
"pod_target_xcconfig" => @pod_target_xcconfig,
}
end
end