Skip to content

Instantly share code, notes, and snippets.

@phatblat
Last active March 23, 2016 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phatblat/fc78cfd8f0a81cf9a254 to your computer and use it in GitHub Desktop.
Save phatblat/fc78cfd8f0a81cf9a254 to your computer and use it in GitHub Desktop.
Fastlane action to build and archive a framework using Carthage
module Fastlane
module Actions
module SharedValues
CARTHAGE_FRAMEWORK = :CARTHAGE_FRAMEWORK
end
class BuildCarthageFrameworkAction < Action
def self.run(params)
Actions.sh("carthage build --no-skip-current")
Actions.sh("carthage archive #{params[:framework_name]}")
path = "#{params[:framework_name]}.framework.zip"
Actions.lane_context[SharedValues::CARTHAGE_FRAMEWORK] = path
Helper.log.info "Carthage generated #{params[:framework_name]}.framework"
return path
end
#####################################################
# @!group Documentation
#####################################################
def self.description
"Build and archive a Framework project using Carthage"
end
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :framework_name,
env_name: "CARTHAGE_FRAMEWORK_NAME", # The name of the environment variable
description: "The name of the framework for Carthage to generate", # a short description of this parameter
is_string:true)
]
end
def self.output
[
['CARTHAGE_FRAMEWORK', 'The path to the generate Carthage framework']
]
end
def self.return_value
"The path to the zipped framework"
end
def self.authors
["kcharwood", "phatblat"]
end
def self.is_supported?(platform)
return true
end
end
end
end
@phatblat
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment