cocoapods-byte-panglem-beta 0.0.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 +7 -0
- data/Gemfile +13 -0
- data/LICENSE.txt +22 -0
- data/README.md +11 -0
- data/Rakefile +13 -0
- data/cocoapods-byte-panglem-beta.gemspec +25 -0
- data/lib/cocoapods-byte-panglem-beta/analyzer.rb +213 -0
- data/lib/cocoapods-byte-panglem-beta/command.rb +4 -0
- data/lib/cocoapods-byte-panglem-beta/config.rb +178 -0
- data/lib/cocoapods-byte-panglem-beta/gem_version.rb +11 -0
- data/lib/cocoapods-byte-panglem-beta/net.rb +68 -0
- data/lib/cocoapods-byte-panglem-beta/panglem.rb +203 -0
- data/lib/cocoapods-byte-panglem-beta/plugin.rb +2 -0
- data/lib/cocoapods-byte-panglem-beta/recorder.rb +464 -0
- data/lib/cocoapods-byte-panglem-beta/tool.rb +62 -0
- data/lib/cocoapods-byte-panglem.rb +4 -0
- data/lib/cocoapods_plugin.rb +4 -0
- data/spec/command/panglem_spec.rb +11 -0
- data/spec/spec_helper.rb +50 -0
- metadata +125 -0
@@ -0,0 +1,62 @@
|
|
1
|
+
##Copyright 2023 ByteDance Ltd. and/or its affiliates
|
2
|
+
##SPDX-License-Identifier: MIT
|
3
|
+
|
4
|
+
require 'xcodeproj'
|
5
|
+
require 'yaml'
|
6
|
+
|
7
|
+
module PM
|
8
|
+
|
9
|
+
# lock文件读写
|
10
|
+
#
|
11
|
+
class Lockfile
|
12
|
+
def initialize(hash)
|
13
|
+
@internal_data = hash
|
14
|
+
end
|
15
|
+
|
16
|
+
# 读取lock文件
|
17
|
+
# @requrn lock的json内容
|
18
|
+
# @param 文件路径
|
19
|
+
def self.read_from_path(path)
|
20
|
+
if File.exist?(path)
|
21
|
+
return true, YAML.load_file(path)
|
22
|
+
end
|
23
|
+
return false, nil
|
24
|
+
end
|
25
|
+
|
26
|
+
# 写入lock文件
|
27
|
+
def write_to_disk(path)
|
28
|
+
begin
|
29
|
+
is_exist, existing = Lockfile.read_from_path(path)
|
30
|
+
return if existing == @internal_data
|
31
|
+
rescue Exception
|
32
|
+
end
|
33
|
+
File.open(path, 'w+') do |f|
|
34
|
+
YAML.dump(@internal_data,f)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
class MProject
|
42
|
+
|
43
|
+
def self.get_package_name
|
44
|
+
project_path = Pod::Config.instance.project_root
|
45
|
+
# pattern = File.join(project_path, '*.xcodeproj') # 匹配所有子目录下的 .xcodeproj 文件
|
46
|
+
# xcodeproj_path = Dir.glob(pattern).first
|
47
|
+
xcodeprojs = project_path.children.select { |e| e.fnmatch('*.xcodeproj') }
|
48
|
+
if xcodeprojs.size == 1
|
49
|
+
package_name_list = Array.new
|
50
|
+
project = Xcodeproj::Project.open(xcodeprojs.first)
|
51
|
+
project.targets.map(&:build_configuration_list).map(&:build_configurations).each do |item|
|
52
|
+
package_name_list << item[1].simple_attributes_hash['buildSettings']['PRODUCT_BUNDLE_IDENTIFIER']
|
53
|
+
end
|
54
|
+
package_name_list.uniq
|
55
|
+
else
|
56
|
+
raise Informative, 'Could not automatically select an Xcode project. ' \
|
57
|
+
"Specify one in your Podfile like so:\n\n" \
|
58
|
+
" project 'path/to/Project.xcodeproj'\n"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -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,125 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cocoapods-byte-panglem-beta
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- zhangtianhao.1230@bytedance.com
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-03-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: cocoapods
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.1.1
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '2.0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.1.1
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: bundler
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1.3'
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '1.3'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rake
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: highline
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
description: A short description of cocoapods-byte-panglem.
|
76
|
+
email:
|
77
|
+
- zhangtianhao.1230@bytedance.com
|
78
|
+
executables: []
|
79
|
+
extensions: []
|
80
|
+
extra_rdoc_files: []
|
81
|
+
files:
|
82
|
+
- Gemfile
|
83
|
+
- LICENSE.txt
|
84
|
+
- README.md
|
85
|
+
- Rakefile
|
86
|
+
- cocoapods-byte-panglem-beta.gemspec
|
87
|
+
- lib/cocoapods-byte-panglem-beta/analyzer.rb
|
88
|
+
- lib/cocoapods-byte-panglem-beta/command.rb
|
89
|
+
- lib/cocoapods-byte-panglem-beta/config.rb
|
90
|
+
- lib/cocoapods-byte-panglem-beta/gem_version.rb
|
91
|
+
- lib/cocoapods-byte-panglem-beta/net.rb
|
92
|
+
- lib/cocoapods-byte-panglem-beta/panglem.rb
|
93
|
+
- lib/cocoapods-byte-panglem-beta/plugin.rb
|
94
|
+
- lib/cocoapods-byte-panglem-beta/recorder.rb
|
95
|
+
- lib/cocoapods-byte-panglem-beta/tool.rb
|
96
|
+
- lib/cocoapods-byte-panglem.rb
|
97
|
+
- lib/cocoapods_plugin.rb
|
98
|
+
- spec/command/panglem_spec.rb
|
99
|
+
- spec/spec_helper.rb
|
100
|
+
homepage: https://github.com/EXAMPLE/cocoapods-byte-panglem
|
101
|
+
licenses:
|
102
|
+
- MIT
|
103
|
+
metadata: {}
|
104
|
+
post_install_message:
|
105
|
+
rdoc_options: []
|
106
|
+
require_paths:
|
107
|
+
- lib
|
108
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0'
|
113
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
requirements: []
|
119
|
+
rubygems_version: 3.5.4
|
120
|
+
signing_key:
|
121
|
+
specification_version: 4
|
122
|
+
summary: A longer description of cocoapods-byte-panglem.
|
123
|
+
test_files:
|
124
|
+
- spec/command/panglem_spec.rb
|
125
|
+
- spec/spec_helper.rb
|