class Fastlane::Actions::DoccAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/docc/actions/docc_action.rb, line 29
def self.authors
  ["Kukurijek"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/docc/actions/docc_action.rb, line 42
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :scheme,
                                 env_name: "DOCC_SCHEME",
                                 description: "Scheme to use when calling docc",
                                 optional: false,
                                 type: String),

    FastlaneCore::ConfigItem.new(key: :derived_data_path,
                                 env_name: "DOCC_DERIVED_DATA_PATH",
                                 description: "A description of your option",
                                 optional: true,
                                 type: String)
  ]
end
description() click to toggle source
# File lib/fastlane/plugin/docc/actions/docc_action.rb, line 25
def self.description
  "Automate docc - documentation for swift frameworks and packages"
end
details() click to toggle source
# File lib/fastlane/plugin/docc/actions/docc_action.rb, line 37
def self.details
  # Optional:
  "Xcode 13 has new features to build, write, and browse documentation for Swift frameworks and packages. With this plugin you can automate building of your documentation (e.g. in CI), so you can deploy the new docs automatically."
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/docc/actions/docc_action.rb, line 58
def self.is_supported?(platform)
  # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
  # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
  [:ios, :mac, :watch].include?(platform)
  true
end
return_value() click to toggle source
# File lib/fastlane/plugin/docc/actions/docc_action.rb, line 33
def self.return_value
  # If your method provides a return value, you can describe here what it does
end
run(params) click to toggle source
# File lib/fastlane/plugin/docc/actions/docc_action.rb, line 7
def self.run(params)
  command = []
  command << "xcodebuild docbuild"
  command << "-scheme #{params[:scheme]}"
  command << "-derivedDataPath #{params[:derived_data_path]}" unless params[:derived_data_path].nil?

  shell_command = command.join(' ')
  UI.message(shell_command.to_s)
  selected_version = sh("xcodebuild -version").match(/^Xcode (.*)$/)
  pure_version = selected_version.to_s.sub('Xcode ', '')

  unless selected_version.nil? == true
    UI.user_error!("Make sure Xcode 13 is installed and select it for Command Line Tool - your version: #{selected_version}") unless pure_version.to_i >= 13.0
  end

  sh(shell_command.to_s)
end