class Fastlane::Helper::BugsnagSourcemapsUploadHelper

Public Class Methods

create_bundle(platform, entry_file, path, bundle_path) click to toggle source

class methods that you define here become available in your action as `Helper::BugsnagSourcemapsUploadHelper.your_method`

# File lib/fastlane/plugin/bugsnag_sourcemaps_upload/helper/bugsnag_sourcemaps_upload_helper.rb, line 11
def self.create_bundle(platform, entry_file, path, bundle_path)
  UI.message("Creating React Native bundle")
  Action.sh("react-native bundle \
    --dev false \
    --platform #{platform} \
    --bundle-output #{bundle_path} \
    --sourcemap-output #{path} \
    --entry-file #{entry_file}")
end
show_message() click to toggle source
# File lib/fastlane/plugin/bugsnag_sourcemaps_upload/helper/bugsnag_sourcemaps_upload_helper.rb, line 60
def self.show_message
  UI.message("Hello from the bugsnag_sourcemaps_upload plugin helper!")
end
upload_bundle(api_key, platform, app_version, code_bundle_id, path, bundle_path, minified_url, strip, overwrite, wildcard_prefix, upload_sources, upload_modules, endpoint) click to toggle source
# File lib/fastlane/plugin/bugsnag_sourcemaps_upload/helper/bugsnag_sourcemaps_upload_helper.rb, line 21
def self.upload_bundle(api_key, platform, app_version, code_bundle_id, path, bundle_path, minified_url, strip, overwrite, wildcard_prefix, upload_sources, upload_modules, endpoint)
  command = "bugsnag-sourcemaps upload --api-key #{api_key} --source-map #{path} --minified-file #{bundle_path} "
  if upload_sources
    command += "--upload-sources "
  end
  if upload_modules
    command += "--upload-node-modules "
  end
  if minified_url
    command += "--minified-url #{minified_url} "
  else
    if platform == "ios"
      command += "--minified-url main.jsbundle "
    else
      command += "--minified-url index.android.bundle "
    end
  end
  if app_version
    command += "--app-version=#{app_version} "
  end
  if code_bundle_id
    command += " --code-bundle-id #{code_bundle_id} "
  end
  if strip
    command += "--strip-project-root "
  end
  if overwrite
    command += "--overwrite "
  end
  if wildcard_prefix
    command += "--add-wildcard-prefix "
  end
  if endpoint
    command += "--endpoint #{endpoint} "
  end
  UI.message("Uploading React Native bundle to Bugsnag")
  Action.sh(command.to_s)
end