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!, #save
Instance Attribute Details
#in_installation ⇒ Object
Also known as:
in_installation?
To distinguish if it’s within an installation, or standalone like ‘xccache pkg build`
20
21
22
|
# File 'lib/xccache/core/config.rb', line 20
def in_installation
@in_installation
end
|
#install_config ⇒ Object
25
26
27
|
# File 'lib/xccache/core/config.rb', line 25
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
73
74
75
|
# File 'lib/xccache/core/config.rb', line 73
def cachemap
@cachemap ||= Cache::Cachemap.new(sandbox / "cachemap.json")
end
|
#default_sdk ⇒ Object
112
113
114
|
# File 'lib/xccache/core/config.rb', line 112
def default_sdk
raw["default_sdk"] || "iphonesimulator"
end
|
#ignore?(item) ⇒ Boolean
95
96
97
98
|
# File 'lib/xccache/core/config.rb', line 95
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
104
105
106
|
# File 'lib/xccache/core/config.rb', line 104
def ignore_build_errors?
raw["ignore_build_errors"]
end
|
#ignore_list ⇒ Object
91
92
93
|
# File 'lib/xccache/core/config.rb', line 91
def ignore_list
raw["ignore"] || []
end
|
#ignore_local? ⇒ Boolean
100
101
102
|
# File 'lib/xccache/core/config.rb', line 100
def ignore_local?
raw["ignore_local"]
end
|
#keep_pkgs_in_project? ⇒ Boolean
108
109
110
|
# File 'lib/xccache/core/config.rb', line 108
def keep_pkgs_in_project?
raw["keep_pkgs_in_project"]
end
|
#lockfile ⇒ Object
69
70
71
|
# File 'lib/xccache/core/config.rb', line 69
def lockfile
@lockfile ||= Lockfile.new(Pathname("xccache.lock").expand_path)
end
|
#project_targets ⇒ Object
83
84
85
|
# File 'lib/xccache/core/config.rb', line 83
def project_targets
projects.flat_map(&:targets)
end
|
#projects ⇒ Object
77
78
79
80
81
|
# File 'lib/xccache/core/config.rb', line 77
def projects
@projects ||= Pathname(".").glob("*.xcodeproj").map do |p|
Xcodeproj::Project.open(p)
end
end
|
#remote_config ⇒ Object
87
88
89
|
# File 'lib/xccache/core/config.rb', line 87
def remote_config
pick_per_install_config(raw["remote"] || {})
end
|
#sandbox ⇒ Object
29
30
31
|
# File 'lib/xccache/core/config.rb', line 29
def sandbox
@sandbox = Dir.prepare("xccache").expand_path
end
|
#spm_artifacts_dir ⇒ Object
57
58
59
|
# File 'lib/xccache/core/config.rb', line 57
def spm_artifacts_dir
@spm_artifacts_dir ||= spm_build_dir / "artifacts"
end
|
#spm_binaries_dir ⇒ Object
49
50
51
|
# File 'lib/xccache/core/config.rb', line 49
def spm_binaries_dir
@spm_binaries_dir ||= Dir.prepare(spm_umbrella_sandbox / "binaries")
end
|
#spm_build_dir ⇒ Object
53
54
55
|
# File 'lib/xccache/core/config.rb', line 53
def spm_build_dir
@spm_build_dir ||= spm_umbrella_sandbox / ".build"
end
|
#spm_cache_dir ⇒ Object
45
46
47
|
# File 'lib/xccache/core/config.rb', line 45
def spm_cache_dir
@spm_cache_dir ||= Dir.prepare(Pathname("~/.xccache/#{install_config}").expand_path)
end
|
#spm_local_pkgs_dir ⇒ Object
37
38
39
|
# File 'lib/xccache/core/config.rb', line 37
def spm_local_pkgs_dir
@spm_local_pkgs_dir ||= Dir.prepare(spm_sandbox / "local")
end
|
65
66
67
|
# File 'lib/xccache/core/config.rb', line 65
def spm_metadata_dir
@spm_metadata_dir ||= Dir.prepare(spm_sandbox / "metadata")
end
|
#spm_sandbox ⇒ Object
33
34
35
|
# File 'lib/xccache/core/config.rb', line 33
def spm_sandbox
@spm_sandbox ||= Dir.prepare(sandbox / "packages").expand_path
end
|
#spm_umbrella_sandbox ⇒ Object
61
62
63
|
# File 'lib/xccache/core/config.rb', line 61
def spm_umbrella_sandbox
@spm_umbrella_sandbox ||= Dir.prepare(spm_sandbox / "umbrella")
end
|
#spm_xcconfig_dir ⇒ Object
41
42
43
|
# File 'lib/xccache/core/config.rb', line 41
def spm_xcconfig_dir
@spm_xcconfig_dir ||= Dir.prepare(spm_sandbox / "xcconfigs")
end
|