Skip to content

Commit a666c06

Browse files
committed
update podspec
1 parent 3b74e9a commit a666c06

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

ReactNativeNavigation.podspec

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
require 'json'
2-
require 'find'
32

43
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
54

65
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
76

8-
# Detect if this is a Swift project by looking for user AppDelegate.swift files
9-
start_dir = File.expand_path('../../', __dir__)
10-
swift_delegate_path = nil
11-
begin
12-
Find.find(start_dir) do |path|
13-
# Skip hidden directories and common directories that shouldn't be searched
14-
Find.prune if path =~ /\/(\.git|\.Trash|node_modules|Pods|DerivedData|build)\b/
7+
# Detect if this is a Swift project by checking common iOS project locations
8+
# This avoids the slow recursive Find.find() that can take minutes in CI
9+
def check_for_swift_app_delegate(base_dir)
10+
# Common project directory names to check
11+
['ios', 'example/ios', 'playground/ios', 'app/ios', 'demo/ios'].each do |ios_dir|
12+
ios_path = File.join(base_dir, ios_dir)
13+
next unless Dir.exist?(ios_path)
1514

16-
if path =~ /AppDelegate\.swift$/
17-
swift_delegate_path = path
18-
break
15+
# Check common AppDelegate.swift locations within ios directory
16+
Dir.glob(File.join(ios_path, '**/AppDelegate.swift'), File::FNM_DOTMATCH).each do |path|
17+
# Exclude Pods, build, and DerivedData directories
18+
next if path =~ /\/(Pods|build|DerivedData)\//
19+
return path if File.exist?(path)
1920
end
2021
end
21-
rescue Errno::EACCES, Errno::EPERM
22-
# Ignore permission errors
22+
nil
2323
end
2424

25+
start_dir = File.expand_path('../../', __dir__)
26+
swift_delegate_path = check_for_swift_app_delegate(start_dir)
2527
swift_project = swift_delegate_path && File.exist?(swift_delegate_path)
2628

2729
# Debug output

0 commit comments

Comments
 (0)