Class: PodBuilder::Configuration
- Inherits:
-
Object
- Object
- PodBuilder::Configuration
- Defined in:
- lib/pod_builder/configuration.rb
Class Attribute Summary collapse
-
.allow_building_development_pods ⇒ Object
Returns the value of attribute allow_building_development_pods.
-
.base_path ⇒ Object
Returns the value of attribute base_path.
-
.build_base_path ⇒ Object
Returns the value of attribute build_base_path.
-
.build_path ⇒ Object
Returns the value of attribute build_path.
-
.build_settings ⇒ Object
Returns the value of attribute build_settings.
-
.build_settings_overrides ⇒ Object
Returns the value of attribute build_settings_overrides.
-
.build_system ⇒ Object
Returns the value of attribute build_system.
-
.build_using_repo_paths ⇒ Object
Returns the value of attribute build_using_repo_paths.
-
.build_xcframeworks_all ⇒ Object
Returns the value of attribute build_xcframeworks_all.
-
.build_xcframeworks_exclude ⇒ Object
Returns the value of attribute build_xcframeworks_exclude.
-
.build_xcframeworks_include ⇒ Object
Returns the value of attribute build_xcframeworks_include.
-
.configuration_filename ⇒ Object
Returns the value of attribute configuration_filename.
-
.deterministic_build ⇒ Object
Returns the value of attribute deterministic_build.
-
.dev_pods_configuration_filename ⇒ Object
Returns the value of attribute dev_pods_configuration_filename.
-
.development_language ⇒ Object
Returns the value of attribute development_language.
-
.development_pods_paths ⇒ Object
Returns the value of attribute development_pods_paths.
-
.development_team ⇒ Object
Returns the value of attribute development_team.
-
.force_prebuild_pods ⇒ Object
Returns the value of attribute force_prebuild_pods.
-
.generate_coverage ⇒ Object
Returns the value of attribute generate_coverage.
-
.keep_swiftmodules ⇒ Object
Returns the value of attribute keep_swiftmodules.
-
.library_evolution_support ⇒ Object
Returns the value of attribute library_evolution_support.
-
.license_filename ⇒ Object
Returns the value of attribute license_filename.
-
.lldbinit_name ⇒ Object
Returns the value of attribute lldbinit_name.
-
.lockfile_name ⇒ Object
Returns the value of attribute lockfile_name.
-
.lockfile_path ⇒ Object
Returns the value of attribute lockfile_path.
-
.post_actions ⇒ Object
Returns the value of attribute post_actions.
-
.pre_actions ⇒ Object
Returns the value of attribute pre_actions.
-
.prebuilt_info_filename ⇒ Object
Returns the value of attribute prebuilt_info_filename.
-
.project_name ⇒ Object
Returns the value of attribute project_name.
-
.react_native_project ⇒ Object
Returns the value of attribute react_native_project.
-
.remap_coverage_to_project_root ⇒ Object
Returns the value of attribute remap_coverage_to_project_root.
-
.restore_enabled ⇒ Object
Returns the value of attribute restore_enabled.
-
.skip_build_configuration_check ⇒ Object
Returns the value of attribute skip_build_configuration_check.
-
.skip_licenses ⇒ Object
Returns the value of attribute skip_licenses.
-
.skip_pods ⇒ Object
Returns the value of attribute skip_pods.
-
.spec_overrides ⇒ Object
Returns the value of attribute spec_overrides.
-
.supported_platforms ⇒ Object
Returns the value of attribute supported_platforms.
-
.use_bundler ⇒ Object
Returns the value of attribute use_bundler.
Class Method Summary collapse
Class Attribute Details
.allow_building_development_pods ⇒ Object
Returns the value of attribute allow_building_development_pods.
48 49 50 |
# File 'lib/pod_builder/configuration.rb', line 48 def allow_building_development_pods @allow_building_development_pods end |
.base_path ⇒ Object
Returns the value of attribute base_path.
53 54 55 |
# File 'lib/pod_builder/configuration.rb', line 53 def base_path @base_path end |
.build_base_path ⇒ Object
Returns the value of attribute build_base_path.
61 62 63 |
# File 'lib/pod_builder/configuration.rb', line 61 def build_base_path @build_base_path end |
.build_path ⇒ Object
Returns the value of attribute build_path.
62 63 64 |
# File 'lib/pod_builder/configuration.rb', line 62 def build_path @build_path end |
.build_settings ⇒ Object
Returns the value of attribute build_settings.
49 50 51 |
# File 'lib/pod_builder/configuration.rb', line 49 def build_settings @build_settings end |
.build_settings_overrides ⇒ Object
Returns the value of attribute build_settings_overrides.
50 51 52 |
# File 'lib/pod_builder/configuration.rb', line 50 def build_settings_overrides @build_settings_overrides end |
.build_system ⇒ Object
Returns the value of attribute build_system.
51 52 53 |
# File 'lib/pod_builder/configuration.rb', line 51 def build_system @build_system end |
.build_using_repo_paths ⇒ Object
Returns the value of attribute build_using_repo_paths.
73 74 75 |
# File 'lib/pod_builder/configuration.rb', line 73 def build_using_repo_paths @build_using_repo_paths end |
.build_xcframeworks_all ⇒ Object
Returns the value of attribute build_xcframeworks_all.
76 77 78 |
# File 'lib/pod_builder/configuration.rb', line 76 def build_xcframeworks_all @build_xcframeworks_all end |
.build_xcframeworks_exclude ⇒ Object
Returns the value of attribute build_xcframeworks_exclude.
78 79 80 |
# File 'lib/pod_builder/configuration.rb', line 78 def build_xcframeworks_exclude @build_xcframeworks_exclude end |
.build_xcframeworks_include ⇒ Object
Returns the value of attribute build_xcframeworks_include.
77 78 79 |
# File 'lib/pod_builder/configuration.rb', line 77 def build_xcframeworks_include @build_xcframeworks_include end |
.configuration_filename ⇒ Object
Returns the value of attribute configuration_filename.
63 64 65 |
# File 'lib/pod_builder/configuration.rb', line 63 def configuration_filename @configuration_filename end |
.deterministic_build ⇒ Object
Returns the value of attribute deterministic_build.
71 72 73 |
# File 'lib/pod_builder/configuration.rb', line 71 def deterministic_build @deterministic_build end |
.dev_pods_configuration_filename ⇒ Object
Returns the value of attribute dev_pods_configuration_filename.
64 65 66 |
# File 'lib/pod_builder/configuration.rb', line 64 def dev_pods_configuration_filename @dev_pods_configuration_filename end |
.development_language ⇒ Object
Returns the value of attribute development_language.
85 86 87 |
# File 'lib/pod_builder/configuration.rb', line 85 def development_language @development_language end |
.development_pods_paths ⇒ Object
Returns the value of attribute development_pods_paths.
60 61 62 |
# File 'lib/pod_builder/configuration.rb', line 60 def development_pods_paths @development_pods_paths end |
.development_team ⇒ Object
Returns the value of attribute development_team.
84 85 86 |
# File 'lib/pod_builder/configuration.rb', line 84 def development_team @development_team end |
.force_prebuild_pods ⇒ Object
Returns the value of attribute force_prebuild_pods.
58 59 60 |
# File 'lib/pod_builder/configuration.rb', line 58 def force_prebuild_pods @force_prebuild_pods end |
.generate_coverage ⇒ Object
Returns the value of attribute generate_coverage.
79 80 81 |
# File 'lib/pod_builder/configuration.rb', line 79 def generate_coverage @generate_coverage end |
.keep_swiftmodules ⇒ Object
Returns the value of attribute keep_swiftmodules.
81 82 83 |
# File 'lib/pod_builder/configuration.rb', line 81 def keep_swiftmodules @keep_swiftmodules end |
.library_evolution_support ⇒ Object
Returns the value of attribute library_evolution_support.
52 53 54 |
# File 'lib/pod_builder/configuration.rb', line 52 def library_evolution_support @library_evolution_support end |
.license_filename ⇒ Object
Returns the value of attribute license_filename.
59 60 61 |
# File 'lib/pod_builder/configuration.rb', line 59 def license_filename @license_filename end |
.lldbinit_name ⇒ Object
Returns the value of attribute lldbinit_name.
75 76 77 |
# File 'lib/pod_builder/configuration.rb', line 75 def lldbinit_name @lldbinit_name end |
.lockfile_name ⇒ Object
Returns the value of attribute lockfile_name.
68 69 70 |
# File 'lib/pod_builder/configuration.rb', line 68 def lockfile_name @lockfile_name end |
.lockfile_path ⇒ Object
Returns the value of attribute lockfile_path.
69 70 71 |
# File 'lib/pod_builder/configuration.rb', line 69 def lockfile_path @lockfile_path end |
.post_actions ⇒ Object
Returns the value of attribute post_actions.
83 84 85 |
# File 'lib/pod_builder/configuration.rb', line 83 def post_actions @post_actions end |
.pre_actions ⇒ Object
Returns the value of attribute pre_actions.
82 83 84 |
# File 'lib/pod_builder/configuration.rb', line 82 def pre_actions @pre_actions end |
.prebuilt_info_filename ⇒ Object
Returns the value of attribute prebuilt_info_filename.
67 68 69 |
# File 'lib/pod_builder/configuration.rb', line 67 def prebuilt_info_filename @prebuilt_info_filename end |
.project_name ⇒ Object
Returns the value of attribute project_name.
65 66 67 |
# File 'lib/pod_builder/configuration.rb', line 65 def project_name @project_name end |
.react_native_project ⇒ Object
Returns the value of attribute react_native_project.
74 75 76 |
# File 'lib/pod_builder/configuration.rb', line 74 def react_native_project @react_native_project end |
.remap_coverage_to_project_root ⇒ Object
Returns the value of attribute remap_coverage_to_project_root.
80 81 82 |
# File 'lib/pod_builder/configuration.rb', line 80 def remap_coverage_to_project_root @remap_coverage_to_project_root end |
.restore_enabled ⇒ Object
Returns the value of attribute restore_enabled.
66 67 68 |
# File 'lib/pod_builder/configuration.rb', line 66 def restore_enabled @restore_enabled end |
.skip_build_configuration_check ⇒ Object
Returns the value of attribute skip_build_configuration_check.
57 58 59 |
# File 'lib/pod_builder/configuration.rb', line 57 def skip_build_configuration_check @skip_build_configuration_check end |
.skip_licenses ⇒ Object
Returns the value of attribute skip_licenses.
55 56 57 |
# File 'lib/pod_builder/configuration.rb', line 55 def skip_licenses @skip_licenses end |
.skip_pods ⇒ Object
Returns the value of attribute skip_pods.
56 57 58 |
# File 'lib/pod_builder/configuration.rb', line 56 def skip_pods @skip_pods end |
.spec_overrides ⇒ Object
Returns the value of attribute spec_overrides.
54 55 56 |
# File 'lib/pod_builder/configuration.rb', line 54 def spec_overrides @spec_overrides end |
.supported_platforms ⇒ Object
Returns the value of attribute supported_platforms.
72 73 74 |
# File 'lib/pod_builder/configuration.rb', line 72 def supported_platforms @supported_platforms end |
.use_bundler ⇒ Object
Returns the value of attribute use_bundler.
70 71 72 |
# File 'lib/pod_builder/configuration.rb', line 70 def use_bundler @use_bundler end |
Class Method Details
.check_inited ⇒ Object
135 136 137 |
# File 'lib/pod_builder/configuration.rb', line 135 def self.check_inited raise "\n\nNot inited, run `pod_builder init`\n".red if podbuilder_path.nil? end |
.exists ⇒ Object
139 140 141 |
# File 'lib/pod_builder/configuration.rb', line 139 def self.exists return !config_path.nil? && File.exist?(config_path) end |
.load ⇒ Object
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/pod_builder/configuration.rb', line 143 def self.load unless podbuilder_path return end Configuration.base_path = podbuilder_path if exists begin json = JSON.parse(File.read(config_path)) rescue => exception raise "\n\n#{File.basename(config_path)} is an invalid JSON\n".red end value = json["spec_overrides"] if value.is_a?(Hash) && value.keys.count > 0 Configuration.spec_overrides = value end value = json["skip_licenses"] if value.is_a?(Array) Configuration.skip_licenses = value end value = json["skip_pods"] if value.is_a?(Array) Configuration.skip_pods = value end value = json["skip_build_configuration_check"] if value.is_a?(Array) Configuration.skip_build_configuration_check = value end value = json["force_prebuild_pods"] if value.is_a?(Array) Configuration.force_prebuild_pods = value end value = json["build_settings"] if value.is_a?(Hash) && value.keys.count > 0 Configuration.build_settings = value end value = json["build_settings_overrides"] if value.is_a?(Hash) && value.keys.count > 0 Configuration.build_settings_overrides = value end value = json["build_system"] if value.is_a?(String) && ["Latest", "Legacy"].include?(value) Configuration.build_system = value end value = json["library_evolution_support"] if [TrueClass, FalseClass].include?(value.class) Configuration.library_evolution_support = value end value = json["license_filename"] if value.is_a?(String) && value.length > 0 Configuration.license_filename = value end value = json["project_name"] if value.is_a?(String) && value.length > 0 Configuration.project_name = value end value = json["restore_enabled"] if [TrueClass, FalseClass].include?(value.class) Configuration.restore_enabled = value end value = json["allow_building_development_pods"] if [TrueClass, FalseClass].include?(value.class) Configuration.allow_building_development_pods = value end value = json["use_bundler"] if [TrueClass, FalseClass].include?(value.class) Configuration.use_bundler = value end value = json["deterministic_build"] if [TrueClass, FalseClass].include?(value.class) Configuration.deterministic_build = value end value = json["build_using_repo_paths"] if [TrueClass, FalseClass].include?(value.class) Configuration.build_using_repo_paths = value end value = json["react_native_project"] if [TrueClass, FalseClass].include?(value.class) Configuration.react_native_project = value end value = json["build_xcframeworks_all"] if [TrueClass, FalseClass].include?(value.class) Configuration.build_xcframeworks_all = value end value = json["build_xcframeworks_include"] if value.is_a?(Array) Configuration.build_xcframeworks_include = value end value = json["build_xcframeworks_exclude"] if value.is_a?(Array) Configuration.build_xcframeworks_exclude = value end value = json["generate_coverage"] if [TrueClass, FalseClass].include?(value.class) Configuration.generate_coverage = value end value = json["remap_coverage_to_project_root"] if [TrueClass, FalseClass].include?(value.class) Configuration.remap_coverage_to_project_root = value end value = json["keep_swiftmodules"] if [TrueClass, FalseClass].include?(value.class) Configuration.keep_swiftmodules = value end value = json["pre_actions"] if value.is_a?(Hash) Configuration.pre_actions = PodBuilder::Actions.load(value) end value = json["post_actions"] if value.is_a?(Hash) Configuration.post_actions = PodBuilder::Actions.load(value) end value = json["development_team"] if value.is_a?(String) && value.length > 0 Configuration.development_team = value end value = json["development_language"] if value.is_a?(String) && value.length > 0 Configuration.development_language = value end Configuration.build_settings.freeze sanity_check() end dev_pods_configuration_path = File.join(Configuration.base_path, Configuration.dev_pods_configuration_filename) if File.exist?(dev_pods_configuration_path) begin json = JSON.parse(File.read(dev_pods_configuration_path)) rescue => exception raise "\n\n#{File.basename(dev_pods_configuration_path)} is an invalid JSON\n".red end Configuration.development_pods_paths = json || [] Configuration.development_pods_paths.freeze end if !deterministic_build build_path = "#{build_base_path}#{(Time.now.to_f * 1000).to_i}" lockfile_path = File.join(PodBuilder::home, lockfile_name) end end |
.write ⇒ Object
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
# File 'lib/pod_builder/configuration.rb', line 289 def self.write config = {} config["project_name"] = Configuration.project_name config["spec_overrides"] = Configuration.spec_overrides config["skip_licenses"] = Configuration.skip_licenses config["skip_pods"] = Configuration.skip_pods config["skip_build_configuration_check"] = Configuration.skip_build_configuration_check config["force_prebuild_pods"] = Configuration.force_prebuild_pods config["build_settings"] = Configuration.build_settings config["build_settings_overrides"] = Configuration.build_settings_overrides config["build_system"] = Configuration.build_system config["library_evolution_support"] = Configuration.library_evolution_support config["license_filename"] = Configuration.license_filename config["restore_enabled"] = Configuration.restore_enabled config["allow_building_development_pods"] = Configuration.allow_building_development_pods config["use_bundler"] = Configuration.use_bundler config["deterministic_build"] = Configuration.deterministic_build config["build_using_repo_paths"] = Configuration.build_using_repo_paths config["react_native_project"] = Configuration.react_native_project config["development_team"] = Configuration.development_team config["development_language"] = Configuration.development_language || "en" File.write(config_path, JSON.pretty_generate(config)) end |