-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Specify RN version as compiler flag (#490)
* feat: Specify RN version in iOS * Set RN version * docs * fix: Adjust scripts and add bootstrap * fix: Fix react-native path again * feat: Add `REACT_NATIVE_VERSION` flag to gradle * fix: Use `tasks.register` to avoid reconfiguration * fix: Use `project.layout.buildDirectory` instead of `project.buildDir` * fix: arguments with comma * fix: Use `buildDir` again * fix: Pass `YES` * feat: Add CMake C++ flags now * fix: Indicate default overridden `HybridObject` constructor * perf: Make `equals()` a bit faster
- Loading branch information
Showing
9 changed files
with
216 additions
and
140 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require "json" | ||
|
||
# Gets the path of the react-native/package.json file. | ||
def get_react_native_package_path() | ||
pod_root = Pod::Config.instance.installation_root.to_s | ||
return `cd "#{pod_root}" && node --print "require.resolve('react-native/package.json')"`.strip! | ||
end | ||
|
||
# Finds out whether react-native is available, or not. | ||
# This works by checking if the react-native node package can be resolved. | ||
def has_react_native() | ||
react_native_package_path = get_react_native_package_path() | ||
return File.exist?(react_native_package_path) | ||
end | ||
|
||
# Gets the minor react-native version (e.g 76 for 0.76.4) | ||
def get_react_native_version() | ||
react_native_package_path = get_react_native_package_path() | ||
if !File.exist?(react_native_package_path) | ||
raise "[NitroModules] Couldn't find react-native path! File '#{react_native_package_path}' doesn't exist!" | ||
end | ||
react_native_package = JSON.parse(File.read(react_native_package_path)) | ||
react_native_version = react_native_package['version'] | ||
react_native_minor_version = react_native_version.split('.')[1].to_i | ||
Pod::UI.puts "[NitroModules] Found react-native #{react_native_version} (#{react_native_minor_version}) in #{File.dirname(react_native_package_path)}!" | ||
return react_native_minor_version | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
"cpp/", | ||
"app.plugin.js", | ||
"*.podspec", | ||
"nitro_pod_utils.rb", | ||
"README.md" | ||
], | ||
"keywords": [ | ||
|