Skip to content

Use relative installation root instead of absolute to avoid embedding absolute paths in pods project #33187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Pod::Spec.new do |s|
s.source_files = "**/*.{h,m,mm,swift}"
s.requires_arc = true

s.dependency "React"
s.dependency "React-Core"
s.dependency "RCT-Folly", folly_version

# s.dependency "..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
LastUpgradeVersion = "1210"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
LastUpgradeVersion = "1210"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
LastUpgradeVersion = "1210"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
Expand Down
7 changes: 4 additions & 3 deletions scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -546,22 +546,23 @@ def use_react_native_codegen!(spec, options={})
library_name = options[:library_name] ||= "#{spec.name.gsub('_','-').split('-').collect(&:capitalize).join}Spec"
Pod::UI.puts "[Codegen] Found #{library_name}"

relative_installation_root = Pod::Config.instance.installation_root.relative_path_from(Pathname.pwd)
output_dir = options[:output_dir] ||= $CODEGEN_OUTPUT_DIR
output_dir_module = "#{output_dir}/#{$CODEGEN_MODULE_DIR}"
output_dir_component = "#{output_dir}/#{$CODEGEN_COMPONENT_DIR}"

codegen_config = {
"modules" => {
:js_srcs_pattern => "Native*.js",
:generated_dir => "#{Pod::Config.instance.installation_root}/#{output_dir_module}/#{library_name}",
:generated_dir => "#{relative_installation_root}/#{output_dir_module}/#{library_name}",
:generated_files => [
"#{library_name}.h",
"#{library_name}-generated.mm"
]
},
"components" => {
:js_srcs_pattern => "*NativeComponent.js",
:generated_dir => "#{Pod::Config.instance.installation_root}/#{output_dir_component}/#{library_name}",
:generated_dir => "#{relative_installation_root}/#{output_dir_component}/#{library_name}",
:generated_files => [
"ComponentDescriptors.h",
"EventEmitters.cpp",
Expand Down Expand Up @@ -610,7 +611,7 @@ def use_react_native_codegen!(spec, options={})
spec.script_phase = {
:name => 'Generate Specs',
:input_files => input_files, # This also needs to be relative to Xcode
:output_files => ["${DERIVED_FILE_DIR}/codegen-#{library_name}.log"].concat(generated_files.map { |filename| " ${PODS_TARGET_SRCROOT}/#{filename}"} ),
:output_files => ["${DERIVED_FILE_DIR}/codegen-#{library_name}.log"].concat(generated_files.map { |filename| "${PODS_TARGET_SRCROOT}/#{filename}"} ),
# The final generated files will be created when this script is invoked at Xcode build time.
:script => get_script_phases_no_codegen_discovery(
react_native_path: react_native_path,
Expand Down