Skip to content

Commit

Permalink
Use cocoapods default prefix header
Browse files Browse the repository at this point in the history
The current search logic didn't write the default prefix header which is
required for some cocoapods. It follows the logic defined in
lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb:170

Additonally, this was discovered when updating to react native and there
was a required fix for bazel here, which we won't need to keep up with
facebook/react-native#28946
  • Loading branch information
jerrymarino committed Jul 20, 2020
1 parent 88bec8e commit 0dca5ae
Show file tree
Hide file tree
Showing 69 changed files with 447 additions and 1,838 deletions.
29 changes: 0 additions & 29 deletions BazelExtensions/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -83,35 +83,6 @@ def acknowledged_target(name,
visibility=["//visibility:public"]
)

# pch_with_name_hint
#
# Take in a name hint and return the PCH with that name
#
# Parameters
#
# hint - Suggestion of pch file name. If any part of this is in a PCH
# filename it will match
#
# sources - a list of source file patterns with pch extensions to search


def pch_with_name_hint(hint, sources):
# Recursive glob the sources directories and the root directory
candidates = native.glob(["*.pch", hint + "/*.pch"] + sources)
if len(candidates) == 0:
return None

# We want to get the candidates in order of lowest to highest
for candidate in candidates:
if hint in candidate:
return candidate
# It is a convention in iOS/OSX development to use a PCH
# with the name of the target.
# This is a hack because, the recursive glob may find some
# arbitrary PCH.
return None


def _make_module_map(pod_name, module_name, deps, is_system):
# Up some dirs to the compilation root
# bazel-out/ios_x86_64-fastbuild/genfiles/external/__Pod__
Expand Down
1 change: 1 addition & 0 deletions Examples/React/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ end

target 'ios-app' do
rn_pods()
pod "SocketRocket"
end

Loading

0 comments on commit 0dca5ae

Please sign in to comment.