-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathweak-node-api.podspec
More file actions
31 lines (25 loc) · 1.21 KB
/
weak-node-api.podspec
File metadata and controls
31 lines (25 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
# We need to restore symlinks in the versioned framework directories,
# as these are not preserved when in the archive uploaded to NPM
unless defined?(@restored)
RESTORE_COMMAND = "node '#{File.join(__dir__, "dist/restore-xcframework-symlinks.js")}'"
Pod::UI.info("[weak-node-api] ".green + "Restoring symbolic links in Xcframework")
system(RESTORE_COMMAND) or raise "Failed to restore symlinks in Xcframework"
# Setting a flag to avoid running this command on every require
@restored = true
end
Pod::Spec.new do |s|
s.name = package["name"]
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/callstackincubator/react-native-node-api.git", :tag => "#{s.version}" }
s.source_files = "generated/*.hpp", "include/*.h"
s.public_header_files = "generated/*.hpp", "include/*.h"
s.vendored_frameworks = "build/*/weak-node-api.xcframework"
# Avoiding the header dir to allow for idiomatic Node-API includes
s.header_dir = nil
end