cocoapods-pod-sign 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: bc1215d9c1fb53ce2eebc417636ab87e7d9f1475c20cf734740ba3968f79f907
4
+ data.tar.gz: 2d10fa10be40dd8627fae479bf8c68bd28515ba259d81ddb61d7442d020fd386
5
+ SHA512:
6
+ metadata.gz: 935fdf8b485184179d33be735f742df83111fa6caf6ea23bb501da6f871596e8b0130ee5f3ee55f6d85bda75eae35325e745640bf72f19269838df6060311784
7
+ data.tar.gz: 1e751b60aa71c6ce2d3029c727bc708a5b5668a75f945fd66abb60c640d4e6c7e3c0733dd4447ca4231decb1b80d22ef784ddd6ee9c70576e441c7fd16c00c5b
data/.gitignore ADDED
@@ -0,0 +1,56 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ # Used by dotenv library to load environment variables.
14
+ # .env
15
+
16
+ # Ignore Byebug command history file.
17
+ .byebug_history
18
+
19
+ ## Specific to RubyMotion:
20
+ .dat*
21
+ .repl_history
22
+ build/
23
+ *.bridgesupport
24
+ build-iPhoneOS/
25
+ build-iPhoneSimulator/
26
+
27
+ ## Specific to RubyMotion (use of CocoaPods):
28
+ #
29
+ # We recommend against adding the Pods directory to your .gitignore. However
30
+ # you should judge for yourself, the pros and cons are mentioned at:
31
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
32
+ #
33
+ # vendor/Pods/
34
+
35
+ ## Documentation cache and generated files:
36
+ /.yardoc/
37
+ /_yardoc/
38
+ /doc/
39
+ /rdoc/
40
+
41
+ ## Environment normalization:
42
+ /.bundle/
43
+ /vendor/bundle
44
+ /lib/bundler/man/
45
+
46
+ # for a library or gem, you might want to ignore these files since the code is
47
+ # intended to run in multiple environments; otherwise, check them in:
48
+ # Gemfile.lock
49
+ # .ruby-version
50
+ # .ruby-gemset
51
+
52
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
53
+ .rvmrc
54
+
55
+ # Used by RuboCop. Remote config files pulled in from inherit_from directive.
56
+ # .rubocop-https?--*
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cocoapods-pod-sign.gemspec
4
+ gemspec
5
+
6
+ group :development do
7
+ gem 'cocoapods'
8
+
9
+ gem 'mocha'
10
+ gem 'bacon'
11
+ gem 'mocha-on-bacon'
12
+ gem 'prettybacon'
13
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2022 wosicuanqi <1677746430@qq.com>
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # cocoapods-pod-sign
2
+
3
+ cocoapods-pod-sign is a tool to help you set cocopads bundle identifier and team. In order to solve the compilation error of Xcode14.
4
+
5
+ ## Installation
6
+
7
+ $ gem install cocoapods-pod-sign
8
+
9
+ ## Usage
10
+
11
+ There are two ways to use it, one is to automatically obtain the bundle identifier and team, and the other is to set it manually.
12
+
13
+ ### Automatically
14
+
15
+ Just write the following code into the Podfile, it will automatically read the bundle identifier and team from the main project.
16
+
17
+ plugin 'cocoapods-pod-sign'
18
+
19
+ ### Manually
20
+
21
+ You can also manually specify the bundle identifier and team under different configs. For example, I want to set the bundle identifier of the Debug config to com.xxx.app and the team to xxooxxoo.
22
+
23
+ ```
24
+ plugin 'cocoapods-pod-sign'
25
+ config_pod_bundle_id_and_team_id({'Debug' => {:bundle_id => 'com.xxx.app', :team_id => 'xxooxxoo'}})
26
+ ```
27
+
data/Rakefile ADDED
@@ -0,0 +1,13 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ def specs(dir)
4
+ FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
5
+ end
6
+
7
+ desc 'Runs all the specs'
8
+ task :specs do
9
+ sh "bundle exec bacon #{specs('**')}"
10
+ end
11
+
12
+ task :default => :specs
13
+
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'cocoapods-pod-sign/gem_version.rb'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'cocoapods-pod-sign'
8
+ spec.version = CocoapodsPodSign::VERSION
9
+ spec.authors = ['wosicuanqi']
10
+ spec.email = ['1677746430@qq.com']
11
+ spec.description = %q{help you setup CocoaPods bundle indentifier and team.}
12
+ spec.summary = %q{help you setup CocoaPods bundle indentifier and team.}
13
+ spec.homepage = 'https://github.com/1677/CocoaPods-pod-sign'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_development_dependency 'bundler', '~> 1.3'
22
+ spec.add_development_dependency 'rake'
23
+ end
@@ -0,0 +1,8 @@
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Editor-based HTTP Client requests
5
+ /httpRequests/
6
+ # Datasource local storage ignored files
7
+ /dataSources/
8
+ /dataSources.local.xml
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="Rubocop" enabled="false" level="WARNING" enabled_by_default="false" />
5
+ </profile>
6
+ </component>
data/lib/.idea/lib.iml ADDED
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="ModuleRunConfigurationManager">
4
+ <shared />
5
+ </component>
6
+ <component name="NewModuleRootManager">
7
+ <content url="file://$MODULE_DIR$">
8
+ <sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
9
+ <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
10
+ <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
11
+ </content>
12
+ <orderEntry type="inheritedJdk" />
13
+ <orderEntry type="sourceFolder" forTests="false" />
14
+ </component>
15
+ </module>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" project-jdk-name="ruby-2.7.4-p191" project-jdk-type="RUBY_SDK" />
4
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/lib.iml" filepath="$PROJECT_DIR$/.idea/lib.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
data/lib/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,3 @@
1
+ module CocoapodsPodSign
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ module Pod
4
+ class Installer
5
+
6
+ alias_method :origin_run_podfile_post_install_hook, :run_podfile_post_install_hook
7
+ def run_podfile_post_install_hook
8
+
9
+ if $pod_sign_configurations_hash.empty?
10
+ pod_sign_extract_bundle_id_and_team_id_from_user_project
11
+ end
12
+
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
18
+ targets.each do |target|
19
+ target.build_configurations.each do |config|
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
25
+ end
26
+ end
27
+
28
+ origin_run_podfile_post_install_hook
29
+ return true
30
+ end
31
+
32
+ private
33
+
34
+ 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|
38
+ xcconfig_hash ||=
39
+ if config.base_configuration_reference.real_path.exist?
40
+ Xcodeproj::Config.new(config.base_configuration_reference.real_path).to_hash
41
+ else
42
+ {}
43
+ end
44
+ pod_sign_extract_bundle_id_and_team_id(xcconfig_hash, config.name)
45
+ pod_sign_extract_bundle_id_and_team_id(config.build_settings, config.name)
46
+ end
47
+ end
48
+ end
49
+
50
+ def pod_sign_extract_bundle_id_and_team_id(build_settings, config_name)
51
+ bundle_id = build_settings['PRODUCT_BUNDLE_IDENTIFIER']
52
+ 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
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $pod_sign_configurations_hash = {}
4
+ module Pod
5
+ class Podfile
6
+ module DSL
7
+
8
+ def config_pod_bundle_id_and_team_id(configurations)
9
+ unless configurations.instance_of?(Hash)
10
+ UI.info "config_pod_bundle_id_and_team_id parameters not hash".red
11
+ return
12
+ end
13
+ configurations.each do |name, configuration|
14
+ unless configuration.instance_of?(Hash)
15
+ UI.info "config_pod_bundle_id_and_team_id parameters not hash".red
16
+ return
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
20
+ return
21
+ end
22
+ end
23
+ UI.info "config_pod_bundle_id_and_team_id parameters setup success"
24
+ $pod_sign_configurations_hash = configurations
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1 @@
1
+ require 'cocoapods-pod-sign/gem_version'
@@ -0,0 +1,3 @@
1
+ require 'cocoapods-pod-sign/pod_installer'
2
+ require 'cocoapods-pod-sign/podfile_dsl'
3
+
@@ -0,0 +1,12 @@
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
+
3
+ module Pod
4
+ describe Command::Sign do
5
+ describe 'CLAide' do
6
+ it 'registers it self' do
7
+ Command.parse(%w{ sign }).should.be.instance_of Command::Sign
8
+ end
9
+ end
10
+ end
11
+ end
12
+
@@ -0,0 +1,50 @@
1
+ require 'pathname'
2
+ ROOT = Pathname.new(File.expand_path('../../', __FILE__))
3
+ $:.unshift((ROOT + 'lib').to_s)
4
+ $:.unshift((ROOT + 'spec').to_s)
5
+
6
+ require 'bundler/setup'
7
+ require 'bacon'
8
+ require 'mocha-on-bacon'
9
+ require 'pretty_bacon'
10
+ require 'pathname'
11
+ require 'cocoapods'
12
+
13
+ Mocha::Configuration.prevent(:stubbing_non_existent_method)
14
+
15
+ require 'cocoapods_plugin'
16
+
17
+ #-----------------------------------------------------------------------------#
18
+
19
+ module Pod
20
+
21
+ # Disable the wrapping so the output is deterministic in the tests.
22
+ #
23
+ UI.disable_wrap = true
24
+
25
+ # Redirects the messages to an internal store.
26
+ #
27
+ module UI
28
+ @output = ''
29
+ @warnings = ''
30
+
31
+ class << self
32
+ attr_accessor :output
33
+ attr_accessor :warnings
34
+
35
+ def puts(message = '')
36
+ @output << "#{message}\n"
37
+ end
38
+
39
+ def warn(message = '', actions = [])
40
+ @warnings << "#{message}\n"
41
+ end
42
+
43
+ def print(message)
44
+ @output << message
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ #-----------------------------------------------------------------------------#
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cocoapods-pod-sign
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - wosicuanqi
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-07-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: help you setup CocoaPods bundle indentifier and team.
42
+ email:
43
+ - 1677746430@qq.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - cocoapods-pod-sign.gemspec
54
+ - lib/.idea/.gitignore
55
+ - lib/.idea/inspectionProfiles/Project_Default.xml
56
+ - lib/.idea/lib.iml
57
+ - lib/.idea/misc.xml
58
+ - lib/.idea/modules.xml
59
+ - lib/.idea/vcs.xml
60
+ - lib/cocoapods-pod-sign.rb
61
+ - lib/cocoapods-pod-sign/gem_version.rb
62
+ - lib/cocoapods-pod-sign/pod_installer.rb
63
+ - lib/cocoapods-pod-sign/podfile_dsl.rb
64
+ - lib/cocoapods_plugin.rb
65
+ - spec/command/sign_spec.rb
66
+ - spec/spec_helper.rb
67
+ homepage: https://github.com/1677/CocoaPods-pod-sign
68
+ licenses:
69
+ - MIT
70
+ metadata: {}
71
+ post_install_message:
72
+ rdoc_options: []
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ requirements: []
86
+ rubygems_version: 3.3.5
87
+ signing_key:
88
+ specification_version: 4
89
+ summary: help you setup CocoaPods bundle indentifier and team.
90
+ test_files:
91
+ - spec/command/sign_spec.rb
92
+ - spec/spec_helper.rb