xccache 1.0.0.rc15341775774 → 1.0.1.rc15390855924
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/xccache.yml.template +2 -0
- data/lib/xccache/command/base.rb +1 -1
- data/lib/xccache/core/config.rb +4 -0
- data/lib/xccache/core/git.rb +1 -1
- data/lib/xccache/core/system.rb +2 -1
- data/lib/xccache/installer.rb +2 -1
- data/lib/xccache/spm/macro.rb +1 -4
- data/lib/xccache/spm/pkg/proxy_executable.rb +30 -4
- data/lib/xccache/swift/sdk.rb +14 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49f968905b37c1abaa715789a33a9541f8bacc2b6cb6dc977b111609a64ebcf0
|
4
|
+
data.tar.gz: 27fa86909bc610e202efcf8fef604feca6563c6b88a879363bf021e2345cdc09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e99517798ad0d7b733f918e7d1863f57b551c481913769bb20c255b1accdcbf781984ed87b3d8257ecd16fe0f49aa14b4abadb77b50e654b8800bfdf1b1e4253
|
7
|
+
data.tar.gz: d283643742be4fef5b01ce53a98f2651ae1fc896a3d00abab3322242bb11ab984a4688064bb674584d3f4a9866ef849e3a274fea0786ac28eca06a3b25c9749c
|
data/lib/xccache/command/base.rb
CHANGED
@@ -3,7 +3,7 @@ require "xccache/installer"
|
|
3
3
|
module XCCache
|
4
4
|
class Command
|
5
5
|
class Options
|
6
|
-
SDK = ["--sdk=foo,bar", "SDKs (iphonesimulator, iphoneos, etc.)"].freeze
|
6
|
+
SDK = ["--sdk=foo,bar", "SDKs (iphonesimulator, iphoneos, macos, etc.)"].freeze
|
7
7
|
CONFIG = ["--config=foo", "Configuration (debug, release) (default: debug)"].freeze
|
8
8
|
MERGE_SLICES = [
|
9
9
|
"--merge-slices/--no-merge-slices",
|
data/lib/xccache/core/config.rb
CHANGED
data/lib/xccache/core/git.rb
CHANGED
data/lib/xccache/core/system.rb
CHANGED
data/lib/xccache/installer.rb
CHANGED
@@ -19,6 +19,7 @@ module XCCache
|
|
19
19
|
verify_projects!
|
20
20
|
projects.each { |project| migrate_umbrella_to_proxy(project) }
|
21
21
|
UI.message("Using cache dir: #{config.spm_cache_dir}")
|
22
|
+
config.ensure_file!
|
22
23
|
config.in_installation = true
|
23
24
|
sync_lockfile
|
24
25
|
proxy_pkg.prepare(@install_options)
|
@@ -99,7 +100,7 @@ module XCCache
|
|
99
100
|
add_file = proc { |p| group[p.basename.to_s] || group.new_file(p) }
|
100
101
|
add_file.call(config.spm_proxy_sandbox / "Package.swift")
|
101
102
|
add_file.call(config.lockfile.path)
|
102
|
-
add_file.call(config.path)
|
103
|
+
add_file.call(config.path)
|
103
104
|
group.ensure_synced_group(name: "local-packages", path: config.spm_local_pkgs_dir)
|
104
105
|
end
|
105
106
|
|
data/lib/xccache/spm/macro.rb
CHANGED
@@ -3,12 +3,9 @@ require_relative "build"
|
|
3
3
|
module XCCache
|
4
4
|
module SPM
|
5
5
|
class Macro < Buildable
|
6
|
-
attr_reader :macosx_sdk
|
7
|
-
|
8
6
|
def initialize(options = {})
|
9
7
|
super
|
10
8
|
@library_evolution = false # swift-syntax is not compatible with library evolution
|
11
|
-
@macosx_sdk = Swift::Sdk.new(:macosx)
|
12
9
|
end
|
13
10
|
|
14
11
|
def build(_options = {})
|
@@ -37,7 +34,7 @@ module XCCache
|
|
37
34
|
end
|
38
35
|
|
39
36
|
def products_dir
|
40
|
-
@products_dir ||= pkg_dir / ".build" /
|
37
|
+
@products_dir ||= pkg_dir / ".build" / "arm64-apple-macosx" / config
|
41
38
|
end
|
42
39
|
end
|
43
40
|
end
|
@@ -3,7 +3,8 @@ module XCCache
|
|
3
3
|
class Package
|
4
4
|
class Proxy < Package
|
5
5
|
class Executable
|
6
|
-
|
6
|
+
REPO_URL = "https://github.com/trinhngocthuyen/xccache-proxy".freeze
|
7
|
+
VERSION_OR_SHA = "1.0.0rc1".freeze
|
7
8
|
|
8
9
|
def run(cmd)
|
9
10
|
env = { "FORCE_OUTPUT" => "console", "FORCE_COLOR" => "1" } if Config.instance.ansi?
|
@@ -21,13 +22,35 @@ module XCCache
|
|
21
22
|
[
|
22
23
|
local_bin_path,
|
23
24
|
default_bin_path,
|
24
|
-
].find(&:exist?) ||
|
25
|
+
].find(&:exist?) || download_or_build_from_source
|
26
|
+
end
|
27
|
+
|
28
|
+
def default_use_downloaded?
|
29
|
+
VERSION_OR_SHA.include?(".")
|
30
|
+
end
|
31
|
+
|
32
|
+
def download_or_build_from_source
|
33
|
+
default_use_downloaded? ? download : build_from_source
|
34
|
+
end
|
35
|
+
|
36
|
+
def build_from_source
|
37
|
+
UI.section("Building xccache-proxy binary from source...".magenta) do
|
38
|
+
dir = Dir.prepare("~/.xccache/xccache-proxy", expand: true)
|
39
|
+
git = Git.new(dir)
|
40
|
+
git.init unless git.init?
|
41
|
+
git.remote("add", "origin", REPO_URL) unless git.remote(capture: true)[0].strip == "origin"
|
42
|
+
git.fetch("origin", VERSION_OR_SHA)
|
43
|
+
git.checkout("-f", "FETCH_HEAD", capture: true)
|
44
|
+
|
45
|
+
Dir.chdir(dir) { Sh.run("make build CONFIGURATION=release") }
|
46
|
+
(dir / ".build" / "release" / "xccache-proxy").copy(to: default_bin_path)
|
47
|
+
end
|
25
48
|
end
|
26
49
|
|
27
50
|
def download
|
28
51
|
UI.section("Downloading xccache-proxy binary from remote...".magenta) do
|
29
52
|
Dir.create_tmpdir do |dir|
|
30
|
-
url = "
|
53
|
+
url = "#{REPO_URL}/releases/download/#{VERSION_OR_SHA}/xccache-proxy.zip"
|
31
54
|
default_bin_path.parent.mkpath
|
32
55
|
tmp_path = dir / File.basename(url)
|
33
56
|
Sh.run("curl -fSL -o #{tmp_path} #{url} && unzip -d #{default_bin_path.parent} #{tmp_path}")
|
@@ -38,7 +61,10 @@ module XCCache
|
|
38
61
|
end
|
39
62
|
|
40
63
|
def default_bin_path
|
41
|
-
@default_bin_path ||=
|
64
|
+
@default_bin_path ||= begin
|
65
|
+
dir = LIBEXEC / (default_use_downloaded? ? ".download" : ".build")
|
66
|
+
dir / "xccache-proxy-#{VERSION_OR_SHA}" / "xccache-proxy"
|
67
|
+
end
|
42
68
|
end
|
43
69
|
|
44
70
|
def local_bin_path
|
data/lib/xccache/swift/sdk.rb
CHANGED
@@ -8,11 +8,19 @@ module XCCache
|
|
8
8
|
NAME_TO_TRIPLE = {
|
9
9
|
:iphonesimulator => "arm64-apple-ios-simulator",
|
10
10
|
:iphoneos => "arm64-apple-ios",
|
11
|
-
:
|
11
|
+
:macos => "arm64-apple-macos",
|
12
|
+
:watchos => "arm64-apple-watchos",
|
13
|
+
:watchsimulator => "arm64-apple-watchos-simulator",
|
14
|
+
:appletvos => "arm64-apple-tvos",
|
15
|
+
:appletvsimulator => "arm64-apple-tvos-simulator",
|
16
|
+
:xros => "arm64-apple-xros",
|
17
|
+
:xrsimulator => "arm64-apple-xros-simulator",
|
12
18
|
}.freeze
|
13
19
|
|
14
20
|
def initialize(name)
|
15
21
|
@name = name
|
22
|
+
return if NAME_TO_TRIPLE.key?(name.to_sym)
|
23
|
+
raise GeneralError, "Unknown sdk: #{name}. Must be one of #{NAME_TO_TRIPLE.keys}"
|
16
24
|
end
|
17
25
|
|
18
26
|
def to_s
|
@@ -25,11 +33,15 @@ module XCCache
|
|
25
33
|
res
|
26
34
|
end
|
27
35
|
|
36
|
+
def sdk_name
|
37
|
+
name == "macos" ? "macosx" : name
|
38
|
+
end
|
39
|
+
|
28
40
|
def sdk_path
|
29
41
|
# rubocop:disable Layout/LineLength
|
30
42
|
# /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
|
31
43
|
# rubocop:enable Layout/LineLength
|
32
|
-
@sdk_path ||= Pathname(Sh.capture_output("xcrun --sdk #{
|
44
|
+
@sdk_path ||= Pathname(Sh.capture_output("xcrun --sdk #{sdk_name} --show-sdk-path")).realpath
|
33
45
|
end
|
34
46
|
|
35
47
|
def sdk_platform_developer_path
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xccache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1.rc15390855924
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thuyen Trinh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: claide
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- lib/xccache/assets/templates/framework.modulemap.template
|
70
70
|
- lib/xccache/assets/templates/resource_bundle_accessor.m.template
|
71
71
|
- lib/xccache/assets/templates/resource_bundle_accessor.swift.template
|
72
|
+
- lib/xccache/assets/templates/xccache.yml.template
|
72
73
|
- lib/xccache/cache/cachemap.rb
|
73
74
|
- lib/xccache/command.rb
|
74
75
|
- lib/xccache/command/base.rb
|