lib/command/prebuild.rb in cocoapods-binary-cache-0.1.6 vs lib/command/prebuild.rb in cocoapods-binary-cache-0.1.7
- old
+ new
@@ -6,30 +6,34 @@
class Binary < Command
class Prebuild < Binary
self.arguments = [CLAide::Argument.new("CACHE-BRANCH", false)]
def self.options
[
+ ["--config", "Config (Debug, Test...) to prebuild"],
["--push", "Push cache to repo upon completion"],
["--all", "Prebuild all binary pods regardless of cache validation"],
["--targets", "Targets to prebuild. Use comma (,) to specify a list of targets"]
- ]
+ ].concat(super)
end
def initialize(argv)
super
- @prebuild_all_pods = argv.flag?("all")
- @prebuild_targets = argv.option("targets", "").split(",")
+ prebuild_all_pods = argv.flag?("all")
+ prebuild_targets = argv.option("targets", "").split(",")
+ update_cli_config(
+ :prebuild_job => true,
+ :prebuild_all_pods => prebuild_all_pods,
+ :prebuild_config => argv.option("config")
+ )
+ update_cli_config(:prebuild_targets => prebuild_targets) unless prebuild_all_pods
@prebuilder = PodPrebuild::CachePrebuilder.new(
config: prebuild_config,
cache_branch: argv.shift_argument || "master",
push_cache: argv.flag?("push")
)
end
def run
- Pod::Podfile::DSL.binary_cache_cli_config[:prebuild_job] = true
- Pod::Podfile::DSL.binary_cache_cli_config[:prebuild_all_pods] = @prebuild_all_pods
- Pod::Podfile::DSL.binary_cache_cli_config[:prebuild_targets] = @prebuild_targets unless @prebuild_all_pods
@prebuilder.run
end
end
end
end