class Fastlane::Actions::AndroidChangePackageIdentifierRevertAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/android_change_package_identifier/actions/android_change_package_identifier_action.rb, line 123
def self.authors
  ["MaximusMcCann"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/android_change_package_identifier/actions/android_change_package_identifier_action.rb, line 135
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :manifest,
                            env_name: "",
                         description: "Optional custom location for AndroidManifest.xml",
                            optional: false,
                                type: String,
                       default_value: "app/src/main/AndroidManifest.xml")
  ]
end
description() click to toggle source
# File lib/fastlane/plugin/android_change_package_identifier/actions/android_change_package_identifier_action.rb, line 119
def self.description
  "Reverts the manifest's package identifier from ANDROID_CHANGE_PACKAGE_IDENTIFIER_ORIGINAL"
end
details() click to toggle source
# File lib/fastlane/plugin/android_change_package_identifier/actions/android_change_package_identifier_action.rb, line 131
def self.details
  "Reverts the manifest's package identifier from ANDROID_CHANGE_PACKAGE_IDENTIFIER_ORIGINAL"
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/android_change_package_identifier/actions/android_change_package_identifier_action.rb, line 146
def self.is_supported?(platform)
  platform == :android
end
return_value() click to toggle source
# File lib/fastlane/plugin/android_change_package_identifier/actions/android_change_package_identifier_action.rb, line 127
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/android_change_package_identifier/actions/android_change_package_identifier_action.rb, line 95
def self.run(params)
  require 'nokogiri'

  original = Actions.lane_context[SharedValues::ANDROID_CHANGE_PACKAGE_IDENTIFIER_ORIGINAL]

  if original.to_s.strip.length != 0
    manifest = params[:manifest]
  else
    UI.error("no string for ANDROID_CHANGE_PACKAGE_IDENTIFIER_ORIGINAL.  Have you run android_change_package_identifier?")
  end

  doc = File.open(manifest) { |f|
    @doc = Nokogiri::XML(f)

    @doc.css("manifest").each do |response_node|
      response_node["package"] = original
      UI.message("Reverting package identifier to: #{original}")
    end

    File.write(manifest, @doc.to_xml)
  }

end