Files
nitro/packages/react-native-nitro-modules/NitroModules.podspec
T
Marc RousavyandGitHub 6da4f98904 feat: Support awaiting JS Promise in Kotlin and Swift (#355)
* feat: Support passing `Promise` to Kotlin

* feat: Add `onResolvedListener`

* feat: Add `.then`, `.catch` and `.await` to Promise!

* feat: Use `await`

* feat: Use `Throwable` instead of `String` for error on Android

* Update Promise.kt

* chore: Remove unused `reject(string)` function now

* Update Promise.hpp

* Update Promise.hpp

* feat: Implement `awaitPromise(..)` on iOS

* feat: Add `RuntimeError` and `.toCpp` to Swift

* fix: Fix duplicate symbol in `RuntimeError`

* feat: Add `ErrorType`

* feat: Add `const&` funcs to `Promise` for Swift

* feat: Add `dependencies` to SwiftCxxBridge

* fix: `error` type

* feat: Add `RuntimeError.from(std.exception)`

* feat: Add `getFunctionCopy()` to `SwiftClosure`

* fix: Account for `Promise<void>` resolver

* fix: Fix `UnsafeMutableRawPointer` being nullable (wrong type)

* nitrogen

* clean

* Update HybridTestObjectSwiftKotlinSpecCxx.swift

* feat: Add actual Promise listeners!!

* fix: Add `addOnResolvedListenerCopy` func for some cases

* chore: Format

* fix: Make `getFunctionCopy()` const

* feat: Support `Promise<void>` from JS!

* feat: Add `awaitAndGet` and `awaitAndGetComplex` promise tests

* feat: Test both new functions

* Slap a good ol' `mutex` on `Promise`

* fix: Fix `Promise<void>` never resolving because args count was `1` (`undefined`)

* fix: Fix Android wrong return type

* Update HybridTestObjectCpp.cpp
2024-11-19 18:06:31 +01:00

61 lines
1.8 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.platforms = { :ios => min_ios_version_supported, :visionos => 1.0 }
s.source = { :git => "https://github.com/mrousavy/nitro.git", :tag => "#{s.version}" }
# VisionCamera Core C++ bindings
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/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/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",
}
install_modules_dependencies(s)
end