Class: PodPrebuild::Config
- Inherits:
-
Object
- Object
- PodPrebuild::Config
- Defined in:
- lib/command/config.rb
Overview
rubocop:disable Metrics/ClassLength
Instance Attribute Summary collapse
-
#cli_config ⇒ Object
Returns the value of attribute cli_config.
-
#dsl_config ⇒ Object
Returns the value of attribute dsl_config.
Class Method Summary collapse
Instance Method Summary collapse
- #bitcode_enabled? ⇒ Boolean
- #build_args ⇒ Object
- #cache_path ⇒ Object
- #cache_repo ⇒ Object
- #dev_pods_enabled? ⇒ Boolean
- #device_build_enabled? ⇒ Boolean
- #disable_dsym? ⇒ Boolean
- #dont_remove_source_code? ⇒ Boolean
- #excluded_pods ⇒ Object
- #generated_frameworks_dir(in_cache: false) ⇒ Object
-
#initialize(path) ⇒ Config
constructor
A new instance of Config.
- #local_cache? ⇒ Boolean
- #manifest_path(in_cache: false) ⇒ Object
- #prebuild_all_pods? ⇒ Boolean
- #prebuild_code_gen ⇒ Object
- #prebuild_config ⇒ Object
- #prebuild_delta_path ⇒ Object
- #prebuild_job? ⇒ Boolean
- #prebuild_sandbox_path ⇒ Object
- #prebuilt_path(path: nil) ⇒ Object
- #prebuilt_pod_names ⇒ Object
- #reset! ⇒ Object
- #root_dir(in_cache) ⇒ Object
- #save_cache_validation_to ⇒ Object
- #still_download_sources?(name) ⇒ Boolean
- #strict_diagnosis? ⇒ Boolean
- #targets_to_prebuild_from_cli ⇒ Object
- #tracked_prebuilt_pod_names ⇒ Object
- #update_detected_excluded_pods!(value) ⇒ Object
- #update_detected_prebuilt_pod_names!(value) ⇒ Object
- #validate_dsl_config ⇒ Object
- #validate_prebuilt_settings ⇒ Object
Constructor Details
#initialize(path) ⇒ Config
Returns a new instance of Config.
11 12 13 14 15 16 |
# File 'lib/command/config.rb', line 11 def initialize(path) @deprecated_config = File.exist?(path) ? PodPrebuild::JSONFile.new(path).data : {} @dsl_config = {} @cli_config = {} @detected_config = {} end |
Instance Attribute Details
#cli_config ⇒ Object
Returns the value of attribute cli_config.
9 10 11 |
# File 'lib/command/config.rb', line 9 def cli_config @cli_config end |
#dsl_config ⇒ Object
Returns the value of attribute dsl_config.
9 10 11 |
# File 'lib/command/config.rb', line 9 def dsl_config @dsl_config end |
Class Method Details
.instance ⇒ Object
18 19 20 |
# File 'lib/command/config.rb', line 18 def self.instance @instance ||= new("PodBinaryCacheConfig.json") end |
Instance Method Details
#bitcode_enabled? ⇒ Boolean
98 99 100 |
# File 'lib/command/config.rb', line 98 def bitcode_enabled? @dsl_config[:bitcode_enabled] end |
#build_args ⇒ Object
119 120 121 |
# File 'lib/command/config.rb', line 119 def build_args @dsl_config[:build_args] end |
#cache_path ⇒ Object
36 37 38 |
# File 'lib/command/config.rb', line 36 def cache_path @cache_path ||= File.(cache_repo_config["local"]) end |
#cache_repo ⇒ Object
28 29 30 |
# File 'lib/command/config.rb', line 28 def cache_repo @cache_repo ||= cache_repo_config["remote"] end |
#dev_pods_enabled? ⇒ Boolean
94 95 96 |
# File 'lib/command/config.rb', line 94 def dev_pods_enabled? @dsl_config[:dev_pods_enabled] end |
#device_build_enabled? ⇒ Boolean
102 103 104 |
# File 'lib/command/config.rb', line 102 def device_build_enabled? @dsl_config[:device_build_enabled] end |
#disable_dsym? ⇒ Boolean
106 107 108 |
# File 'lib/command/config.rb', line 106 def disable_dsym? @dsl_config[:disable_dsym] end |
#dont_remove_source_code? ⇒ Boolean
115 116 117 |
# File 'lib/command/config.rb', line 115 def dont_remove_source_code? @dsl_config[:dont_remove_source_code] end |
#excluded_pods ⇒ Object
90 91 92 |
# File 'lib/command/config.rb', line 90 def excluded_pods ((@dsl_config[:excluded_pods] || Set.new) + (@detected_config[:excluded_pods] || Set.new)).to_set end |
#generated_frameworks_dir(in_cache: false) ⇒ Object
56 57 58 |
# File 'lib/command/config.rb', line 56 def generated_frameworks_dir(in_cache: false) root_dir(in_cache) + "/GeneratedFrameworks" end |
#local_cache? ⇒ Boolean
32 33 34 |
# File 'lib/command/config.rb', line 32 def local_cache? cache_repo.nil? end |
#manifest_path(in_cache: false) ⇒ Object
48 49 50 |
# File 'lib/command/config.rb', line 48 def manifest_path(in_cache: false) root_dir(in_cache) + "/Manifest.lock" end |
#prebuild_all_pods? ⇒ Boolean
86 87 88 |
# File 'lib/command/config.rb', line 86 def prebuild_all_pods? @cli_config[:prebuild_all_pods] || @dsl_config[:prebuild_all_pods] end |
#prebuild_code_gen ⇒ Object
131 132 133 |
# File 'lib/command/config.rb', line 131 def prebuild_code_gen @dsl_config[:prebuild_code_gen] end |
#prebuild_config ⇒ Object
78 79 80 |
# File 'lib/command/config.rb', line 78 def prebuild_config @cli_config[:prebuild_config] || @dsl_config[:prebuild_config] || "Debug" end |
#prebuild_delta_path ⇒ Object
44 45 46 |
# File 'lib/command/config.rb', line 44 def prebuild_delta_path @dsl_config[:prebuild_delta_path] || @deprecated_config["prebuild_delta_path"] || "_Prebuild_delta/changes.json" end |
#prebuild_job? ⇒ Boolean
82 83 84 |
# File 'lib/command/config.rb', line 82 def prebuild_job? @cli_config[:prebuild_job] || @dsl_config[:prebuild_job] end |
#prebuild_sandbox_path ⇒ Object
40 41 42 |
# File 'lib/command/config.rb', line 40 def prebuild_sandbox_path @dsl_config[:prebuild_sandbox_path] || @deprecated_config["prebuild_path"] || "_Prebuild" end |
#prebuilt_path(path: nil) ⇒ Object
60 61 62 |
# File 'lib/command/config.rb', line 60 def prebuilt_path(path: nil) path.nil? ? "_Prebuilt" : "_Prebuilt/#{path}" end |
#prebuilt_pod_names ⇒ Object
151 152 153 |
# File 'lib/command/config.rb', line 151 def prebuilt_pod_names @detected_config[:prebuilt_pod_names] || Set.new end |
#reset! ⇒ Object
22 23 24 25 26 |
# File 'lib/command/config.rb', line 22 def reset! @deprecated_config = {} @dsl_config = {} @cli_config = {} end |
#root_dir(in_cache) ⇒ Object
52 53 54 |
# File 'lib/command/config.rb', line 52 def root_dir(in_cache) in_cache ? cache_path : prebuild_sandbox_path end |
#save_cache_validation_to ⇒ Object
123 124 125 |
# File 'lib/command/config.rb', line 123 def save_cache_validation_to @dsl_config[:save_cache_validation_to] end |
#still_download_sources?(name) ⇒ Boolean
110 111 112 113 |
# File 'lib/command/config.rb', line 110 def still_download_sources?(name) option = @dsl_config[:still_download_sources] option.is_a?(Array) ? option.include?(name) : option end |
#strict_diagnosis? ⇒ Boolean
135 136 137 |
# File 'lib/command/config.rb', line 135 def strict_diagnosis? @dsl_config[:strict_diagnosis] end |
#targets_to_prebuild_from_cli ⇒ Object
139 140 141 |
# File 'lib/command/config.rb', line 139 def targets_to_prebuild_from_cli @cli_config[:prebuild_targets] || [] end |
#tracked_prebuilt_pod_names ⇒ Object
155 156 157 |
# File 'lib/command/config.rb', line 155 def tracked_prebuilt_pod_names prebuilt_pod_names - excluded_pods end |
#update_detected_excluded_pods!(value) ⇒ Object
147 148 149 |
# File 'lib/command/config.rb', line 147 def update_detected_excluded_pods!(value) @detected_config[:excluded_pods] = value end |
#update_detected_prebuilt_pod_names!(value) ⇒ Object
143 144 145 |
# File 'lib/command/config.rb', line 143 def update_detected_prebuilt_pod_names!(value) @detected_config[:prebuilt_pod_names] = value end |
#validate_dsl_config ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/command/config.rb', line 64 def validate_dsl_config = @dsl_config.keys - applicable_dsl_config return if .empty? = <<~HEREDOC [WARNING] The following options (in `config_cocoapods_binary_cache`) are not correct: #{}. Available options: #{applicable_dsl_config}. Check out the following doc for more details https://github.com/grab/cocoapods-binary-cache/blob/master/docs/configure_cocoapods_binary_cache.md HEREDOC Pod::UI.puts .yellow end |
#validate_prebuilt_settings ⇒ Object
127 128 129 |
# File 'lib/command/config.rb', line 127 def validate_prebuilt_settings @dsl_config[:validate_prebuilt_settings] end |