xccache 0.0.1.rc14987908371 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/xccache/assets/templates/umbrella.Package.swift.template +0 -1
- data/lib/xccache/command/base.rb +3 -3
- data/lib/xccache/command/cache/clean.rb +32 -0
- data/lib/xccache/command/cache/list.rb +21 -0
- data/lib/xccache/command/cache.rb +12 -0
- data/lib/xccache/command/remote.rb +1 -0
- data/lib/xccache/command.rb +2 -1
- data/lib/xccache/core/config.rb +15 -3
- data/lib/xccache/installer/build.rb +1 -1
- data/lib/xccache/installer.rb +2 -1
- data/lib/xccache/spm/pkg/umbrella/cachemap.rb +1 -1
- data/lib/xccache/storage/git.rb +1 -1
- data/lib/xccache/storage/s3.rb +2 -2
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b10dd2ba3e0a83b400776d8dde8116be6632a9806714ee85526f3788f6364cab
|
4
|
+
data.tar.gz: 789518eadb39c223a5044788122897e7b38c62d0e487733736602b22cb17ff8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 349bbbf1f5101dfc4e4555ff8e9546fa870660ad2f600ea57b28fdbb7a8f7d6007d9fd7aab37937c61659f181fc85d19358c7bc00b3408118d0f4a8e8e6c989e
|
7
|
+
data.tar.gz: f77646c655bdfbcb413a5112f1935545dc2b6c042f92122c0181b9f4b9761874dcc75cad783d645cad5f332eeb49f71181aa9766b84d9f498486ccd7e50e6a3d
|
@@ -40,7 +40,6 @@ enum XCCache {
|
|
40
40
|
@MainActor
|
41
41
|
struct Config {
|
42
42
|
static let pkgDir = URL(filePath: #filePath).deletingLastPathComponent()
|
43
|
-
static let repoDir = URL.homeDirectory.appending(path: ".xccache/default")
|
44
43
|
// NOTE: Do NOT change `binariesDir` to `static let`
|
45
44
|
// Somehow, incremental resolution doesnt work causing the `binaryExist` wrongly cached
|
46
45
|
static var binariesDir: URL { pkgDir.appending(path: "binaries") }
|
data/lib/xccache/command/base.rb
CHANGED
@@ -4,7 +4,7 @@ module XCCache
|
|
4
4
|
class Command
|
5
5
|
class Options
|
6
6
|
SDK = ["--sdk=foo,bar", "SDKs (iphonesimulator, iphoneos, etc.)"].freeze
|
7
|
-
CONFIG = ["--config=foo", "Configuration (debug, release)"].freeze
|
7
|
+
CONFIG = ["--config=foo", "Configuration (debug, release) (default: debug)"].freeze
|
8
8
|
SKIP_RESOLVING_DEPENDENCIES = [
|
9
9
|
"--skip-resolving-dependencies", "Skip resolving package dependencies",
|
10
10
|
].freeze
|
@@ -18,11 +18,11 @@ module XCCache
|
|
18
18
|
].freeze
|
19
19
|
|
20
20
|
def self.install_options
|
21
|
-
[SDK, SKIP_RESOLVING_DEPENDENCIES]
|
21
|
+
[SDK, CONFIG, SKIP_RESOLVING_DEPENDENCIES]
|
22
22
|
end
|
23
23
|
|
24
24
|
def self.build_options
|
25
|
-
install_options + [
|
25
|
+
install_options + [MERGE_SLICES, LIBRARY_EVOLUTION]
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module XCCache
|
2
|
+
class Command
|
3
|
+
class Cache < Command
|
4
|
+
class Clean < Cache
|
5
|
+
self.summary = "Cleaning/purging cache"
|
6
|
+
self.arguments = [CLAide::Argument.new("TARGET", false, true)]
|
7
|
+
def self.options
|
8
|
+
[
|
9
|
+
["--all", "Whether to remove all cache (default: false)"],
|
10
|
+
["--dry", "Dry run - don't remove cache, just show what shall be removed (default: false)"],
|
11
|
+
].concat(super)
|
12
|
+
end
|
13
|
+
|
14
|
+
def initialize(argv)
|
15
|
+
super
|
16
|
+
@all = argv.flag?("all")
|
17
|
+
@dry = argv.flag?("dry")
|
18
|
+
@targets = argv.arguments!
|
19
|
+
end
|
20
|
+
|
21
|
+
def run
|
22
|
+
to_remove = @targets.flat_map { |t| config.spm_cache_dir.glob("#{t}/*") }
|
23
|
+
to_remove = config.spm_cache_dir.glob("*/*") if @all
|
24
|
+
to_remove.each do |p|
|
25
|
+
UI.info("Removing #{p.basename.to_s.yellow}")
|
26
|
+
p.rmtree unless @dry
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module XCCache
|
2
|
+
class Command
|
3
|
+
class Cache < Command
|
4
|
+
class List < Cache
|
5
|
+
self.summary = "Listing cache"
|
6
|
+
|
7
|
+
def run
|
8
|
+
target_paths = config.spm_cache_dir.glob("*")
|
9
|
+
target_paths.each do |target_path|
|
10
|
+
next if (paths = target_path.glob("*")).empty?
|
11
|
+
descs = paths.map { |p| " #{p.basename.to_s.green}" }
|
12
|
+
UI.info <<~DESC
|
13
|
+
#{target_path.basename.to_s.cyan}:
|
14
|
+
#{descs.join('\n')}
|
15
|
+
DESC
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require_relative "base"
|
2
|
+
require "xccache/command/cache/clean"
|
3
|
+
require "xccache/command/cache/list"
|
4
|
+
|
5
|
+
module XCCache
|
6
|
+
class Command
|
7
|
+
class Cache < Command
|
8
|
+
self.abstract_command = true
|
9
|
+
self.summary = "Working with cache (list, clean, etc.)"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/lib/xccache/command.rb
CHANGED
@@ -16,13 +16,14 @@ module XCCache
|
|
16
16
|
def initialize(argv)
|
17
17
|
super
|
18
18
|
config.verbose = verbose unless verbose.nil?
|
19
|
+
config.install_config = argv.option("config", "debug")
|
19
20
|
@install_options = {
|
20
21
|
:sdks => str_to_sdks(argv.option("sdk")),
|
22
|
+
:config => config.install_config,
|
21
23
|
:skip_resolving_dependencies => argv.flag?("skip-resolving-dependencies"),
|
22
24
|
}
|
23
25
|
@build_options = {
|
24
26
|
**@install_options,
|
25
|
-
:config => argv.option("config"),
|
26
27
|
:recursive => argv.flag?("recursive"),
|
27
28
|
:merge_slices => argv.flag?("merge-slices", true),
|
28
29
|
:library_evolution => argv.flag?("library-evolution"),
|
data/lib/xccache/core/config.rb
CHANGED
@@ -20,6 +20,12 @@ module XCCache
|
|
20
20
|
attr_accessor :in_installation
|
21
21
|
alias in_installation? in_installation
|
22
22
|
|
23
|
+
attr_writer :install_config
|
24
|
+
|
25
|
+
def install_config
|
26
|
+
@install_config || "debug"
|
27
|
+
end
|
28
|
+
|
23
29
|
def sandbox
|
24
30
|
@sandbox = Dir.prepare("xccache").expand_path
|
25
31
|
end
|
@@ -36,8 +42,8 @@ module XCCache
|
|
36
42
|
@spm_xcconfig_dir ||= Dir.prepare(spm_sandbox / "xcconfigs")
|
37
43
|
end
|
38
44
|
|
39
|
-
def
|
40
|
-
@
|
45
|
+
def spm_cache_dir
|
46
|
+
@spm_cache_dir ||= Dir.prepare(Pathname("~/.xccache/#{install_config}").expand_path)
|
41
47
|
end
|
42
48
|
|
43
49
|
def spm_binaries_dir
|
@@ -79,7 +85,7 @@ module XCCache
|
|
79
85
|
end
|
80
86
|
|
81
87
|
def remote_config
|
82
|
-
raw["remote"] || {}
|
88
|
+
pick_per_install_config(raw["remote"] || {})
|
83
89
|
end
|
84
90
|
|
85
91
|
def ignore_list
|
@@ -106,5 +112,11 @@ module XCCache
|
|
106
112
|
def default_sdk
|
107
113
|
raw["default_sdk"] || "iphonesimulator"
|
108
114
|
end
|
115
|
+
|
116
|
+
private
|
117
|
+
|
118
|
+
def pick_per_install_config(hash)
|
119
|
+
hash[install_config] || hash["default"] || {}
|
120
|
+
end
|
109
121
|
end
|
110
122
|
end
|
data/lib/xccache/installer.rb
CHANGED
@@ -14,8 +14,8 @@ module XCCache
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def perform_install
|
17
|
+
UI.message("Using cache dir: #{config.spm_cache_dir}")
|
17
18
|
config.in_installation = true
|
18
|
-
verify_projects!
|
19
19
|
if @umbrella_pkg.nil?
|
20
20
|
sync_lockfile
|
21
21
|
umbrella_pkg.prepare(**@install_options)
|
@@ -53,6 +53,7 @@ module XCCache
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def update_projects
|
56
|
+
verify_projects!
|
56
57
|
projects.each do |project|
|
57
58
|
yield project if block_given?
|
58
59
|
project.save
|
@@ -91,7 +91,7 @@ module XCCache
|
|
91
91
|
def binary_path(name, checksum: nil, in_repo: false)
|
92
92
|
suffix = checksum.nil? ? "" : "-#{checksum}"
|
93
93
|
ext = File.extname(name) == ".macro" ? ".macro" : ".xcframework"
|
94
|
-
binaries_dir = in_repo ? config.
|
94
|
+
binaries_dir = in_repo ? config.spm_cache_dir : config.spm_binaries_dir
|
95
95
|
p = binaries_dir / File.basename(name, ".*")
|
96
96
|
p / "#{p.basename}#{suffix}#{ext}"
|
97
97
|
end
|
data/lib/xccache/storage/git.rb
CHANGED
data/lib/xccache/storage/s3.rb
CHANGED
@@ -12,11 +12,11 @@ module XCCache
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def pull
|
15
|
-
s3_sync(src: @uri, dst: config.
|
15
|
+
s3_sync(src: @uri, dst: config.spm_cache_dir)
|
16
16
|
end
|
17
17
|
|
18
18
|
def push
|
19
|
-
s3_sync(src: config.
|
19
|
+
s3_sync(src: config.spm_cache_dir, dst: @uri)
|
20
20
|
end
|
21
21
|
|
22
22
|
private
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xccache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thuyen Trinh
|
@@ -74,6 +74,9 @@ files:
|
|
74
74
|
- lib/xccache/command.rb
|
75
75
|
- lib/xccache/command/base.rb
|
76
76
|
- lib/xccache/command/build.rb
|
77
|
+
- lib/xccache/command/cache.rb
|
78
|
+
- lib/xccache/command/cache/clean.rb
|
79
|
+
- lib/xccache/command/cache/list.rb
|
77
80
|
- lib/xccache/command/pkg.rb
|
78
81
|
- lib/xccache/command/pkg/build.rb
|
79
82
|
- lib/xccache/command/remote.rb
|
@@ -158,9 +161,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
158
161
|
version: '0'
|
159
162
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
163
|
requirements:
|
161
|
-
- - "
|
164
|
+
- - ">="
|
162
165
|
- !ruby/object:Gem::Version
|
163
|
-
version:
|
166
|
+
version: '0'
|
164
167
|
requirements: []
|
165
168
|
rubygems_version: 3.2.33
|
166
169
|
signing_key:
|