cocoapods-catalyst-support 0.1.2 → 0.2.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cb32cd2b15a408e4ba0ae33f5d5fe8c96050826cb88d14519d56f3e8a00826d
|
4
|
+
data.tar.gz: 84341a6cb844b3a85e8dec41111468f0e1d65df0b003b251f8b5c41156bf6844
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eaf8c09dbd7981169d39453db4485ae7011b502e66b61321ee03025ad632aea900e02dd2549b5baa66a00903a16c42fd5f9c030eb33fe842d8ce62e42f1e38f7
|
7
|
+
data.tar.gz: 64868bb8dd26932812c7653d55e429b602d24e40c5838b265b4721f0dc158b587301849c1d8acb5c0fe77aa5dc89cfbb6d54c02d3a0668449c8100eb3b4feb40
|
@@ -36,7 +36,7 @@ module Pod
|
|
36
36
|
pod_names_to_keep = recursive_dependencies(pod_names_to_keep)
|
37
37
|
pod_targets_to_keep = pod_targets.filter do |pod| pod_names_to_keep.include? pod.module_name end # PodTarget
|
38
38
|
|
39
|
-
pod_names_to_remove = recursive_dependencies(pod_names_to_remove).filter do |name| !pod_names_to_keep.include? name end
|
39
|
+
pod_names_to_remove = recursive_dependencies(pod_names_to_remove).filter do |name| !pod_names_to_keep.include? name end.to_set.to_a
|
40
40
|
pod_targets_to_remove = pod_targets.filter do |pod| pod_names_to_remove.include? pod.module_name end # PodTarget
|
41
41
|
|
42
42
|
loggs "\n#### Unsupported Libraries ####\n#{pod_names_to_remove}\n"
|
@@ -53,9 +53,7 @@ module Pod
|
|
53
53
|
dependencies_to_remove = dependencies_to_remove + targets_to_remove.flat_map do |target| target.to_dependency end + pod_targets_to_remove.flat_map do |pod| pod.vendor_products + pod.frameworks end
|
54
54
|
dependencies_to_remove = dependencies_to_remove.filter do |d| !dependencies_to_keep.include? d end
|
55
55
|
|
56
|
-
###### CATALYST NOT SUPPORTED LINKS ######
|
57
|
-
unsupported_links = dependencies_to_remove.map do |d| d.link end.to_set.to_a
|
58
|
-
|
56
|
+
###### CATALYST NOT SUPPORTED LINKS ######
|
59
57
|
loggs "\n#### Unsupported dependencies ####\n"
|
60
58
|
loggs "#{dependencies_to_remove.map do |d| d.name end.to_set.to_a }\n\n"
|
61
59
|
|
@@ -71,7 +69,7 @@ module Pod
|
|
71
69
|
|
72
70
|
###### OTHER LINKER FLAGS -> to iphone* ######
|
73
71
|
loggs "#### Flagging unsupported libraries ####"
|
74
|
-
pods_project.targets.filter do |target| target.platform_name == OSPlatform.ios.name end.each do |target| target.flag_libraries
|
72
|
+
pods_project.targets.filter do |target| target.platform_name == OSPlatform.ios.name end.each do |target| target.flag_libraries dependencies_to_remove.to_set.to_a, keep_platform end
|
75
73
|
|
76
74
|
###### BUILD_PHASES AND DEPENDENCIES -> PLATFORM_FILTER 'ios' ######
|
77
75
|
loggs "\n#### Filtering build phases ####"
|
@@ -14,27 +14,73 @@ module Xcodeproj::Project::Object
|
|
14
14
|
|
15
15
|
###### STEP 3 ######
|
16
16
|
# If any unsupported library, then flag as platform-dependant for every build configuration
|
17
|
-
def flag_libraries
|
17
|
+
def flag_libraries dependencies, platform
|
18
18
|
loggs "\tTarget: #{name}"
|
19
|
-
|
19
|
+
|
20
|
+
build_configurations.filter do |config|
|
21
|
+
!config.base_configuration_reference.nil?
|
20
22
|
end.each do |config|
|
21
23
|
loggs "\t\tScheme: #{config.name}"
|
22
24
|
xcconfig_path = config.base_configuration_reference.real_path
|
23
25
|
xcconfig = File.read(xcconfig_path)
|
24
|
-
|
26
|
+
|
27
|
+
other_ldflags = xcconfig.filter_lines do |line| line.include? 'OTHER_LDFLAGS = ' end.first || ''
|
28
|
+
header_search_paths = xcconfig.filter_lines do |line| line.include? 'HEADER_SEARCH_PATHS = ' end.first || ''
|
29
|
+
framework_search_paths = xcconfig.filter_lines do |line| line.include? 'FRAMEWORK_SEARCH_PATHS = ' end.first || ''
|
30
|
+
other_swift_flags = xcconfig.filter_lines do |line| line.include? 'OTHER_SWIFT_FLAGS = ' end.first || ''
|
31
|
+
|
32
|
+
new_other_ldflags = "OTHER_LDFLAGS[sdk=#{platform.sdk}] = $(inherited) -ObjC"
|
33
|
+
new_header_search_paths = "HEADER_SEARCH_PATHS[sdk=#{platform.sdk}] = $(inherited)"
|
34
|
+
new_framework_search_paths = "FRAMEWORK_SEARCH_PATHS[sdk=#{platform.sdk}] = $(inherited)"
|
35
|
+
new_other_swift_flags = "OTHER_SWIFT_FLAGS[sdk=#{platform.sdk}] = $(inherited) -D COCOAPODS"
|
36
|
+
new_xcconfig = xcconfig.gsub!(other_ldflags, '').gsub!(header_search_paths, '').gsub!(other_swift_flags, '').gsub!(framework_search_paths, '')
|
37
|
+
|
25
38
|
changed = false
|
26
|
-
|
27
|
-
if
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
39
|
+
dependencies.each do |dependency|
|
40
|
+
if other_ldflags.include? dependency.link
|
41
|
+
other_ldflags.gsub! dependency.link, ''
|
42
|
+
changed = true
|
43
|
+
new_other_ldflags += " #{dependency.link}"
|
44
|
+
end
|
45
|
+
|
46
|
+
regex = /(?<=[\s])([\"]*[\S]*#{Regexp.escape(dependency.name)}[\S]*[\"]*)(?=[\s]?)/
|
47
|
+
if header_search_paths.match? regex
|
48
|
+
to_replace = header_search_paths.scan(regex).flat_map do |m| m end.filter do |m| !m.nil? && !m.empty? end.each do |to_replace|
|
49
|
+
header_search_paths.gsub! to_replace, ''
|
50
|
+
new_header_search_paths += " #{to_replace}"
|
51
|
+
end
|
52
|
+
changed = true
|
53
|
+
end
|
54
|
+
|
55
|
+
regex = /(?<=[\s])([\"][\S]*#{Regexp.escape(dependency.name)}[\S]*\")(?=[\s]?)/
|
56
|
+
if framework_search_paths.match? regex
|
57
|
+
to_replace = framework_search_paths.scan(regex).flat_map do |m| m end.filter do |m| !m.nil? && !m.empty? end.each do |to_replace|
|
58
|
+
framework_search_paths.gsub! to_replace, ''
|
59
|
+
new_framework_search_paths += " #{to_replace}"
|
32
60
|
end
|
33
|
-
|
61
|
+
changed = true
|
62
|
+
end
|
63
|
+
|
64
|
+
regex = /(?<=[\s])(-Xcc -[\S]*#{Regexp.escape(dependency.name)}[\S]*\")(?=[\s]?)/
|
65
|
+
if other_swift_flags.match? regex
|
66
|
+
to_replace = other_swift_flags.scan(regex).flat_map do |m| m end.filter do |m| !m.nil? && !m.empty? end.each do |to_replace|
|
67
|
+
other_swift_flags.gsub! to_replace, ''
|
68
|
+
new_other_swift_flags += " #{to_replace}"
|
69
|
+
end
|
70
|
+
changed = true
|
34
71
|
end
|
35
72
|
end
|
36
73
|
|
37
|
-
|
74
|
+
if changed
|
75
|
+
new_xcconfig += "\n#{other_ldflags}\n#{framework_search_paths}\n#{header_search_paths}"
|
76
|
+
new_xcconfig += "\n#{new_other_ldflags}\n#{new_framework_search_paths}\n#{new_header_search_paths}"
|
77
|
+
if !other_swift_flags.empty?
|
78
|
+
new_xcconfig += "\n#{other_swift_flags}\n#{new_other_swift_flags}"
|
79
|
+
end
|
80
|
+
new_xcconfig.gsub! /\n+/, "\n"
|
81
|
+
new_xcconfig.gsub! /[ ]+/, " "
|
82
|
+
File.open(xcconfig_path, "w") { |file| file << new_xcconfig }
|
83
|
+
end
|
38
84
|
loggs "\t\t\t#{changed ? "Succeded" : "Nothing to flag"}"
|
39
85
|
end
|
40
86
|
end
|
@@ -47,11 +93,9 @@ module Xcodeproj::Project::Object
|
|
47
93
|
# Dependencies contained in Other Linker Flags
|
48
94
|
def other_linker_flags_dependencies
|
49
95
|
config = build_configurations.filter do |config| not config.base_configuration_reference.nil? end.first
|
96
|
+
return [] if config.nil?
|
50
97
|
other_ldflags = config.resolve_build_setting 'OTHER_LDFLAGS'
|
51
|
-
|
52
|
-
if other_ldflags.nil?
|
53
|
-
return []
|
54
|
-
end
|
98
|
+
return [] if other_ldflags.nil?
|
55
99
|
|
56
100
|
if other_ldflags.class == String
|
57
101
|
other_ldflags = other_ldflags.split ' '
|
@@ -44,7 +44,7 @@ module Xcodeproj::Project::Object
|
|
44
44
|
new_snippet = snippet.clone
|
45
45
|
should_uninstall = configurations.map do |string| snippet.include? string end.reduce(false) do |total, condition| total = total || condition end
|
46
46
|
keys.each do |key|
|
47
|
-
lines_to_replace = snippet.filter_lines do |line| line.
|
47
|
+
lines_to_replace = snippet.filter_lines do |line| line.match "\/#{key}" end.to_set.to_a
|
48
48
|
unless lines_to_replace.empty?
|
49
49
|
changed = true
|
50
50
|
lines_to_replace.each do |line|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-catalyst-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fermoya
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colored2
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '2.3'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '2.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,7 +96,7 @@ homepage: https://github.com/fermoya/cocoapods-catalyst-support
|
|
96
96
|
licenses:
|
97
97
|
- MIT
|
98
98
|
metadata: {}
|
99
|
-
post_install_message:
|
99
|
+
post_install_message:
|
100
100
|
rdoc_options: []
|
101
101
|
require_paths:
|
102
102
|
- lib
|
@@ -111,8 +111,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
|
-
rubygems_version: 3.
|
115
|
-
signing_key:
|
114
|
+
rubygems_version: 3.2.27
|
115
|
+
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: Many libraries you may use for iOS won't compile for your macCatalyst App,
|
118
118
|
thus, making porting your App to the Mac world more difficult than initially expected.
|