cocoapods-myhooks 0.0.1 → 0.0.2
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-myhooks/gem_version.rb +3 -0
- data/lib/cocoapods_plugin.rb +38 -33
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df448c69ffba74aae0bd270c525f1b8436974103397aae8192ac15f632e64d85
|
4
|
+
data.tar.gz: 4b3b06a8fad15601d96904de1cf6a8ec8390bd9b3f4b4b69be5fe883d31e286f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fdf3005db016009871003459275be2c57448cc71bd0d29868830494632daf501235076bc43e90509d34b8eb63af8f04c442d0ff9cf298fe1c35f54e58c44750
|
7
|
+
data.tar.gz: 121ad084d821253a424327e7f23b1aa1af4b9e9df7e9b4186ddbd95746cad25eb9f3974b3a0f27cdccfad281d42faff121242172df6cedd0b90461b6862b1856
|
data/lib/cocoapods_plugin.rb
CHANGED
@@ -11,45 +11,50 @@ require 'cocoapods-core/podfile/target_definition'
|
|
11
11
|
# hook pre_install 修改 宿主工程的配置
|
12
12
|
Pod::HooksManager.register('cocoapods-myhooks', :post_install) do |installer|
|
13
13
|
# 获取当前的源码引用库列表
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
# p "开始"
|
15
|
+
#获取本地化调试的库
|
16
|
+
currenrSourceList = Array.new
|
17
|
+
installer.pods_project.development_pods.children.each do |object|
|
18
|
+
currenrSourceList << object.name
|
19
|
+
end
|
20
|
+
|
21
|
+
# p currenrSourceList
|
22
|
+
# 修改本地pod的building setting
|
17
23
|
installer.pods_project.targets.each do |target|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
target.build_configurations.each do |config|
|
25
|
+
# 还原所有pod的选项
|
26
|
+
config.build_settings['OTHER_CFLAGS'] = '$(inherited)'
|
27
|
+
config.build_settings['OTHER_SWIFT_FLAGS'] = '$(inherited)'
|
28
|
+
config.build_settings['OTHER_LDFLAGS'] = '$(inherited)'
|
29
|
+
currenrSourceList.each do |sourceTarget|
|
30
|
+
if (sourceTarget <=> target.name) == 0
|
31
|
+
# 修改本地pod的所有
|
32
|
+
config.build_settings['OTHER_CFLAGS'] = '$(inherited) -fprofile-instr-generate -fcoverage-mapping'
|
33
|
+
config.build_settings['OTHER_SWIFT_FLAGS'] = '$(inherited) -profile-generate -profile-coverage-mapping'
|
34
|
+
config.build_settings['OTHER_LDFLAGS'] = '$(inherited) -fprofile-instr-generate' # other linker flags
|
35
|
+
end
|
29
36
|
end
|
37
|
+
end
|
30
38
|
end
|
31
39
|
installer.pods_project.save
|
32
|
-
p "开始修改当前工程buildingsettisng"
|
33
|
-
|
34
|
-
end
|
40
|
+
# p "开始修改当前工程buildingsettisng"
|
41
|
+
|
35
42
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
# 2、打开xcodeproj文件,修改 other_c_flags 、other_linker_flags、other_swift_flags
|
40
|
-
p '开始修改壳工程buildingsetting'
|
41
|
-
project = Xcodeproj::Project.open('./LJDemo.xcodeproj')
|
42
|
-
project.root_object
|
43
|
-
project.targets.each do |target|
|
43
|
+
installer.umbrella_targets.each do |target|
|
44
|
+
project = Xcodeproj::Project.open(target.user_project_path)
|
45
|
+
project.targets.each do |target|
|
44
46
|
target.build_configurations.each do |config|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
47
|
+
if (config.display_name <=> 'Debug') == 0
|
48
|
+
build_settings = config.build_settings
|
49
|
+
build_settings['OTHER_CFLAGS'] = "$(inherited) -fprofile-instr-generate -fcoverage-mapping"
|
50
|
+
build_settings['OTHER_LDFLAGS'] = '$(inherited) -fprofile-instr-generate'
|
51
|
+
build_settings["OTHER_SWIFT_FLAGS"] = "'$(inherited) -profile-generate -profile-coverage-mapping"
|
52
|
+
end
|
51
53
|
end
|
54
|
+
end
|
55
|
+
# 保存项目的配置信息
|
56
|
+
project.save
|
52
57
|
end
|
53
|
-
|
54
|
-
|
58
|
+
|
59
|
+
|
55
60
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-myhooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sunjinxin005
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -45,12 +45,13 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
+
- lib/cocoapods-myhooks/gem_version.rb
|
48
49
|
- lib/cocoapods_plugin.rb
|
49
50
|
homepage: https://github.com/EXAMPLE/cocoapods-myhooks
|
50
51
|
licenses:
|
51
52
|
- MIT
|
52
53
|
metadata: {}
|
53
|
-
post_install_message:
|
54
|
+
post_install_message:
|
54
55
|
rdoc_options: []
|
55
56
|
require_paths:
|
56
57
|
- lib
|
@@ -65,8 +66,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
66
|
- !ruby/object:Gem::Version
|
66
67
|
version: '0'
|
67
68
|
requirements: []
|
68
|
-
rubygems_version: 3.0.
|
69
|
-
signing_key:
|
69
|
+
rubygems_version: 3.0.9
|
70
|
+
signing_key:
|
70
71
|
specification_version: 4
|
71
72
|
summary: A longer description of cocoapods-myhooks.
|
72
73
|
test_files: []
|