mirror of
https://github.com/zoriya/nitro.git
synced 2026-10-13 00:05:23 +00:00
* chore: Use C++ 23 * feat: Add `ResultWrappingType` * feat: Add C++ `ResultWrappingType` bridge * feat: Use C++ result wrapper * feat: Use `std::expected` for Swift return types * Bump to 23 * Downgrade to C++ 20 again * fix: Use `Result<T>` instead of expected * fix: Return even if void * fix: Explicitly say type * extra line for debugging * fix: Fix double args * fix: Bridge directly to C++ target for return values * feat: THROW SWIFT ERROR WOOHOOO * feat: Make it work * feat: Add test that uses `Result<complex type>` and throws before * Update getTests.ts * Update HybridTestObjectKotlin.kt * extra line * perf: Use `assert` for `value()` * docs: Remove error swift limitation as it now works
70 lines
2.1 KiB
Ruby
70 lines
2.1 KiB
Ruby
require "json"
|
|
|
|
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
|
|
Pod::UI.puts "[NitroModules] 🔥 Your app is boosted by nitro modules!"
|
|
|
|
Pod::Spec.new do |s|
|
|
s.name = "NitroModules"
|
|
s.version = package["version"]
|
|
s.summary = package["description"]
|
|
s.homepage = package["homepage"]
|
|
s.license = package["license"]
|
|
s.authors = package["author"]
|
|
s.source = { :git => "https://github.com/mrousavy/nitro.git", :tag => "#{s.version}" }
|
|
s.platforms = {
|
|
:ios => min_ios_version_supported,
|
|
:visionos => 1.0,
|
|
:macos => 10.13,
|
|
:tvos => 13.4,
|
|
}
|
|
|
|
s.source_files = [
|
|
# Shared C++ codebase
|
|
"cpp/**/*.{h,hpp}",
|
|
"cpp/**/*.{c,cpp}",
|
|
# iOS codebase
|
|
"ios/**/*.{h,hpp}",
|
|
"ios/**/*.{c,cpp}",
|
|
"ios/**/*.{m,mm}",
|
|
"ios/**/*.swift",
|
|
]
|
|
s.public_header_files = [
|
|
# Public C++ headers will be exposed in modulemap (for Swift)
|
|
"cpp/core/AnyMap.hpp",
|
|
"cpp/core/ArrayBuffer.hpp",
|
|
"cpp/core/HybridObject.hpp",
|
|
"cpp/core/Promise.hpp",
|
|
"cpp/entrypoint/HybridNitroModulesProxy.hpp",
|
|
"cpp/entrypoint/InstallNitro.hpp",
|
|
"cpp/registry/HybridObjectRegistry.hpp",
|
|
"cpp/jsi/JSIConverter.hpp",
|
|
"cpp/platform/NitroLogger.hpp",
|
|
"cpp/threading/Dispatcher.hpp",
|
|
"cpp/utils/NitroHash.hpp",
|
|
"cpp/utils/NitroDefines.hpp",
|
|
# Public iOS-specific headers that will be exposed in modulemap (for Swift)
|
|
"ios/core/ArrayBufferHolder.hpp",
|
|
"ios/core/AnyMapHolder.hpp",
|
|
"ios/core/HybridContext.hpp",
|
|
"ios/utils/Result.hpp",
|
|
"ios/utils/RuntimeError.hpp",
|
|
"ios/utils/SwiftClosure.hpp",
|
|
]
|
|
|
|
s.pod_target_xcconfig = {
|
|
# Use C++ 20
|
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
# Enables C++ <-> Swift interop (by default it's only C)
|
|
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
# Enables stricter modular headers
|
|
"DEFINES_MODULE" => "YES",
|
|
# C++ compiler flags, mainly for folly.
|
|
"GCC_PREPROCESSOR_DEFINITIONS" => "$(inherited) FOLLY_NO_CONFIG FOLLY_CFG_NO_COROUTINES"
|
|
}
|
|
|
|
s.dependency 'React-jsi'
|
|
s.dependency 'React-callinvoker'
|
|
install_modules_dependencies(s)
|
|
end
|