cocoapods-vemars 0.0.8 → 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/Gemfile +2 -1
- data/Gemfile.lock +19 -12
- data/lib/cocoapods-vemars/command/project.rb +57 -15
- data/lib/cocoapods-vemars/command/vemars/create.rb +5 -3
- data/lib/cocoapods-vemars/command/vemars/patch.rb +5 -3
- data/lib/cocoapods-vemars/gem_version.rb +1 -1
- data/lib/cocoapods-vemars/hook/podfile_template.rb +5 -5
- data/lib/cocoapods-vemars/services/baselines_api.rb +1 -1
- data/lib/cocoapods-vemars/services/components_api.rb +1 -1
- data/lib/cocoapods-vemars/services/patcher.rb +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c337e1f709eba511b7f96eca02cdf565a548b0c5f1ef954ddccf2d2ac8fdb15
|
4
|
+
data.tar.gz: 786f22698dd0f88f3fa3cf226ae25a06582a8010757ec2c4ec98a55be9594279
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fa61a165444b572aebd01cb958e4387291de453b55d0b91bf56ff041f01eace0db174abdd70439ac2af39410bcd968e2f5d642ac884a6f22ec312b19eeaf874
|
7
|
+
data.tar.gz: 2e8a4f9a5402d62da38def7174451ebc3092abe18da29d1f51ec6bdd34d68befd09097d93ad93f5a816f832059b8c7da4f3dd3224f33471f2c45ab8c96ff806a
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cocoapods-vemars (0.0.
|
4
|
+
cocoapods-vemars (0.0.10)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -12,17 +12,17 @@ GEM
|
|
12
12
|
i18n (>= 0.7, < 2)
|
13
13
|
minitest (~> 5.1)
|
14
14
|
tzinfo (~> 1.1)
|
15
|
-
addressable (2.
|
15
|
+
addressable (2.8.0)
|
16
16
|
public_suffix (>= 2.0.2, < 5.0)
|
17
17
|
algoliasearch (1.27.5)
|
18
18
|
httpclient (~> 2.8, >= 2.8.3)
|
19
19
|
json (>= 1.5.1)
|
20
20
|
atomos (0.1.3)
|
21
21
|
claide (1.0.3)
|
22
|
-
cocoapods (1.10.
|
22
|
+
cocoapods (1.10.2)
|
23
23
|
addressable (~> 2.6)
|
24
24
|
claide (>= 1.0.2, < 2.0)
|
25
|
-
cocoapods-core (= 1.10.
|
25
|
+
cocoapods-core (= 1.10.2)
|
26
26
|
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
27
27
|
cocoapods-downloader (>= 1.4.0, < 2.0)
|
28
28
|
cocoapods-plugins (>= 1.0.0, < 2.0)
|
@@ -37,7 +37,7 @@ GEM
|
|
37
37
|
nap (~> 1.0)
|
38
38
|
ruby-macho (~> 1.4)
|
39
39
|
xcodeproj (>= 1.19.0, < 2.0)
|
40
|
-
cocoapods-core (1.10.
|
40
|
+
cocoapods-core (1.10.2)
|
41
41
|
activesupport (> 5.0, < 6)
|
42
42
|
addressable (~> 2.6)
|
43
43
|
algoliasearch (~> 1.0)
|
@@ -47,24 +47,24 @@ GEM
|
|
47
47
|
netrc (~> 0.11)
|
48
48
|
public_suffix
|
49
49
|
typhoeus (~> 1.0)
|
50
|
-
cocoapods-deintegrate (1.0.
|
50
|
+
cocoapods-deintegrate (1.0.5)
|
51
51
|
cocoapods-downloader (1.4.0)
|
52
52
|
cocoapods-plugins (1.0.0)
|
53
53
|
nap
|
54
|
-
cocoapods-search (1.0.
|
54
|
+
cocoapods-search (1.0.1)
|
55
55
|
cocoapods-trunk (1.5.0)
|
56
56
|
nap (>= 0.8, < 2.0)
|
57
57
|
netrc (~> 0.11)
|
58
58
|
cocoapods-try (1.2.0)
|
59
59
|
colored2 (3.1.2)
|
60
|
-
concurrent-ruby (1.1.
|
60
|
+
concurrent-ruby (1.1.9)
|
61
61
|
debase (0.2.5.beta2)
|
62
62
|
debase-ruby_core_source (>= 0.10.12)
|
63
63
|
debase-ruby_core_source (0.10.12)
|
64
64
|
escape (0.0.4)
|
65
65
|
ethon (0.14.0)
|
66
66
|
ffi (>= 1.15.0)
|
67
|
-
ffi (1.15.
|
67
|
+
ffi (1.15.3)
|
68
68
|
fourflusher (2.3.1)
|
69
69
|
fuzzy_match (2.0.4)
|
70
70
|
gh_inspector (1.1.3)
|
@@ -72,33 +72,36 @@ GEM
|
|
72
72
|
i18n (1.8.10)
|
73
73
|
concurrent-ruby (~> 1.0)
|
74
74
|
json (2.5.1)
|
75
|
+
json_pure (2.5.1)
|
75
76
|
minitest (5.14.4)
|
76
77
|
molinillo (0.6.6)
|
77
78
|
nanaimo (0.3.0)
|
78
79
|
nap (1.1.0)
|
79
80
|
netrc (0.11.0)
|
81
|
+
open-uri (0.1.0)
|
80
82
|
plist (3.6.0)
|
81
83
|
public_suffix (4.0.6)
|
82
|
-
rake (13.0.
|
84
|
+
rake (13.0.6)
|
83
85
|
rexml (3.2.5)
|
84
86
|
ruby-debug-ide (0.7.2)
|
85
87
|
rake (>= 0.8.1)
|
86
88
|
ruby-macho (1.4.0)
|
89
|
+
rubyzip (2.3.2)
|
87
90
|
thread_safe (0.3.6)
|
88
91
|
typhoeus (1.4.0)
|
89
92
|
ethon (>= 0.9.0)
|
90
93
|
tzinfo (1.2.9)
|
91
94
|
thread_safe (~> 0.1)
|
92
|
-
xcodeproj (1.
|
95
|
+
xcodeproj (1.21.0)
|
93
96
|
CFPropertyList (>= 2.3.3, < 4.0)
|
94
97
|
atomos (~> 0.1.3)
|
95
98
|
claide (>= 1.0.2, < 2.0)
|
96
99
|
colored2 (~> 3.1)
|
97
100
|
nanaimo (~> 0.3.0)
|
101
|
+
rexml (~> 3.2.4)
|
98
102
|
|
99
103
|
PLATFORMS
|
100
104
|
x86_64-darwin-19
|
101
|
-
x86_64-darwin-20
|
102
105
|
|
103
106
|
DEPENDENCIES
|
104
107
|
bundler (~> 2.2.15)
|
@@ -106,10 +109,14 @@ DEPENDENCIES
|
|
106
109
|
cocoapods-vemars!
|
107
110
|
concurrent-ruby
|
108
111
|
debase (= 0.2.5.beta2)
|
112
|
+
json_pure
|
113
|
+
open-uri
|
109
114
|
plist (~> 3.2)
|
110
115
|
rake
|
111
116
|
rexml
|
112
117
|
ruby-debug-ide
|
118
|
+
rubyzip (>= 1.0.0)
|
119
|
+
xcodeproj
|
113
120
|
|
114
121
|
BUNDLED WITH
|
115
122
|
2.2.15
|
@@ -3,6 +3,8 @@ require_relative '../services/patcher'
|
|
3
3
|
require_relative '../services/tailor'
|
4
4
|
require_relative 'basicInfo'
|
5
5
|
require_relative '../services/renamer'
|
6
|
+
require 'zip'
|
7
|
+
require 'open-uri'
|
6
8
|
require 'json/pure'
|
7
9
|
module Pod
|
8
10
|
|
@@ -15,13 +17,14 @@ module Pod
|
|
15
17
|
attr_reader :service_url
|
16
18
|
|
17
19
|
attr_accessor :components_details
|
18
|
-
attr_accessor :
|
20
|
+
attr_accessor :sources
|
21
|
+
attr_accessor :demo_tag
|
19
22
|
|
20
23
|
def project_folder
|
21
24
|
File.join(Dir.pwd, "Project")
|
22
25
|
end
|
23
26
|
|
24
|
-
def initialize(app_key, components, config_json, version=nil, bundle_id=nil, name='', language='objc', git_url, service_url)
|
27
|
+
def initialize(app_key, components, config_json, version=nil, bundle_id=nil, name='', language='objc', git_url, service_url,sources)
|
25
28
|
@language = language
|
26
29
|
@basicInfo = BasicInfo.new(app_key, bundle_id, name, version)
|
27
30
|
@git_url = git_url
|
@@ -29,12 +32,13 @@ module Pod
|
|
29
32
|
@selected_components = components | (language == 'swift' ? %w[OneKit SwiftOneKit] : ['OneKit'])
|
30
33
|
@components_details = []
|
31
34
|
@service_url = service_url
|
35
|
+
@sources = sources
|
32
36
|
end
|
33
37
|
|
34
38
|
def generate
|
35
39
|
puts "generate project..."
|
36
|
-
clone_template_project
|
37
40
|
collect_components
|
41
|
+
clone_template_project
|
38
42
|
Dir.chdir(basicInfo.name) do
|
39
43
|
language_switch
|
40
44
|
tailor_demos
|
@@ -55,7 +59,7 @@ module Pod
|
|
55
59
|
collect_components
|
56
60
|
Dir.chdir(podfile_dir) do
|
57
61
|
construct_plist
|
58
|
-
patcher = Patcher.new(podfile_dir, @basicInfo.version, @components_details, @
|
62
|
+
patcher = Patcher.new(podfile_dir, @basicInfo.version, @components_details, @sources, @git_url, @demo_tag)
|
59
63
|
patcher.execute
|
60
64
|
end
|
61
65
|
end
|
@@ -65,9 +69,32 @@ module Pod
|
|
65
69
|
if File.directory?(basicInfo.name) || File.file?(basicInfo.name)
|
66
70
|
system("rm -rf #{basicInfo.name}")
|
67
71
|
end
|
72
|
+
if git_url.end_with?(".git")
|
73
|
+
cmd = ""
|
74
|
+
if @demo_tag.nil?
|
75
|
+
cmd = "git clone #{git_url} #{basicInfo.name}"
|
76
|
+
else
|
77
|
+
cmd = "git clone #{git_url} #{basicInfo.name} -b #{@demo_tag} --config advice.detachedHead=false"
|
78
|
+
end
|
79
|
+
system(cmd)
|
80
|
+
else
|
81
|
+
destination = basicInfo.name
|
82
|
+
FileUtils.mkdir_p(destination)
|
83
|
+
content = URI.open(git_url)
|
84
|
+
|
85
|
+
Zip::File.open_buffer(content) do |zip|
|
86
|
+
zip.each do |f|
|
87
|
+
fname = f.name
|
88
|
+
if fname.start_with?("ve_Template_iOS")
|
89
|
+
paths = fname.split("/")
|
90
|
+
fname = fname.sub(paths[0],"")
|
91
|
+
end
|
92
|
+
fpath = File.join(destination, fname)
|
93
|
+
zip.extract(f, fpath) unless File.exist?(fpath)
|
94
|
+
end
|
95
|
+
end
|
68
96
|
|
69
|
-
|
70
|
-
system(cmd)
|
97
|
+
end
|
71
98
|
end
|
72
99
|
|
73
100
|
def language_switch
|
@@ -87,33 +114,48 @@ module Pod
|
|
87
114
|
def collect_components
|
88
115
|
components_api = Components_api.new(@basicInfo.version,@service_url)
|
89
116
|
all_components = components_api.getComponents
|
90
|
-
@source = components_api.source
|
91
117
|
@selected_components.each do |com|
|
92
118
|
existed_com = all_components.find { |acom|
|
93
119
|
acom.name == com
|
94
120
|
}
|
95
121
|
@components_details.append existed_com unless existed_com.nil?
|
96
122
|
end
|
123
|
+
|
124
|
+
demo_com = all_components.find { |acom|
|
125
|
+
acom.name == "ve_Template_iOS"
|
126
|
+
}
|
127
|
+
|
128
|
+
if !demo_com.nil?
|
129
|
+
@demo_tag = demo_com.version
|
130
|
+
end
|
97
131
|
|
98
132
|
end
|
99
133
|
|
100
134
|
def construct_podfile
|
101
|
-
template = PodfileTemplate.new(@basicInfo.version, @components_details, @
|
135
|
+
template = PodfileTemplate.new(@basicInfo.version, @components_details, @sources)
|
102
136
|
|
103
137
|
File.open('Podfile', "w") { |file| file.puts template.to_dsl }
|
104
138
|
end
|
105
139
|
|
106
140
|
|
107
141
|
def construct_plist
|
108
|
-
|
142
|
+
content = File.read(@config_json)
|
143
|
+
json = JSON.parse(content)
|
109
144
|
json["project_info"]["app_id"] = json["project_info"]["app_id"].to_s
|
110
|
-
services =
|
111
|
-
if @selected_components.include?
|
112
|
-
services["
|
145
|
+
services = json["services"]
|
146
|
+
if @selected_components.include?("BDHotfix") && services.include?("hotfix")
|
147
|
+
hotfix = services["hotfix"]
|
148
|
+
hotfix["dist_area"] = "cn"
|
149
|
+
hotfix["debug"] = true
|
150
|
+
services["hotfix"] = hotfix
|
113
151
|
end
|
114
|
-
if @selected_components.include?
|
115
|
-
services["
|
116
|
-
|
152
|
+
if @selected_components.include?("VEH5Kit") && services.include?("h5")
|
153
|
+
h5 = services["h5"]
|
154
|
+
h5["auth_enable"] = false
|
155
|
+
h5["pattern"] = ""
|
156
|
+
h5["gecko_channels"] = []
|
157
|
+
h5["gecko_access_key"] = ""
|
158
|
+
services["h5"] = h5
|
117
159
|
end
|
118
160
|
json["services"] = services
|
119
161
|
File.open(Dir.pwd + "/onekit-config.plist", 'w') { |file|
|
@@ -25,7 +25,8 @@ module Pod
|
|
25
25
|
['--config=CONFIG_PATH', 'config path of vemars.'],
|
26
26
|
['--service_url=SERVICE_URL', 'url of vemars CLI service.'],
|
27
27
|
['--git=GIT_URL', 'git url of demo repo'],
|
28
|
-
['--pod_repo_no_update', 'do not run pod repo update']
|
28
|
+
['--pod_repo_no_update', 'do not run pod repo update'],
|
29
|
+
['--sources','pod repos sources']
|
29
30
|
]
|
30
31
|
options.concat(super.reject { |option, _| option == '--silent' })
|
31
32
|
end
|
@@ -34,7 +35,7 @@ module Pod
|
|
34
35
|
@name = argv.shift_argument
|
35
36
|
@version = argv.shift_argument
|
36
37
|
@language = argv.option('language', 'objc')
|
37
|
-
git_url = argv.option('git', '
|
38
|
+
git_url = argv.option('git', 'https://github.com/volcengine/ve_Template_iOS.git')
|
38
39
|
@silent = argv.flag?('silent', false)
|
39
40
|
@repo_no_update = argv.flag?('pod_repo_no_update',false)
|
40
41
|
@appkey = argv.option('appkey', '')
|
@@ -42,7 +43,8 @@ module Pod
|
|
42
43
|
@selected_components = argv.option('com', "").split(',')
|
43
44
|
@config_json = argv.option('config', '/onekit-config.json')
|
44
45
|
service_url = argv.option('service_url',nil)
|
45
|
-
|
46
|
+
sources = argv.option('sources','https://github.com/volcengine/volcengine-specs.git,https://cdn.cocoapods.org/')
|
47
|
+
@project = VemarsProject.new(@appkey, @selected_components, @config_json, @version, @bundle_id, @name, @language, git_url,service_url,sources)
|
46
48
|
super
|
47
49
|
@additional_args = argv.remainder!
|
48
50
|
end
|
@@ -22,7 +22,8 @@ module Pod
|
|
22
22
|
['--config=CONFIG_PATH', 'config path of vemars.'],
|
23
23
|
['--service_url=SERVICE_URL', 'url of vemars CLI service.'],
|
24
24
|
['--git=GIT_URL', 'git url of demo repo'],
|
25
|
-
['--pod_repo_no_update', 'do not run pod repo update']
|
25
|
+
['--pod_repo_no_update', 'do not run pod repo update'],
|
26
|
+
['--sources','pod repos sources']
|
26
27
|
]
|
27
28
|
options.concat(super.reject { |option, _| option == '--silent' })
|
28
29
|
end
|
@@ -33,9 +34,10 @@ module Pod
|
|
33
34
|
@selected_components = argv.option('com', '').split(',')
|
34
35
|
@config_json = argv.option('config', '/onekit-config.json')
|
35
36
|
@repo_no_update = argv.flag?('pod_repo_no_update',false)
|
36
|
-
git_url = argv.option('git', '
|
37
|
+
git_url = argv.option('git', 'https://github.com/volcengine/ve_Template_iOS.git')
|
37
38
|
service_url = argv.option('service_url',nil)
|
38
|
-
|
39
|
+
sources = argv.option('sources','https://github.com/volcengine/volcengine-specs.git,https://cdn.cocoapods.org/')
|
40
|
+
@project = VemarsProject.new(@appkey, @selected_components, @config_json, @baseline, git_url, service_url,sources)
|
39
41
|
super
|
40
42
|
@additional_args = argv.remainder!
|
41
43
|
end
|
@@ -2,15 +2,15 @@ module Pod
|
|
2
2
|
class PodfileTemplate
|
3
3
|
|
4
4
|
attr_reader :componentsList
|
5
|
-
attr_reader :
|
5
|
+
attr_reader :sources
|
6
6
|
attr_reader :baseline_version
|
7
7
|
|
8
8
|
IOS_VERSION = '9.0'.freeze
|
9
9
|
|
10
|
-
def initialize(baseline_version, componentsList,
|
10
|
+
def initialize(baseline_version, componentsList, sources)
|
11
11
|
@baseline_version = baseline_version
|
12
12
|
@componentsList = componentsList
|
13
|
-
@
|
13
|
+
@sources = sources
|
14
14
|
end
|
15
15
|
|
16
16
|
def to_dsl
|
@@ -21,7 +21,6 @@ module Pod
|
|
21
21
|
#plugin 'cocoapods-vemars'
|
22
22
|
install! 'cocoapods', :deterministic_uuids => false
|
23
23
|
|
24
|
-
source 'https://cdn.cocoapods.org/'
|
25
24
|
#{source_template}
|
26
25
|
|
27
26
|
#{releasePod}
|
@@ -38,7 +37,8 @@ inhibit_all_warnings!
|
|
38
37
|
end
|
39
38
|
|
40
39
|
def source_template
|
41
|
-
|
40
|
+
source_urls = sources.split(",")
|
41
|
+
"#{source_urls.map{ |url| "source '#{url}'"}.join("\n")}"
|
42
42
|
end
|
43
43
|
|
44
44
|
def releasePod
|
@@ -4,7 +4,7 @@ module Pod
|
|
4
4
|
class Baselines_api
|
5
5
|
include Concurrent::Async
|
6
6
|
|
7
|
-
BASELINES_URL = 'https://
|
7
|
+
BASELINES_URL = 'https://mars-fwk.vemarsdev.com/mpaas/baseline/baselines'.freeze
|
8
8
|
attr_accessor :result
|
9
9
|
|
10
10
|
public def initialize(url=BASELINES_URL)
|
@@ -5,7 +5,7 @@ module Pod
|
|
5
5
|
class Components_api
|
6
6
|
include Concurrent::Async
|
7
7
|
|
8
|
-
COMPONENTS_URL = 'https://
|
8
|
+
COMPONENTS_URL = 'https://mars-fwk.vemarsdev.com/mpaas/baseline/baseline_config'.freeze
|
9
9
|
|
10
10
|
attr_reader :source
|
11
11
|
attr_reader :baseline
|
@@ -13,7 +13,7 @@ module Pod
|
|
13
13
|
attr_reader :podfile_dir
|
14
14
|
attr_reader :template
|
15
15
|
|
16
|
-
def initialize(podfile_dir, baseline, components_details, source, git_url)
|
16
|
+
def initialize(podfile_dir, baseline, components_details, source, git_url,demo_tag)
|
17
17
|
@podfile_dir = podfile_dir
|
18
18
|
@template = PodfileTemplate.new(baseline, components_details, source)
|
19
19
|
@components_details = components_details
|
@@ -21,6 +21,7 @@ module Pod
|
|
21
21
|
puts git_url
|
22
22
|
@hasInjectedSource = false
|
23
23
|
@hasInjectedVemarsPods = false
|
24
|
+
@demo_tag = demo_tag
|
24
25
|
end
|
25
26
|
|
26
27
|
def execute
|
@@ -77,7 +78,11 @@ module Pod
|
|
77
78
|
end
|
78
79
|
|
79
80
|
def clone_project
|
80
|
-
|
81
|
+
if @demo_tag.nil?
|
82
|
+
system("git clone #{@git_url} ./.vemars")
|
83
|
+
else
|
84
|
+
system("git clone #{@git_url} ./.vemars -b #{@demo_tag} --config advice.detachedHead=false")
|
85
|
+
end
|
81
86
|
system("mv ./.vemars/DevPods ./DevPods")
|
82
87
|
end
|
83
88
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-vemars
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- huangbomao@bytedance.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|