Class: XCCache::Config
Defined Under Namespace
Modules: Mixin
Instance Attribute Summary collapse
#path, #raw
Class Method Summary
collapse
Instance Method Summary
collapse
#load, #save
#[], #[]=, #initialize, #load, #merge!, #reload, #save
Instance Attribute Details
#ansi ⇒ Object
Also known as:
ansi?
Returns the value of attribute ansi.
16
17
18
|
# File 'lib/xccache/core/config.rb', line 16
def ansi
@ansi
end
|
#in_installation ⇒ Object
Also known as:
in_installation?
To distinguish if it’s within an installation, or standalone like ‘xccache pkg build`
21
22
23
|
# File 'lib/xccache/core/config.rb', line 21
def in_installation
@in_installation
end
|
#install_config ⇒ Object
26
27
28
|
# File 'lib/xccache/core/config.rb', line 26
def install_config
@install_config || "debug"
end
|
#verbose ⇒ Object
Also known as:
verbose?
Returns the value of attribute verbose.
16
17
18
|
# File 'lib/xccache/core/config.rb', line 16
def verbose
@verbose
end
|
Class Method Details
.instance ⇒ Object
12
13
14
|
# File 'lib/xccache/core/config.rb', line 12
def self.instance
@instance ||= new(Pathname("xccache.yml").expand_path)
end
|
Instance Method Details
#cachemap ⇒ Object
78
79
80
81
|
# File 'lib/xccache/core/config.rb', line 78
def cachemap
require "xccache/cache/cachemap"
@cachemap ||= Cache::Cachemap.new(sandbox / "cachemap.json")
end
|
#default_sdk ⇒ Object
118
119
120
|
# File 'lib/xccache/core/config.rb', line 118
def default_sdk
raw["default_sdk"] || "iphonesimulator"
end
|
#ignore?(item) ⇒ Boolean
101
102
103
104
|
# File 'lib/xccache/core/config.rb', line 101
def ignore?(item)
return true if ignore_local? && lockfile.local_pkg_slugs.include?(item.split("/").first)
ignore_list.any? { |p| File.fnmatch(p, item) }
end
|
#ignore_build_errors? ⇒ Boolean
110
111
112
|
# File 'lib/xccache/core/config.rb', line 110
def ignore_build_errors?
raw["ignore_build_errors"]
end
|
#ignore_list ⇒ Object
97
98
99
|
# File 'lib/xccache/core/config.rb', line 97
def ignore_list
raw["ignore"] || []
end
|
#ignore_local? ⇒ Boolean
106
107
108
|
# File 'lib/xccache/core/config.rb', line 106
def ignore_local?
raw["ignore_local"]
end
|
#keep_pkgs_in_project? ⇒ Boolean
114
115
116
|
# File 'lib/xccache/core/config.rb', line 114
def keep_pkgs_in_project?
raw["keep_pkgs_in_project"]
end
|
#lockfile ⇒ Object
74
75
76
|
# File 'lib/xccache/core/config.rb', line 74
def lockfile
@lockfile ||= Lockfile.new(Pathname("xccache.lock").expand_path)
end
|
#project_targets ⇒ Object
89
90
91
|
# File 'lib/xccache/core/config.rb', line 89
def project_targets
projects.flat_map(&:targets)
end
|
#projects ⇒ Object
83
84
85
86
87
|
# File 'lib/xccache/core/config.rb', line 83
def projects
@projects ||= Pathname(".").glob("*.xcodeproj").map do |p|
Xcodeproj::Project.open(p)
end
end
|
#remote_config ⇒ Object
93
94
95
|
# File 'lib/xccache/core/config.rb', line 93
def remote_config
pick_per_install_config(raw["remote"] || {})
end
|
#sandbox ⇒ Object
30
31
32
|
# File 'lib/xccache/core/config.rb', line 30
def sandbox
@sandbox = Dir.prepare("xccache").expand_path
end
|
#spm_artifacts_dir ⇒ Object
58
59
60
|
# File 'lib/xccache/core/config.rb', line 58
def spm_artifacts_dir
@spm_artifacts_dir ||= spm_build_dir / "artifacts"
end
|
#spm_binaries_dir ⇒ Object
50
51
52
|
# File 'lib/xccache/core/config.rb', line 50
def spm_binaries_dir
@spm_binaries_dir ||= Dir.prepare(spm_sandbox / "binaries", clean: true)
end
|
#spm_build_dir ⇒ Object
54
55
56
|
# File 'lib/xccache/core/config.rb', line 54
def spm_build_dir
@spm_build_dir ||= spm_umbrella_sandbox / ".build"
end
|
#spm_cache_dir ⇒ Object
46
47
48
|
# File 'lib/xccache/core/config.rb', line 46
def spm_cache_dir
@spm_cache_dir ||= Dir.prepare(Pathname("~/.xccache/#{install_config}").expand_path)
end
|
#spm_local_pkgs_dir ⇒ Object
38
39
40
|
# File 'lib/xccache/core/config.rb', line 38
def spm_local_pkgs_dir
@spm_local_pkgs_dir ||= Dir.prepare(spm_sandbox / "local", clean: true)
end
|
70
71
72
|
# File 'lib/xccache/core/config.rb', line 70
def spm_metadata_dir
@spm_metadata_dir ||= Dir.prepare(spm_sandbox / "metadata")
end
|
#spm_proxy_sandbox ⇒ Object
62
63
64
|
# File 'lib/xccache/core/config.rb', line 62
def spm_proxy_sandbox
@spm_proxy_sandbox ||= Dir.prepare(spm_sandbox / "proxy")
end
|
#spm_sandbox ⇒ Object
34
35
36
|
# File 'lib/xccache/core/config.rb', line 34
def spm_sandbox
@spm_sandbox ||= Dir.prepare(sandbox / "packages").expand_path
end
|
#spm_umbrella_sandbox ⇒ Object
66
67
68
|
# File 'lib/xccache/core/config.rb', line 66
def spm_umbrella_sandbox
@spm_umbrella_sandbox ||= Dir.prepare(spm_sandbox / "umbrella")
end
|
#spm_xcconfig_dir ⇒ Object
42
43
44
|
# File 'lib/xccache/core/config.rb', line 42
def spm_xcconfig_dir
@spm_xcconfig_dir ||= Dir.prepare(spm_sandbox / "xcconfigs", clean: true)
end
|