Class: Fastlane::Helper::HumanableBuildNumberHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/humanable_build_number/helper/humanable_build_number_helper.rb

Class Method Summary collapse

Class Method Details

.android_project?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/fastlane/plugin/humanable_build_number/helper/humanable_build_number_helper.rb', line 26

def self.android_project?
  Dir.glob("*gradle*").size > 0 ? true : false
end

.cook_humanable(date = nil) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/fastlane/plugin/humanable_build_number/helper/humanable_build_number_helper.rb', line 6

def self.cook_humanable(date = nil)
  date ||= Time.now
  date = DateTime.parse(date) if date.kind_of?String

  build_number = date.strftime('%m%d%H%M')

  Actions.lane_context[Actions::SharedValues::HUMANABLE_BUILD_NUMBER] = build_number
  ENV[Actions::SharedValues::HUMANABLE_BUILD_NUMBER.to_s] = build_number
end

.ios_project?Boolean

Returns:

  • (Boolean)


16
17
18
19
20
21
22
23
24
# File 'lib/fastlane/plugin/humanable_build_number/helper/humanable_build_number_helper.rb', line 16

def self.ios_project?
  ['*.xcodeproj', '*.xcworkspace'].each do |pattern|
    if Dir.glob(pattern).size > 0
      return true
    end
  end

  false
end

.set_build_number_for_android_tipsObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/fastlane/plugin/humanable_build_number/helper/humanable_build_number_helper.rb', line 30

def self.set_build_number_for_android_tips
  division_count = 50
  [
    'Here is a example to follow to set build number with gradle:',
    '-' * division_count,
    'lane :set_build_number do',
    '  gradle(',
    '    task: "assemble", ',
    '    build_type: "debug", ',
    '    properties: { ',
    '      "versionCode" => humanable_build_number',
    '    }',
    '  )',
    'end',
    '-' * division_count
  ].join("\n")
end