Method: ZergXcode::Plugins::Addlibrary#run

Defined in:
lib/zerg_xcode/plugins/addlibrary.rb

#run(args) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/zerg_xcode/plugins/addlibrary.rb', line 28

def run(args)
  lib_target_name = args.shift
  target_name = args.shift
  project = ZergXcode.load(args.shift || '.')

  ad = "'zerg-xcode lstargets' can list project targets."
  unless lib_target = find_target(lib_target_name, project)
    print "#{lib_target_name} not found. #{ad}"
    return
  end
  unless target = find_target(target_name, project)      
    print "#{target_name} not found. #{ad}"
    return
  end

  add_library! lib_target, target, project
  project.save!
end