Class: Build::BuildItem

Inherits:
Object
  • Object
show all
Defined in:
lib/core_blur/build_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(snapshot, real_device, simulator, merge_master, force_cover, publish_shell, fork = false) ⇒ BuildItem

Returns a new instance of BuildItem.



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/core_blur/build_item.rb', line 13

def initialize(snapshot, real_device, simulator, merge_master, force_cover, publish_shell, fork = false)
  @snapshot = snapshot.to_s.downcase  == "true"
  @real_device = real_device.to_s.downcase  == "true"
  @simulator = simulator.to_s.downcase  == "true"
  @merge_master = merge_master.to_s.downcase  == "true"
  @force_cover = force_cover.to_s.downcase  == "true"
  @publish_shell = publish_shell.to_s.downcase  == "true"
  @fork = fork.to_s.downcase  == "true"
  @pusher = Push.instance
  validate
end

Instance Attribute Details

#force_coverObject

Returns the value of attribute force_cover.



9
10
11
# File 'lib/core_blur/build_item.rb', line 9

def force_cover
  @force_cover
end

#forkObject

Returns the value of attribute fork.



11
12
13
# File 'lib/core_blur/build_item.rb', line 11

def fork
  @fork
end

#merge_masterObject

Returns the value of attribute merge_master.



8
9
10
# File 'lib/core_blur/build_item.rb', line 8

def merge_master
  @merge_master
end

#publish_shellObject

Returns the value of attribute publish_shell.



10
11
12
# File 'lib/core_blur/build_item.rb', line 10

def publish_shell
  @publish_shell
end

#pusherObject

Returns the value of attribute pusher.



12
13
14
# File 'lib/core_blur/build_item.rb', line 12

def pusher
  @pusher
end

#real_deviceObject

Returns the value of attribute real_device.



6
7
8
# File 'lib/core_blur/build_item.rb', line 6

def real_device
  @real_device
end

#simulatorObject

Returns the value of attribute simulator.



7
8
9
# File 'lib/core_blur/build_item.rb', line 7

def simulator
  @simulator
end

#snapshotObject

Returns the value of attribute snapshot.



5
6
7
# File 'lib/core_blur/build_item.rb', line 5

def snapshot
  @snapshot
end

Instance Method Details

#special_setup(pod_name) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/core_blur/build_item.rb', line 31

def special_setup(pod_name)
  if pod_name == "MUCDebugPlugins"
    @real_device = false
    @simulator = false
    puts "⚠️ 特殊处理:#{pod_name} real_device重设为false simulator重设为false"
  end
end

#validateObject



24
25
26
27
28
29
30
# File 'lib/core_blur/build_item.rb', line 24

def validate
  if merge_master and snapshot
    error = "SNAPSHOT包发布不能同时选择合并到master分支, 请检查参数"
    pusher.push("❌ 打包失败", error)
    Process.exit(-1)
  end
end