Class: CocoapodsPruneLocalizations::Utils

Inherits:
Object
  • Object
show all
Defined in:
lib/utils.rb

Class Method Summary collapse

Class Method Details

.user_project_localizations(umbrella_targets) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/utils.rb', line 3

def self.user_project_localizations(umbrella_targets)
  localizations = []
  user_projects = umbrella_targets.map { |target| target.user_project_path }
  user_projects.uniq!
  
  user_projects.each do |project_path|
    project = Xcodeproj::Project.open project_path
    project.files.each do |file_ref|
      if file_ref.path.include? ".lproj"
        localizations << File.dirname(file_ref.path)
      end
    end
  end
  
  localizations.uniq!
  localizations
end