-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix_pod_config.rb
More file actions
27 lines (21 loc) 路 1.07 KB
/
Copy pathfix_pod_config.rb
File metadata and controls
27 lines (21 loc) 路 1.07 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
require 'xcodeproj'
project_path = 'ios/App/App.xcodeproj'
project = Xcodeproj::Project.open(project_path)
target = project.targets.find { |t| t.name == 'App' }
# Find the configuration files references
pods_debug_config = project.files.find { |f| f.path == 'Pods/Target Support Files/Pods-App/Pods-App.debug.xcconfig' }
pods_release_config = project.files.find { |f| f.path == 'Pods/Target Support Files/Pods-App/Pods-App.release.xcconfig' }
group = project.main_group['Pods'] || project.main_group.new_group('Pods')
group = project.main_group['Pods'] || project.main_group.new_group('Pods')
# Set the base configuration for each build config
target.build_configurations.each do |config|
if config.name == 'Debug'
config.base_configuration_reference = pods_debug_config
puts "Linked Debug config to Pods-App.debug.xcconfig"
elsif config.name == 'Release'
config.base_configuration_reference = pods_release_config
puts "Linked Release config to Pods-App.release.xcconfig"
end
end
project.save
puts "馃帀 Successfully linked Xcode configuration to CocoaPods!"