Class: Fastlane::Actions::EnCiUtilsInitAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/ciutils/actions/en_ci_utils_init_action.rb

Direct Known Subclasses

CiutilsAction

Class Method Summary collapse

Class Method Details

.authorsObject



54
55
56
# File 'lib/fastlane/plugin/ciutils/actions/en_ci_utils_init_action.rb', line 54

def self.authors
  ["Nicolae Ghimbovschi"]
end

.descriptionObject



50
51
52
# File 'lib/fastlane/plugin/ciutils/actions/en_ci_utils_init_action.rb', line 50

def self.description
  "Sets env variables for gym, scan, swiftlint and lizard actions"
end

.detailsObject



58
59
60
# File 'lib/fastlane/plugin/ciutils/actions/en_ci_utils_init_action.rb', line 58

def self.details
  "Call this action to pre-set gym, scan, swiftlint and lizard to use the build folder for intermediate files and reports"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/fastlane/plugin/ciutils/actions/en_ci_utils_init_action.rb', line 62

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



4
5
6
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/fastlane/plugin/ciutils/actions/en_ci_utils_init_action.rb', line 4

def self.run(params)
  output_path = "./build"
  reports_path = "#{output_path}/reports"
  logs_path = "#{output_path}/logs"

  ENV['ENCI_OUTPUT_PATH'] = output_path
  ENV['ENCI_REPORTS_PATH'] = reports_path
  ENV['ENCI_LOGS_PATH'] = logs_path

  # gym: ipa
  ENV['GYM_OUTPUT_DIRECTORY'] = output_path
  ENV['GYM_BUILDLOG_PATH'] = "#{logs_path}/gym"
  ENV['GYM_RESULT_BUNDLE'] = "true"
  ENV['GYM_DERIVED_DATA_PATH'] = "#{output_path}/deriveddata_gym"

  # scan: unit tests
  ENV['SCAN_OUTPUT_DIRECTORY'] = "#{reports_path}/unittests"
  ENV['SCAN_BUILDLOG_PATH'] = "#{logs_path}/scan/"
  ENV['SCAN_DERIVED_DATA_PATH'] = "#{output_path}/deriveddata_scan"
  ENV['SCAN_OUTPUT_TYPES'] = "html,junit,json-compilation-database"
  ENV['SCAN_CONFIGURATION'] = "Debug"
  ENV['SCAN_XCARGS'] = "COMPILER_INDEX_STORE_ENABLE=NO"

  # slather: code coverage reports
  ENV['FL_SLATHER_BUILD_DIRECTORY'] = "#{output_path}/deriveddata_scan"
  ENV['FL_SLATHER_OUTPUT_DIRECTORY'] = "#{reports_path}"
  ENV['FL_SLATHER_COBERTURA_XML_ENABLED'] = "true"
  ENV['FL_SLATHER_USE_BUNDLE_EXEC'] = "true"
  ENV['FL_SLATHER_HTML_ENABLED'] = "false"
  ENV['FL_SLATHER_INPUT_FORMAT'] = "profdata"
  ENV['FL_SLATHER_CONFIGURATION'] = "Debug"

  # swiftlint: static code analysis and linter
  ENV['FL_SWIFTLINT_OUTPUT'] = "#{reports_path}/swiftlint.txt"

  # lizard: static code analysis and linter
  ENV['FL_LIZARD_OUTPUT'] = "#{reports_path}/lizard-report.xml"

  # oclint: static code analysis and linter
  ENV['FL_OCLINT_REPORT_TYPE'] = "pmd"
  ENV['FL_OCLINT_ENABLE_CLANG_STATIC_ANALYZER'] = "true"

  ENV['BUILD_NUMBER'] = Helper::CiutilsHelper.en_ci_build_number()
  ENV['FL_BUILD_NUMBER_BUILD_NUMBER'] = ENV['BUILD_NUMBER']
end