Class: CocoapodsLZClear::Tools

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-lzclear/command/lzclear.rb

Instance Method Summary collapse

Instance Method Details

#get_project(file_path) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/cocoapods-lzclear/command/lzclear.rb', line 21

def get_project(file_path)

      projPath = 'unknow'

      Dir.foreach(file_path) do |file|

          extn = File.extname file

          if extn == '.xcodeproj'

              projPath = file_path+file

              break

          end

      end

      return projPath

end

#get_target(path) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/cocoapods-lzclear/command/lzclear.rb', line 43

def get_target(path)

  targets = Array.new

  project = Xcodeproj::Project.open(path)

  target = project.targets[0]

  if target != nil

    target.build_phases.each do |phase|

        if phase.instance_of? Xcodeproj::Project::Object::PBXShellScriptBuildPhase

            if phase.name == '[CP] Copy Pods Resources'
                
                files = phase.output_paths
                if files != nil
                    files.clear
                    Pod::UI.puts 'Clean Output Files!'
                end

                paths = phase.output_file_list_paths
                if paths != nil
                    paths.clear
                    Pod::UI.puts 'Clean Output File Lists!'
                end
            end

        end
    end

  end

  project.save

end