Class: Fastlane::Setup

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/setup/setup.rb

Direct Known Subclasses

SetupAndroid, SetupIos

Instance Method Summary collapse

Instance Method Details

#ask_for_crash_reportingObject



43
44
45
# File 'lib/fastlane/setup/setup.rb', line 43

def ask_for_crash_reporting
  FastlaneCore::CrashReporting.ask_during_setup
end

#is_android?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/fastlane/setup/setup.rb', line 32

def is_android?
  Dir["*.gradle"].count > 0
end

#is_ios?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/fastlane/setup/setup.rb', line 28

def is_ios?
  (Dir["*.xcodeproj"] + Dir["*.xcworkspace"]).count > 0
end

#runObject

Start the setup process



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/fastlane/setup/setup.rb', line 4

def run
  platform = nil
  if is_ios?
    Helper.log.info "Detected iOS/Mac project in current directory..."
    platform = :ios
  elsif is_android?
    Helper.log.info "Detected Android project in current directory..."
    platform = :android
  else
    Helper.log.info "Couldn't automatically detect the platform"
    val = agree("Is this project an iOS project? (y/n) ".yellow, true)
    platform = (val ? :ios : :android)
  end

  if platform == :ios
    SetupIos.new.run
  elsif platform == :android
    SetupAndroid.new.run
  else
    raise "Couldn't find platform '#{platform}'"
  end
  ask_for_crash_reporting
end

#show_analyticsObject



36
37
38
39
40
41
# File 'lib/fastlane/setup/setup.rb', line 36

def show_analytics
  Helper.log.info "fastlane will send the number of errors for each action to"
  Helper.log.info "https://github.com/fastlane/enhancer to detect integration issues"
  Helper.log.info "No sensitive/private information will be uploaded"
  Helper.log.info("You can disable this by adding `opt_out_usage` to your Fastfile")
end