cocoapods-vemars 0.0.7 → 0.0.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce531382e591ecfbc337cc96b019dee3e01e08db54e74661edd8a9b7bfba5a09
4
- data.tar.gz: d6d5e7a9c6ba4faa87d0c4c262053cc82fe33ebf891278a790e3d5f3229d12ce
3
+ metadata.gz: 95220f9df2d38ad1f3b902560dd7c10363d5153c93e02e253ce28836711488e6
4
+ data.tar.gz: b6d9069e06a1ec429d5718338fd4476c4050485dacd4a42cc61896ed2662ca9b
5
5
  SHA512:
6
- metadata.gz: 2df655100debe173901074517f0ea78fc7742c6fe2afc611c73001effe77f606930224a677eeb4c49beaba6c60b75e8017d6c096dafffb48cb85d12cdbb51a4f
7
- data.tar.gz: 7032cd7b71861d3c19a7917930dcaae1bcae32e849d17bdde3ed7b5d01c94eade1ceeb72841162db60ab5b88e33f84699f219032438eda74be4c93890676ea46
6
+ metadata.gz: '0904ed16ad954b514f3a544c23df8261403324872d0b59a03ec2ecfa2272f4c64fca54a6ea5c92dc0b031eef54d8dc66472bdf997cc46bfdbc4a0599ab9baa6e'
7
+ data.tar.gz: 29c4b869b6fc2020b4e7fa8498966b73cee3119abfc1b9dd42afe80e718543cbb045b854709e9a28242b96290aafa3433b3254cdb544cc6645dee6e9e048db17
data/Gemfile CHANGED
@@ -7,9 +7,10 @@ gem 'plist', '~> 3.2'
7
7
  gem 'rexml'
8
8
  gem 'concurrent-ruby', require: 'concurrent'
9
9
  gem 'xcodeproj'
10
- gem 'json'
10
+ gem 'json_pure'
11
11
  gem 'cocoapods'
12
-
12
+ gem 'rubyzip', '>= 1.0.0'
13
+ gem 'open-uri'
13
14
  group :debug do
14
15
  gem 'ruby-debug-ide'
15
16
  gem 'debase', '0.2.5.beta2'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-vemars (0.0.5)
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.7.0)
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.1)
22
+ cocoapods (1.10.2)
23
23
  addressable (~> 2.6)
24
24
  claide (>= 1.0.2, < 2.0)
25
- cocoapods-core (= 1.10.1)
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.1)
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.4)
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.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.8)
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.1)
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.3)
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.19.0)
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,11 +109,13 @@ DEPENDENCIES
106
109
  cocoapods-vemars!
107
110
  concurrent-ruby
108
111
  debase (= 0.2.5.beta2)
109
- json
112
+ json_pure
113
+ open-uri
110
114
  plist (~> 3.2)
111
115
  rake
112
116
  rexml
113
117
  ruby-debug-ide
118
+ rubyzip (>= 1.0.0)
114
119
  xcodeproj
115
120
 
116
121
  BUNDLED WITH
@@ -3,7 +3,9 @@ require_relative '../services/patcher'
3
3
  require_relative '../services/tailor'
4
4
  require_relative 'basicInfo'
5
5
  require_relative '../services/renamer'
6
- require 'json'
6
+ require 'zip'
7
+ require 'open-uri'
8
+ require 'json/pure'
7
9
  module Pod
8
10
 
9
11
  class VemarsProject
@@ -15,13 +17,13 @@ module Pod
15
17
  attr_reader :service_url
16
18
 
17
19
  attr_accessor :components_details
18
- attr_accessor :source
20
+ attr_accessor :sources
19
21
 
20
22
  def project_folder
21
23
  File.join(Dir.pwd, "Project")
22
24
  end
23
25
 
24
- def initialize(app_key, components, config_json, version=nil, bundle_id=nil, name='', language='objc', git_url, service_url)
26
+ def initialize(app_key, components, config_json, version=nil, bundle_id=nil, name='', language='objc', git_url, service_url,sources)
25
27
  @language = language
26
28
  @basicInfo = BasicInfo.new(app_key, bundle_id, name, version)
27
29
  @git_url = git_url
@@ -29,6 +31,7 @@ module Pod
29
31
  @selected_components = components | (language == 'swift' ? %w[OneKit SwiftOneKit] : ['OneKit'])
30
32
  @components_details = []
31
33
  @service_url = service_url
34
+ @sources = sources
32
35
  end
33
36
 
34
37
  def generate
@@ -55,7 +58,7 @@ module Pod
55
58
  collect_components
56
59
  Dir.chdir(podfile_dir) do
57
60
  construct_plist
58
- patcher = Patcher.new(podfile_dir, @basicInfo.version, @components_details, @source, @git_url)
61
+ patcher = Patcher.new(podfile_dir, @basicInfo.version, @components_details, @sources, @git_url)
59
62
  patcher.execute
60
63
  end
61
64
  end
@@ -65,9 +68,27 @@ module Pod
65
68
  if File.directory?(basicInfo.name) || File.file?(basicInfo.name)
66
69
  system("rm -rf #{basicInfo.name}")
67
70
  end
71
+ if git_url.end_with?(".git")
72
+ cmd = "git clone #{git_url} #{basicInfo.name}"
73
+ system(cmd)
74
+ else
75
+ destination = basicInfo.name
76
+ FileUtils.mkdir_p(destination)
77
+ content = URI.open(git_url)
78
+
79
+ Zip::File.open_buffer(content) do |zip|
80
+ zip.each do |f|
81
+ fname = f.name
82
+ if fname.start_with?("ve_Template_iOS")
83
+ paths = fname.split("/")
84
+ fname = fname.sub(paths[0],"")
85
+ end
86
+ fpath = File.join(destination, fname)
87
+ zip.extract(f, fpath) unless File.exist?(fpath)
88
+ end
89
+ end
68
90
 
69
- cmd = "git clone #{git_url} #{basicInfo.name}"
70
- system(cmd)
91
+ end
71
92
  end
72
93
 
73
94
  def language_switch
@@ -87,7 +108,6 @@ module Pod
87
108
  def collect_components
88
109
  components_api = Components_api.new(@basicInfo.version,@service_url)
89
110
  all_components = components_api.getComponents
90
- @source = components_api.source
91
111
  @selected_components.each do |com|
92
112
  existed_com = all_components.find { |acom|
93
113
  acom.name == com
@@ -98,14 +118,15 @@ module Pod
98
118
  end
99
119
 
100
120
  def construct_podfile
101
- template = PodfileTemplate.new(@basicInfo.version, @components_details, @source)
121
+ template = PodfileTemplate.new(@basicInfo.version, @components_details, @sources)
102
122
 
103
123
  File.open('Podfile', "w") { |file| file.puts template.to_dsl }
104
124
  end
105
125
 
106
126
 
107
127
  def construct_plist
108
- json = JSON.load_file @config_json
128
+ content = File.read(@config_json)
129
+ json = JSON.parse(content)
109
130
  json["project_info"]["app_id"] = json["project_info"]["app_id"].to_s
110
131
  services = Hash.new
111
132
  if @selected_components.include? "BDHotfix"
@@ -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', 'git@github.com:volcengine/ve_Template_iOS.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
- @project = VemarsProject.new(@appkey, @selected_components, @config_json, @version, @bundle_id, @name, @language, git_url,service_url)
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', 'git@github.com:volcengine/ve_Template_iOS.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
- @project = VemarsProject.new(@appkey, @selected_components, @config_json, @baseline, git_url, service_url)
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
@@ -1,3 +1,3 @@
1
1
  module CocoapodsVemars
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -2,15 +2,15 @@ module Pod
2
2
  class PodfileTemplate
3
3
 
4
4
  attr_reader :componentsList
5
- attr_reader :source
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, source)
10
+ def initialize(baseline_version, componentsList, sources)
11
11
  @baseline_version = baseline_version
12
12
  @componentsList = componentsList
13
- @source = source
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
- "source '#{source}'"
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://poc-api.vemarsdev.com/mpaas/baseline/baselines'.freeze
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://poc-api.vemarsdev.com/mpaas/baseline/baseline_config'.freeze
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
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.7
4
+ version: 0.0.11
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-08-17 00:00:00.000000000 Z
11
+ date: 2021-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler