cocoapods-spm 0.1.9 → 0.1.10
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/cocoapods-spm/def/installer.rb +10 -2
- data/lib/cocoapods-spm/hooks/base.rb +15 -4
- data/lib/cocoapods-spm/hooks/post_integrate/{5.update_settings.rb → 05.update_settings.rb} +1 -1
- data/lib/cocoapods-spm/hooks/post_integrate/06.update_macro_platforms.rb +26 -0
- data/lib/cocoapods-spm/macro/metadata.rb +16 -0
- data/lib/cocoapods-spm/resolver/result.rb +1 -1
- metadata +10 -9
- /data/lib/cocoapods-spm/hooks/post_integrate/{1.add_spm_pkgs.rb → 01.add_spm_pkgs.rb} +0 -0
- /data/lib/cocoapods-spm/hooks/post_integrate/{6.update_embed_frameworks_script.rb → 20.update_embed_frameworks_script.rb} +0 -0
- /data/lib/cocoapods-spm/hooks/post_integrate/{7.update_copy_resources_script.rb → 21.update_copy_resources_script.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c78bcd5423ddfdab166cce2e0d9dbb0f856c316e96c9153b0d0e63e24dc522c3
|
4
|
+
data.tar.gz: e2bc22e33f7bd411ea0f185a625a2b22a746e3ff97e8a4f82733d58272f2504b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e73df51891edf85f7f5568a93e0bddf1783fd6277ca184e9116be5192bb8a466ee4f33236beb36fa24ce8430f92a9ecc1f9dea614328dabec2b8a41255df2014
|
7
|
+
data.tar.gz: ea3fe8933774d6173401d5d8994a8107d370d17e83d9e150fa95c0e68029cdf10db818ff4e5f03aab343244c453f537837bb2eeb1778f0a5ff923c4a8ff76925
|
@@ -1,7 +1,15 @@
|
|
1
1
|
module Pod
|
2
2
|
class Installer
|
3
|
-
|
4
|
-
|
3
|
+
module InstallerMixin
|
4
|
+
def native_targets
|
5
|
+
projects_to_integrate.flat_map(&:targets)
|
6
|
+
end
|
7
|
+
|
8
|
+
def projects_to_integrate
|
9
|
+
[pods_project] + pod_target_subprojects
|
10
|
+
end
|
5
11
|
end
|
12
|
+
|
13
|
+
include InstallerMixin
|
6
14
|
end
|
7
15
|
end
|
@@ -1,11 +1,13 @@
|
|
1
1
|
require "cocoapods-spm/config"
|
2
2
|
require "cocoapods-spm/def/podfile"
|
3
3
|
require "cocoapods-spm/def/spec"
|
4
|
+
require "cocoapods-spm/macro/metadata"
|
4
5
|
|
5
6
|
module Pod
|
6
7
|
module SPM
|
7
8
|
class Hook
|
8
9
|
include Config::Mixin
|
10
|
+
include Installer::InstallerMixin
|
9
11
|
|
10
12
|
def initialize(context, options = {})
|
11
13
|
@context = context
|
@@ -34,10 +36,6 @@ module Pod
|
|
34
36
|
@context.pod_target_subprojects
|
35
37
|
end
|
36
38
|
|
37
|
-
def projects_to_integrate
|
38
|
-
[pods_project] + pod_target_subprojects
|
39
|
-
end
|
40
|
-
|
41
39
|
def user_build_configurations
|
42
40
|
@user_build_configurations ||= (pod_targets + aggregate_targets)[0].user_build_configurations
|
43
41
|
end
|
@@ -94,6 +92,19 @@ module Pod
|
|
94
92
|
end
|
95
93
|
end
|
96
94
|
end
|
95
|
+
|
96
|
+
def macro_metadata_for_pod(name)
|
97
|
+
return nil unless spm_config.all_macros.include?(name)
|
98
|
+
|
99
|
+
@macro_metadata_cache ||= {}
|
100
|
+
@macro_metadata_cache[name] = MacroMetadata.for_pod(name) unless @macro_metadata_cache.key?(name)
|
101
|
+
@macro_metadata_cache[name]
|
102
|
+
end
|
103
|
+
|
104
|
+
def pod_name_of_target(name)
|
105
|
+
target = @analysis_result.pod_targets.find { |x| x.name == name }
|
106
|
+
target.nil? ? name : target.pod_name
|
107
|
+
end
|
97
108
|
end
|
98
109
|
end
|
99
110
|
end
|
@@ -17,7 +17,7 @@ module Pod
|
|
17
17
|
@macro_plugin_flag_by_config ||= begin
|
18
18
|
hash = user_build_configurations.keys.to_h do |config|
|
19
19
|
flags = macro_pods.keys.map do |name|
|
20
|
-
metadata =
|
20
|
+
metadata = macro_metadata_for_pod(name)
|
21
21
|
impl_module_name = metadata.macro_impl_name
|
22
22
|
plugin_executable_path =
|
23
23
|
"#{path_prefix}/#{name}/" \
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "cocoapods-spm/hooks/base"
|
2
|
+
require "cocoapods-spm/macro/metadata"
|
3
|
+
|
4
|
+
module Pod
|
5
|
+
module SPM
|
6
|
+
class Hook
|
7
|
+
class UpdateMacroPlatforms < Hook
|
8
|
+
def run
|
9
|
+
to_save = Set.new
|
10
|
+
native_targets.each do |target|
|
11
|
+
name = pod_name_of_target(target.name)
|
12
|
+
metadata = macro_metadata_for_pod(name)
|
13
|
+
next if metadata.nil?
|
14
|
+
|
15
|
+
settings = metadata.platform_build_settings
|
16
|
+
target.build_configurations.each do |config|
|
17
|
+
settings.each { |k, v| config.build_settings[k] = v }
|
18
|
+
end
|
19
|
+
to_save << target.project
|
20
|
+
end
|
21
|
+
to_save.each(&:save)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -12,6 +12,22 @@ module Pod
|
|
12
12
|
end
|
13
13
|
from_file(path)
|
14
14
|
end
|
15
|
+
|
16
|
+
def platforms
|
17
|
+
raw["platforms"].to_h { |ds| [ds["platformName"], ds["version"]] }
|
18
|
+
end
|
19
|
+
|
20
|
+
def platform_build_settings
|
21
|
+
ds = {
|
22
|
+
"ios" => "IPHONEOS_DEPLOYMENT_TARGET",
|
23
|
+
"macos" => "MACOSX_DEPLOYMENT_TARGET",
|
24
|
+
"tvos" => "TVOS_DEPLOYMENT_TARGET",
|
25
|
+
"watchos" => "WATCHOS_DEPLOYMENT_TARGET",
|
26
|
+
"visionos" => "XROS_DEPLOYMENT_TARGET",
|
27
|
+
"driverkit" => "DRIVERKIT_DEPLOYMENT_TARGET",
|
28
|
+
}
|
29
|
+
platforms.transform_keys { |k| ds[k] }.reject { |k, _| k.nil? }
|
30
|
+
end
|
15
31
|
end
|
16
32
|
end
|
17
33
|
end
|
@@ -63,7 +63,7 @@ module Pod
|
|
63
63
|
return target.name if target.is_a?(Pod::AggregateTarget)
|
64
64
|
|
65
65
|
cmps = target.name.split("-")
|
66
|
-
return cmps[...-1].join("-") if ["iOS", "macOS", "watchOS", "tvOS"].include?(cmps[-1])
|
66
|
+
return cmps[...-1].join("-") if ["iOS", "macOS", "watchOS", "tvOS", "visionOS"].include?(cmps[-1])
|
67
67
|
|
68
68
|
target.name
|
69
69
|
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.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thuyen Trinh
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xcodeproj
|
@@ -56,10 +56,11 @@ files:
|
|
56
56
|
- lib/cocoapods-spm/helpers/patch.rb
|
57
57
|
- lib/cocoapods-spm/hooks/base.rb
|
58
58
|
- lib/cocoapods-spm/hooks/helpers/update_script.rb
|
59
|
-
- lib/cocoapods-spm/hooks/post_integrate/
|
60
|
-
- lib/cocoapods-spm/hooks/post_integrate/
|
61
|
-
- lib/cocoapods-spm/hooks/post_integrate/
|
62
|
-
- lib/cocoapods-spm/hooks/post_integrate/
|
59
|
+
- lib/cocoapods-spm/hooks/post_integrate/01.add_spm_pkgs.rb
|
60
|
+
- lib/cocoapods-spm/hooks/post_integrate/05.update_settings.rb
|
61
|
+
- lib/cocoapods-spm/hooks/post_integrate/06.update_macro_platforms.rb
|
62
|
+
- lib/cocoapods-spm/hooks/post_integrate/20.update_embed_frameworks_script.rb
|
63
|
+
- lib/cocoapods-spm/hooks/post_integrate/21.update_copy_resources_script.rb
|
63
64
|
- lib/cocoapods-spm/macro/config.rb
|
64
65
|
- lib/cocoapods-spm/macro/fetcher.rb
|
65
66
|
- lib/cocoapods-spm/macro/metadata.rb
|
@@ -86,7 +87,7 @@ homepage: https://github.com/trinhngocthuyen/cocoapods-spm
|
|
86
87
|
licenses:
|
87
88
|
- MIT
|
88
89
|
metadata: {}
|
89
|
-
post_install_message:
|
90
|
+
post_install_message:
|
90
91
|
rdoc_options: []
|
91
92
|
require_paths:
|
92
93
|
- lib
|
@@ -102,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
103
|
version: '0'
|
103
104
|
requirements: []
|
104
105
|
rubygems_version: 3.2.33
|
105
|
-
signing_key:
|
106
|
+
signing_key:
|
106
107
|
specification_version: 4
|
107
108
|
summary: CocoaPods plugin to add SPM dependencies to CocoaPods targets
|
108
109
|
test_files: []
|
File without changes
|
File without changes
|