Class: Gct::Command::Build::R

Inherits:
Gct::Command::Build show all
Defined in:
lib/gct/command/build/r.rb

Instance Method Summary collapse

Methods inherited from Gct::Command

#auto_add_tag, #check_branch_can_be_update, #config_gitlab, #current_branch, #file_contents, #get_project, #gitlab_error, options, run

Constructor Details

#initialize(argv) ⇒ R

Returns a new instance of R.



13
14
15
# File 'lib/gct/command/build/r.rb', line 13

def initialize(argv)
  super
end

Instance Method Details

#buildRObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/gct/command/build/r.rb', line 25

def buildR
  puts "starting search R script ...".green
  project = get_project
  if project
      objects = project.objects
      findR = false
      objects.each do |obj|
          if obj.instance_of?(Xcodeproj::Project::Object::PBXShellScriptBuildPhase) and obj.name == "[GCT] create R"
            findR = true
              script_export = "export project_path=$(cd `dirname $0`; pwd) \nexport PODS_ROOT=${project_path}\"/Pods\" \nexport SRCROOT=${project_path} \n"
              exe_script = script_export + obj.shell_script
              system exe_script
          end
          
      end
      if !findR
        puts "没有找到 '[GCT] create R' 脚本".red
      end
  end
end

#runObject



21
22
23
# File 'lib/gct/command/build/r.rb', line 21

def run
  buildR
end

#validate!Object



17
18
19
# File 'lib/gct/command/build/r.rb', line 17

def validate!
  super
end