Module: Pod::Podfile::DSL

Defined in:
lib/cocoapods-aqarahome/command/Podfile_Dev.rb

Instance Method Summary collapse

Instance Method Details

#code_signing_allow_no!Object



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-aqarahome/command/Podfile_Dev.rb', line 44

def code_signing_allow_no!
  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
        target.build_configurations.each do |config|
          config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
        end
      end
      if target.name == "Pods-AqaraHome"
        puts "Updating #{target.name} OTHER_LDFLAGS To fit Xcode15.0.1+"
        target.build_configurations.each do |config|
          xcconfig_path = config.base_configuration_reference.real_path

          # read from xcconfig to build_settings dictionary
          build_settings = Hash[*File.read(xcconfig_path).lines.map{|x| x.split(/\s*=\s*/, 2)}.flatten]

          File.open(xcconfig_path,'r+'){|f|
            f.each_line{|l|
              s=""
              if l.include?('iconv.2.4.0')
                len = l.length
                s+=l.gsub!("iconv.2.4.0", "iconv.2")
                #seek back to the beginning of the line.
                f.seek(-len, IO::SEEK_CUR)
                #overwrite line with spaces and add a newline char
                f.write(s * 1)
                f.write(' ' * (len - l.length - 1))
                break
              end
            }
          }
        end
      end
    end
  end
end

#dev_pods(pods, git_pull = false, branch = 'aqara') ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/cocoapods-aqarahome/command/Podfile_Dev.rb', line 7

def dev_pods(pods, git_pull = false, branch = 'aqara')
  if branch.length > 0
    if git_pull
      pull_local_sdk_origin_source(pods)
    elsif
      podStr = pods.join(", ")
      puts "成功清除私有库".green + "#{podStr}".yellow + "的缓存数据".green
      pods.each do |pod|
        args = ['clean',pod, "--all"]
        Pod::Command::Cache.run(args)
      end
      pull_latest_code_and_resolve_conflict(pods)
    end
    # pods.each do |name|
    #   pod name, :git => "https://xyz.com/ios/#{name}.git", :branch => "#{branch}"
    # end

    # puts "lebbay: using remote pods with branch: #{branch}".green
  else
    # 自定义开发目录
    development_path = Config.instance.dev_pods_path
    pods.each do |name|
      pod name, :path => "#{development_path}#{name}"
    end
    puts "lebbay: using local pods with path: #{development_path}xxx".green
  end
end

#watch_upObject



35
36
37
38
39
40
41
42
# File 'lib/cocoapods-aqarahome/command/Podfile_Dev.rb', line 35

def watch_up
  puts '|========================================================================|'.red
  (0..10).each do |i|
    puts '|                                                                        |'.red unless i == 5
    puts '|                       '.red + '你小子注意更新私有库SDK'.green + '                          |'.red unless i != 5
  end
  puts '|========================================================================|'.red
end