lib/command/config.rb in cocoapods-binary-cache-0.1.7 vs lib/command/config.rb in cocoapods-binary-cache-0.1.8
- old
+ new
@@ -3,17 +3,18 @@
module PodPrebuild
def self.config
PodPrebuild::Config.instance
end
- class Config
+ class Config # rubocop:disable Metrics/ClassLength
attr_accessor :dsl_config, :cli_config
def initialize(path)
@deprecated_config = File.exist?(path) ? PodPrebuild::JSONFile.new(path).data : {}
@dsl_config = {}
@cli_config = {}
+ @detected_config = {}
end
def self.instance
@instance ||= new("PodBinaryCacheConfig.json")
end
@@ -81,11 +82,11 @@
def prebuild_all_pods?
@cli_config[:prebuild_all_pods] || @dsl_config[:prebuild_all_pods]
end
def excluded_pods
- @dsl_config[:excluded_pods] || Set.new
+ ((@dsl_config[:excluded_pods] || Set.new) + (@detected_config[:excluded_pods] || Set.new)).to_set
end
def dev_pods_enabled?
@dsl_config[:dev_pods_enabled]
end
@@ -120,14 +121,34 @@
def prebuild_code_gen
@dsl_config[:prebuild_code_gen]
end
+ def strict_diagnosis?
+ @dsl_config[:strict_diagnosis]
+ end
+
def targets_to_prebuild_from_cli
@cli_config[:prebuild_targets] || []
end
+ def update_detected_prebuilt_pod_names!(value)
+ @detected_config[:prebuilt_pod_names] = value
+ end
+
+ def update_detected_excluded_pods!(value)
+ @detected_config[:excluded_pods] = value
+ end
+
+ def prebuilt_pod_names
+ @detected_config[:prebuilt_pod_names] || Set.new
+ end
+
+ def tracked_prebuilt_pod_names
+ prebuilt_pod_names - excluded_pods
+ end
+
private
def applicable_dsl_config
[
:cache_repo,
@@ -143,10 +164,11 @@
:disable_dsym,
:dont_remove_source_code,
:build_args,
:save_cache_validation_to,
:validate_prebuilt_settings,
- :prebuild_code_gen
+ :prebuild_code_gen,
+ :strict_diagnosis
]
end
def cache_repo_config
@cache_repo_config ||= begin