cocoapods-binary-flutter 0.0.11 → 0.0.12
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-binary-flutter/gem_version.rb +1 -1
- data/lib/cocoapods_plugin.rb +28 -32
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2154b92602c5874fad79ae07a09119ecfef58df5955297e487970ffcbf1da980
|
|
4
|
+
data.tar.gz: 825dd77579ae4b1278fb76c629f65692116bf3bed1080813c276b4b5afb86727
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 71c62a143918470efb10364a4022cf175d728d201a62d7d117e7c01a2db75b67e418c286a255d18fbdf452b09012d510e1b22cf034c47e94e8863de25faceaef
|
|
7
|
+
data.tar.gz: dbb069fed9cced7694aee7aae7fe337c29cdda18654cccf84ec8c52a1c88351bb43bfccdcd11b060197af0fd3f3af3811a62cb85ae2f43e2efeee17587f4d59d
|
data/lib/cocoapods_plugin.rb
CHANGED
|
@@ -2,36 +2,32 @@ require 'cocoapods-binary-flutter/command'
|
|
|
2
2
|
require 'cocoapods-binary-flutter/hook'
|
|
3
3
|
|
|
4
4
|
# 解决多工程 target 的情况下,编译错误,找不到 <Flutter/Flutter.h> 文件
|
|
5
|
-
Pod::HooksManager.register('cocoapods-binary-flutter', :pre_install) do |
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
5
|
+
Pod::HooksManager.register('cocoapods-binary-flutter', :pre_install) do |_installer_context, _options|
|
|
6
|
+
break unless Pod::Podfile::DSL.enable_fix_flutter_post_install
|
|
7
|
+
break unless defined?(Pod::Podfile.instance_method(:flutter_post_install))
|
|
8
|
+
|
|
9
|
+
swizzled_parse_subspecs = Pod::Podfile.instance_method(:flutter_post_install)
|
|
10
|
+
|
|
11
|
+
define_method(:flutter_post_install) do |installer, _skip: false|
|
|
12
|
+
puts '解决多工程 target 的情况下,编译错误,找不到 <Flutter/Flutter.h> 文件'
|
|
13
|
+
# 解决多工程 target 的情况下,编译错误,找不到 <Flutter/Flutter.h> 文件
|
|
14
|
+
installer.aggregate_targets.each do |t|
|
|
15
|
+
t.user_project.native_targets.each do |target|
|
|
16
|
+
# 如果本来就有依赖 Flutter 的话,就不处理了
|
|
17
|
+
flutter_target = nil
|
|
18
|
+
if target.dependencies.map(&:name).filter { |name| name == 'Flutter' }.empty?
|
|
19
|
+
# 添加一个 Flutter 的依赖 Target,用于欺骗 Flutter 的 podhelper 脚本来未工程添加配置,用完后去除,避免影响工程
|
|
20
|
+
flutter_target = Xcodeproj::Project::Object::PBXTargetDependency.new(target.project, nil)
|
|
21
|
+
flutter_target.name = 'Flutter'
|
|
22
|
+
target.dependencies << flutter_target
|
|
23
|
+
end
|
|
24
|
+
flutter_additional_ios_build_settings(target)
|
|
25
|
+
target.dependencies.delete flutter_target unless flutter_target.nil?
|
|
26
|
+
target.project.save
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Call old method
|
|
31
|
+
swizzled_parse_subspecs.bind(self).call(installer)
|
|
32
|
+
end
|
|
32
33
|
end
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|