Last active
March 23, 2016 19:29
-
-
Save phatblat/fc78cfd8f0a81cf9a254 to your computer and use it in GitHub Desktop.
Fastlane action to build and archive a framework using Carthage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is adapted from @kcharwood's af_build_carthage_frameworks.rb