cocoapods-spm 0.0.3 → 0.0.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d90d3841df89cb8d7eb74c8ad184992ae08ec0ed58581827bae94fecdbb9d71
|
4
|
+
data.tar.gz: 90220d0a9b57102775d8819e972098f5d43a8ddb367e091f1963fe24fead0232
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e67677e877f86e94e159630506ab0638429f374cb2aeed940630db7c0b05450ac40cc23fc21868caeef91be9c2c5feed11b61d4e1d2d2f23383da6329d3a1f7c
|
7
|
+
data.tar.gz: cb91b35ceff530f2b475ab25a5a645cc4e9622401de79064cf0841403135c83aa440265803b7c9520931dd37d18745be7a9dcda7f030a6cfdc36000d79f30279
|
@@ -2,69 +2,67 @@ require "cocoapods-spm/config"
|
|
2
2
|
|
3
3
|
module Pod
|
4
4
|
class Podfile
|
5
|
-
|
6
|
-
attr_accessor :spm_analyzer
|
5
|
+
attr_accessor :spm_analyzer
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
alias origin_pod pod
|
8
|
+
def config_cocoapods_spm(options)
|
9
|
+
SPM::Config.instance.dsl_config = options
|
10
|
+
end
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
def macro_pods
|
13
|
+
@macro_pods ||= {}
|
14
|
+
end
|
16
15
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
24
|
-
origin_pod(name, *requirements)
|
16
|
+
def pod(name = nil, *requirements)
|
17
|
+
macro = requirements[0].delete(:macro) if requirements.first.is_a?(Hash)
|
18
|
+
macro ||= {}
|
19
|
+
unless macro.empty?
|
20
|
+
requirements[0][:path] = prepare_macro_pod_dir(name, macro)
|
21
|
+
macro_pods[name] = macro
|
25
22
|
end
|
23
|
+
origin_pod(name, *requirements)
|
24
|
+
end
|
26
25
|
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
def spm_pkg(name, options)
|
27
|
+
current_target_definition.store_spm_pkg(name, options)
|
28
|
+
end
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
def spm_pkgs_for(target)
|
31
|
+
spm_pkgs_by_aggregate_target[target.to_s]
|
32
|
+
end
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
end
|
34
|
+
def spm_pkgs_by_aggregate_target
|
35
|
+
@spm_pkgs_by_aggregate_target ||= begin
|
36
|
+
common_spm_pkgs = root_target_definitions.flat_map(&:spm_pkgs)
|
37
|
+
target_definition_list.reject(&:abstract?).to_h do |target|
|
38
|
+
[target.to_s, (common_spm_pkgs + target.spm_pkgs).uniq(&:name)]
|
41
39
|
end
|
42
40
|
end
|
41
|
+
end
|
43
42
|
|
44
|
-
|
43
|
+
private
|
45
44
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
45
|
+
def prepare_macro_pod_dir(name, requirement)
|
46
|
+
link = requirement[:git]
|
47
|
+
podspec_content = <<~HEREDOC
|
48
|
+
Pod::Spec.new do |s|
|
49
|
+
s.name = "#{name}"
|
50
|
+
s.version = "0.0.1"
|
51
|
+
s.summary = "#{name}"
|
52
|
+
s.description = "#{name}"
|
53
|
+
s.homepage = "#{link}"
|
54
|
+
s.license = "MIT"
|
55
|
+
s.authors = "dummy@gmail.com"
|
56
|
+
s.source = #{requirement}
|
57
|
+
s.source_files = "Sources/**/*"
|
58
|
+
end
|
59
|
+
HEREDOC
|
61
60
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
end
|
61
|
+
path = Pathname(".spm.pods/#{name}")
|
62
|
+
(path / ".prebuilt").mkpath
|
63
|
+
(path / "Sources").mkpath
|
64
|
+
(path / "#{name}.podspec").write(podspec_content)
|
65
|
+
path
|
68
66
|
end
|
69
67
|
end
|
70
68
|
end
|
@@ -48,7 +48,11 @@ module Pod
|
|
48
48
|
# For packages to work in the main target
|
49
49
|
perform_settings_update(
|
50
50
|
update_targets: lambda do |target, _, _|
|
51
|
-
{
|
51
|
+
{
|
52
|
+
"OTHER_LDFLAGS" => linker_flags_for(target),
|
53
|
+
"FRAMEWORK_SEARCH_PATHS" => "\"${PODS_CONFIGURATION_BUILD_DIR}/PackageFrameworks\"",
|
54
|
+
"LIBRARY_SEARCH_PATHS" => "\"${PODS_CONFIGURATION_BUILD_DIR}\""
|
55
|
+
}
|
52
56
|
end
|
53
57
|
)
|
54
58
|
end
|
@@ -56,9 +60,7 @@ module Pod
|
|
56
60
|
def linker_flags_for(target)
|
57
61
|
spm_deps = @spm_analyzer.spm_dependencies_by_target[target.to_s].to_a
|
58
62
|
framework_flags = spm_deps.select(&:dynamic?).map { |d| "-framework \"#{d.product}\"" }
|
59
|
-
framework_flags << '-F"${PODS_CONFIGURATION_BUILD_DIR}/PackageFrameworks"' unless framework_flags.empty?
|
60
63
|
library_flags = spm_deps.reject(&:dynamic?).map { |d| "-l\"#{d.product}.o\"" }
|
61
|
-
library_flags << '-L"${PODS_CONFIGURATION_BUILD_DIR}"' unless library_flags.empty?
|
62
64
|
framework_flags + library_flags
|
63
65
|
end
|
64
66
|
|
@@ -68,7 +70,7 @@ module Pod
|
|
68
70
|
# For macro packages
|
69
71
|
perform_settings_update(
|
70
72
|
update_targets: lambda do |_, _, _|
|
71
|
-
{ "SWIFT_INCLUDE_PATHS" => "$
|
73
|
+
{ "SWIFT_INCLUDE_PATHS" => "$(PODS_CONFIGURATION_BUILD_DIR)" }
|
72
74
|
end
|
73
75
|
)
|
74
76
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-spm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thuyen Trinh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xcodeproj
|