Class: Fastlane::Actions::ReactPodAction

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

Class Method Summary collapse

Class Method Details

.authorsObject



29
30
31
# File 'lib/fastlane/plugin/react_native_util/actions/react_pod_action.rb', line 29

def self.authors
  ["Jimmy Dee"]
end

.available_optionsObject



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/fastlane/plugin/react_native_util/actions/react_pod_action.rb', line 42

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :chdir,
                         description: 'Root of app project',
                            optional: true,
                       default_value: '.',
                                type: String),
    FastlaneCore::ConfigItem.new(key: :update,
                         description: 'Update a converted project',
                            optional: true,
                       default_value: false,
                           is_string: false),
    FastlaneCore::ConfigItem.new(key: :repo_update,
                            env_name: 'REACT_NATIVE_UTIL_REPO_UPDATE',
                         description: 'Update local podspec repo',
                            optional: true,
                       default_value: true,
                           is_string: false)
  ]
end

.descriptionObject



25
26
27
# File 'lib/fastlane/plugin/react_native_util/actions/react_pod_action.rb', line 25

def self.description
  "Community utilities for React Native projects"
end

.detailsObject



37
38
39
40
# File 'lib/fastlane/plugin/react_native_util/actions/react_pod_action.rb', line 37

def self.details
  # Optional:
  "more to come"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/fastlane/plugin/react_native_util/actions/react_pod_action.rb', line 63

def self.is_supported?(platform)
  platform == :ios
end

.return_valueObject



33
34
35
# File 'lib/fastlane/plugin/react_native_util/actions/react_pod_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) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/fastlane/plugin/react_native_util/actions/react_pod_action.rb', line 8

def self.run(params)
  UI.message "Running in #{params[:chdir]}"
  Dir.chdir params[:chdir] do
    converter = ::ReactNativeUtil::Converter.new repo_update: params[:repo_update]

    begin
      if params[:update]
        converter.update_project!
      else
        converter.convert_to_react_pod!
      end
    rescue ::ReactNativeUtil::BaseException => e
      UI.user_error! e.message
    end
  end
end