class Dongjia::EnterpriseInspector

Public Class Methods

inspect() click to toggle source

校验 东家 和 东家企业版 的文件

# File lib/dongjia_enterprise_inspector.rb, line 8
def self.inspect()

  project_path = File.join(Dir.pwd, '东家.xcodeproj')

  if !File.exist?(project_path)
    return []
  end
  
  proj = Xcodeproj::Project.open(project_path)
  
  target_dongjia = nil
  target_dongjia_ent = nil
  
  proj.targets.each do |target|
    if target.name == '东家'
      target_dongjia = target
    elsif target.name == '东家企业版'
      target_dongjia_ent = target
    end
  end
  
  if target_dongjia == nil or target_dongjia_ent == nil
    return []
  end
  
  mismatched_files = []
  
  for file_ref in target_dongjia.source_build_phase.files_references
    if !target_dongjia_ent.source_build_phase.include?(file_ref)
      mismatched_files << file_ref.display_name
    end
  end
  
  mismatched_files
  
end