cocoapods-pod-sign 0.0.1 → 1.1.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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +63 -0
  3. data/README.md +22 -2
  4. data/example/podSign/Gemfile +8 -0
  5. data/example/podSign/Gemfile.lock +102 -0
  6. data/example/podSign/Podfile +20 -0
  7. data/example/podSign/bundleSign/.gitignore +36 -0
  8. data/example/podSign/bundleSign/.travis.yml +14 -0
  9. data/example/podSign/bundleSign/Example/Podfile +6 -0
  10. data/example/podSign/bundleSign/Example/Pods/Local Podspecs/bundleSign.podspec.json +22 -0
  11. data/example/podSign/bundleSign/Example/Tests/Tests-Info.plist +22 -0
  12. data/example/podSign/bundleSign/Example/Tests/Tests-Prefix.pch +7 -0
  13. data/example/podSign/bundleSign/Example/Tests/Tests.m +35 -0
  14. data/example/podSign/bundleSign/Example/Tests/en.lproj/InfoPlist.strings +2 -0
  15. data/example/podSign/bundleSign/Example/bundleSign.xcodeproj/project.pbxproj +395 -0
  16. data/example/podSign/bundleSign/Example/bundleSign.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  17. data/example/podSign/bundleSign/Example/bundleSign.xcodeproj/xcshareddata/xcschemes/bundleSign-Example.xcscheme +101 -0
  18. data/example/podSign/bundleSign/LICENSE +19 -0
  19. data/example/podSign/bundleSign/README.md +29 -0
  20. data/example/podSign/bundleSign/_Pods.xcodeproj +1 -0
  21. data/example/podSign/bundleSign/bundleSign/Assets/.gitkeep +0 -0
  22. data/example/podSign/bundleSign/bundleSign/Assets/screenshot-20220817-205345.png +0 -0
  23. data/example/podSign/bundleSign/bundleSign/Classes/.gitkeep +0 -0
  24. data/example/podSign/bundleSign/bundleSign/Classes/ReplaceMe.m +0 -0
  25. data/example/podSign/bundleSign/bundleSign.podspec +42 -0
  26. data/example/podSign/podSign/AppDelegate.h +14 -0
  27. data/example/podSign/podSign/AppDelegate.m +40 -0
  28. data/example/podSign/podSign/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
  29. data/example/podSign/podSign/Assets.xcassets/AppIcon.appiconset/Contents.json +93 -0
  30. data/example/podSign/podSign/Assets.xcassets/Contents.json +6 -0
  31. data/example/podSign/podSign/Base.lproj/LaunchScreen.storyboard +25 -0
  32. data/example/podSign/podSign/Base.lproj/Main.storyboard +24 -0
  33. data/example/podSign/podSign/Info.plist +25 -0
  34. data/example/podSign/podSign/SceneDelegate.h +15 -0
  35. data/example/podSign/podSign/SceneDelegate.m +57 -0
  36. data/example/podSign/podSign/ViewController.h +14 -0
  37. data/example/podSign/podSign/ViewController.m +22 -0
  38. data/example/podSign/podSign/main.m +18 -0
  39. data/example/podSign/podSign.xcodeproj/project.pbxproj +528 -0
  40. data/example/podSign/podSign.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  41. data/example/podSign/podSign.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  42. data/example/podSign/podSign.xcodeproj/project.xcworkspace/xcuserdata/liuxiaoliang01.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  43. data/example/podSign/podSign.xcodeproj/xcuserdata/liuxiaoliang01.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  44. data/example/podSign/podSign.xcworkspace/contents.xcworkspacedata +10 -0
  45. data/example/podSign/podSign.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  46. data/example/podSign/podSign.xcworkspace/xcuserdata/liuxiaoliang01.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  47. data/lib/cocoapods-pod-sign/gem_version.rb +1 -1
  48. data/lib/cocoapods-pod-sign/pod_installer.rb +35 -21
  49. data/lib/cocoapods-pod-sign/podfile_dsl.rb +5 -5
  50. metadata +45 -2
@@ -6,37 +6,46 @@ module Pod
6
6
  alias_method :origin_run_podfile_post_install_hook, :run_podfile_post_install_hook
7
7
  def run_podfile_post_install_hook
8
8
 
9
- if $pod_sign_configurations_hash.empty?
10
- pod_sign_extract_bundle_id_and_team_id_from_user_project
11
- end
9
+ pod_sign_extract_bundle_id_and_team_id_from_user_project if $pod_sign_configurations_hash.empty?
12
10
 
13
- if installation_options.generate_multiple_pod_projects
14
- targets = self.pod_target_subprojects.flat_map { |p| p.targets }
15
- else
16
- targets = self.pods_project.targets
17
- end
11
+ targets = if installation_options.generate_multiple_pod_projects
12
+ pod_target_subprojects.flat_map { |p| p.targets }
13
+ else
14
+ pods_project.targets
15
+ end
18
16
  targets.each do |target|
17
+ next unless target.respond_to?('product_type') && target.product_type == 'com.apple.product-type.bundle'
18
+
19
19
  target.build_configurations.each do |config|
20
20
  sign_config = $pod_sign_configurations_hash[config.name]
21
- if sign_config.instance_of?(Hash)
22
- config.build_settings['PRODUCT_BUNDLE_IDENTIFIER'] = sign_config[:bundle_id]
23
- config.build_settings['DEVELOPMENT_TEAM'] = sign_config[:team_id]
24
- end
21
+ next unless sign_config.instance_of?(Hash)
22
+
23
+ config.build_settings['PRODUCT_BUNDLE_IDENTIFIER'] = sign_config[:bundle_id]
24
+ config.build_settings['DEVELOPMENT_TEAM'] = sign_config[:team_id]
25
+ config.build_settings['CODE_SIGN_STYLE'] = if sign_config[:sign_style]
26
+ sign_config[:sign_style]
27
+ else
28
+ config.type == :debug ? 'Automatic' : 'Manual'
29
+ end
30
+ config.build_settings['CODE_SIGN_IDENTITY'] = if sign_config[:sign_identity]
31
+ sign_config[:sign_identity]
32
+ else
33
+ config.type == :debug ? 'Apple Development' : 'Apple Distribution'
34
+ end
25
35
  end
26
36
  end
27
37
 
28
38
  origin_run_podfile_post_install_hook
29
- return true
39
+ true
30
40
  end
31
41
 
32
42
  private
33
43
 
34
44
  def pod_sign_extract_bundle_id_and_team_id_from_user_project
35
- target = self.aggregate_targets.first.user_project.root_object.targets.first;
36
- if target
37
- target.build_configurations.each do |config|
45
+ target = aggregate_targets.first.user_project.root_object.targets.first
46
+ target&.build_configurations&.each do |config|
38
47
  xcconfig_hash ||=
39
- if config.base_configuration_reference.real_path.exist?
48
+ if config.base_configuration_reference&.real_path&.exist?
40
49
  Xcodeproj::Config.new(config.base_configuration_reference.real_path).to_hash
41
50
  else
42
51
  {}
@@ -44,15 +53,20 @@ module Pod
44
53
  pod_sign_extract_bundle_id_and_team_id(xcconfig_hash, config.name)
45
54
  pod_sign_extract_bundle_id_and_team_id(config.build_settings, config.name)
46
55
  end
47
- end
48
56
  end
49
57
 
50
58
  def pod_sign_extract_bundle_id_and_team_id(build_settings, config_name)
51
59
  bundle_id = build_settings['PRODUCT_BUNDLE_IDENTIFIER']
52
60
  team_id = build_settings['DEVELOPMENT_TEAM']
53
- if bundle_id and team_id and config_name
54
- $pod_sign_configurations_hash[config_name] = {:bundle_id => bundle_id, :team_id => team_id}
55
- end
61
+ sign_style = build_settings['CODE_SIGN_STYLE']
62
+ sign_identity = build_settings['CODE_SIGN_IDENTITY']
63
+ return unless bundle_id && team_id && config_name
64
+
65
+ $pod_sign_configurations_hash[config_name] = { bundle_id: bundle_id,
66
+ team_id: team_id,
67
+ sign_style: sign_style,
68
+ sign_identity: sign_identity }
69
+
56
70
  end
57
71
  end
58
72
  end
@@ -7,20 +7,20 @@ module Pod
7
7
 
8
8
  def config_pod_bundle_id_and_team_id(configurations)
9
9
  unless configurations.instance_of?(Hash)
10
- UI.info "config_pod_bundle_id_and_team_id parameters not hash".red
10
+ UI.info 'config_pod_bundle_id_and_team_id parameters not hash'.red
11
11
  return
12
12
  end
13
13
  configurations.each do |name, configuration|
14
14
  unless configuration.instance_of?(Hash)
15
- UI.info "config_pod_bundle_id_and_team_id parameters not hash".red
15
+ UI.info 'config_pod_bundle_id_and_team_id parameters not hash'.red
16
16
  return
17
17
  end
18
- unless configuration[:bundle_id] and configuration[:team_id]
19
- UI.info "config_pod_bundle_id_and_team_id parameters parameters error".red
18
+ unless configuration[:bundle_id] && configuration[:team_id]
19
+ UI.info 'config_pod_bundle_id_and_team_id parameters parameters error'.red
20
20
  return
21
21
  end
22
22
  end
23
- UI.info "config_pod_bundle_id_and_team_id parameters setup success"
23
+ UI.info 'config_pod_bundle_id_and_team_id parameters setup success'
24
24
  $pod_sign_configurations_hash = configurations
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-pod-sign
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - wosicuanqi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-04 00:00:00.000000000 Z
11
+ date: 2022-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -51,6 +51,49 @@ files:
51
51
  - README.md
52
52
  - Rakefile
53
53
  - cocoapods-pod-sign.gemspec
54
+ - example/podSign/Gemfile
55
+ - example/podSign/Gemfile.lock
56
+ - example/podSign/Podfile
57
+ - example/podSign/bundleSign/.gitignore
58
+ - example/podSign/bundleSign/.travis.yml
59
+ - example/podSign/bundleSign/Example/Podfile
60
+ - example/podSign/bundleSign/Example/Pods/Local Podspecs/bundleSign.podspec.json
61
+ - example/podSign/bundleSign/Example/Tests/Tests-Info.plist
62
+ - example/podSign/bundleSign/Example/Tests/Tests-Prefix.pch
63
+ - example/podSign/bundleSign/Example/Tests/Tests.m
64
+ - example/podSign/bundleSign/Example/Tests/en.lproj/InfoPlist.strings
65
+ - example/podSign/bundleSign/Example/bundleSign.xcodeproj/project.pbxproj
66
+ - example/podSign/bundleSign/Example/bundleSign.xcodeproj/project.xcworkspace/contents.xcworkspacedata
67
+ - example/podSign/bundleSign/Example/bundleSign.xcodeproj/xcshareddata/xcschemes/bundleSign-Example.xcscheme
68
+ - example/podSign/bundleSign/LICENSE
69
+ - example/podSign/bundleSign/README.md
70
+ - example/podSign/bundleSign/_Pods.xcodeproj
71
+ - example/podSign/bundleSign/bundleSign.podspec
72
+ - example/podSign/bundleSign/bundleSign/Assets/.gitkeep
73
+ - example/podSign/bundleSign/bundleSign/Assets/screenshot-20220817-205345.png
74
+ - example/podSign/bundleSign/bundleSign/Classes/.gitkeep
75
+ - example/podSign/bundleSign/bundleSign/Classes/ReplaceMe.m
76
+ - example/podSign/podSign.xcodeproj/project.pbxproj
77
+ - example/podSign/podSign.xcodeproj/project.xcworkspace/contents.xcworkspacedata
78
+ - example/podSign/podSign.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
79
+ - example/podSign/podSign.xcodeproj/project.xcworkspace/xcuserdata/liuxiaoliang01.xcuserdatad/UserInterfaceState.xcuserstate
80
+ - example/podSign/podSign.xcodeproj/xcuserdata/liuxiaoliang01.xcuserdatad/xcschemes/xcschememanagement.plist
81
+ - example/podSign/podSign.xcworkspace/contents.xcworkspacedata
82
+ - example/podSign/podSign.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
83
+ - example/podSign/podSign.xcworkspace/xcuserdata/liuxiaoliang01.xcuserdatad/UserInterfaceState.xcuserstate
84
+ - example/podSign/podSign/AppDelegate.h
85
+ - example/podSign/podSign/AppDelegate.m
86
+ - example/podSign/podSign/Assets.xcassets/AccentColor.colorset/Contents.json
87
+ - example/podSign/podSign/Assets.xcassets/AppIcon.appiconset/Contents.json
88
+ - example/podSign/podSign/Assets.xcassets/Contents.json
89
+ - example/podSign/podSign/Base.lproj/LaunchScreen.storyboard
90
+ - example/podSign/podSign/Base.lproj/Main.storyboard
91
+ - example/podSign/podSign/Info.plist
92
+ - example/podSign/podSign/SceneDelegate.h
93
+ - example/podSign/podSign/SceneDelegate.m
94
+ - example/podSign/podSign/ViewController.h
95
+ - example/podSign/podSign/ViewController.m
96
+ - example/podSign/podSign/main.m
54
97
  - lib/.idea/.gitignore
55
98
  - lib/.idea/inspectionProfiles/Project_Default.xml
56
99
  - lib/.idea/lib.iml