cocoapods-vemars 0.0.2 → 0.0.6

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: 900891781b0e66c13781cf48797a0082ee45e4f31d4d0abd2e961f9e6192e038
4
- data.tar.gz: 7a66a578915f7857a06b733ecec258c78932c8161e4a9655acc54e96fa7c6b62
3
+ metadata.gz: 503b86605e7ed3937976076c9e1d6bd3089631f7bd8840e669a2fb583be2f158
4
+ data.tar.gz: 7715fb8c8817e21b10e7198be4df9e6a367ab56b5e0c013d2b4811e932207ba4
5
5
  SHA512:
6
- metadata.gz: 27618bd7e1553cae3f8081533d262b54ff508cd1d67b976e70f70838c5a3d2afded84453616b1dc7cd314e3e15b39e9e21be7fdeef915ccc355ddd10da9f360a
7
- data.tar.gz: 58ed550b09bfdb4c8302a0ce9fbb5b19fecc2ba94bd4c627f03ff4d9e3d3074bdd6f46f02b18acee7c1309e109ca3682164908dc3f9efce8359fc28e1784bea2
6
+ metadata.gz: 57b157fdf9b702ffc70fe634a68685db0e276fa70c1b3cdfd50f10f8bdecdf189438c9571e949dd2dd911d2c5ca64462527ebdb2841a5673c338c4989112884f
7
+ data.tar.gz: 7e56f1593607cb17e568ce11389d808ec2e6144afa8d56209734cd68a719a16326802508d486406f75e741e7a2de94a2fe52cd583c77f0905fdbd00cb2de6da6
data/.gitignore CHANGED
@@ -6,4 +6,6 @@ install
6
6
  .bundle
7
7
 
8
8
  *.gem
9
- *.gemspec
9
+ *.gemspec
10
+ ruby/
11
+ test/
data/Gemfile CHANGED
@@ -3,14 +3,16 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in cocoapods-vemars.gemspec
4
4
  gemspec
5
5
 
6
+ gem 'plist', '~> 3.2'
7
+ gem 'rexml'
8
+ gem 'concurrent-ruby', require: 'concurrent'
9
+ gem 'xcodeproj'
10
+ gem 'json'
11
+ gem 'cocoapods'
12
+
6
13
  group :debug do
7
- gem 'cocoapods'
8
- # gem 'ruby-debug-ide'
9
- # gem 'debase', '0.2.5.beta2'
10
- gem 'plist', '~> 3.2'
11
- gem 'rexml'
12
- gem 'concurrent-ruby', require: 'concurrent'
13
- gem 'xcodeproj'
14
+ gem 'ruby-debug-ide'
15
+ gem 'debase', '0.2.5.beta2'
14
16
  end
15
17
 
16
18
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-vemars (0.0.1)
4
+ cocoapods-vemars (0.0.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -12,7 +12,7 @@ GEM
12
12
  i18n (>= 0.7, < 2)
13
13
  minitest (~> 5.1)
14
14
  tzinfo (~> 1.1)
15
- addressable (2.8.0)
15
+ addressable (2.7.0)
16
16
  public_suffix (>= 2.0.2, < 5.0)
17
17
  algoliasearch (1.27.5)
18
18
  httpclient (~> 2.8, >= 2.8.3)
@@ -57,11 +57,14 @@ GEM
57
57
  netrc (~> 0.11)
58
58
  cocoapods-try (1.2.0)
59
59
  colored2 (3.1.2)
60
- concurrent-ruby (1.1.9)
60
+ concurrent-ruby (1.1.8)
61
+ debase (0.2.5.beta2)
62
+ debase-ruby_core_source (>= 0.10.12)
63
+ debase-ruby_core_source (0.10.12)
61
64
  escape (0.0.4)
62
65
  ethon (0.14.0)
63
66
  ffi (>= 1.15.0)
64
- ffi (1.15.3)
67
+ ffi (1.15.1)
65
68
  fourflusher (2.3.1)
66
69
  fuzzy_match (2.0.4)
67
70
  gh_inspector (1.1.3)
@@ -76,33 +79,38 @@ GEM
76
79
  netrc (0.11.0)
77
80
  plist (3.6.0)
78
81
  public_suffix (4.0.6)
79
- rake (13.0.6)
82
+ rake (13.0.3)
80
83
  rexml (3.2.5)
84
+ ruby-debug-ide (0.7.2)
85
+ rake (>= 0.8.1)
81
86
  ruby-macho (1.4.0)
82
87
  thread_safe (0.3.6)
83
88
  typhoeus (1.4.0)
84
89
  ethon (>= 0.9.0)
85
90
  tzinfo (1.2.9)
86
91
  thread_safe (~> 0.1)
87
- xcodeproj (1.20.0)
92
+ xcodeproj (1.19.0)
88
93
  CFPropertyList (>= 2.3.3, < 4.0)
89
94
  atomos (~> 0.1.3)
90
95
  claide (>= 1.0.2, < 2.0)
91
96
  colored2 (~> 3.1)
92
97
  nanaimo (~> 0.3.0)
93
- rexml (~> 3.2.4)
94
98
 
95
99
  PLATFORMS
96
100
  x86_64-darwin-19
101
+ x86_64-darwin-20
97
102
 
98
103
  DEPENDENCIES
99
104
  bundler (~> 2.2.15)
100
105
  cocoapods
101
106
  cocoapods-vemars!
102
107
  concurrent-ruby
108
+ debase (= 0.2.5.beta2)
109
+ json
103
110
  plist (~> 3.2)
104
111
  rake
105
112
  rexml
113
+ ruby-debug-ide
106
114
  xcodeproj
107
115
 
108
116
  BUNDLED WITH
@@ -3,7 +3,7 @@ require_relative '../services/patcher'
3
3
  require_relative '../services/tailor'
4
4
  require_relative 'basicInfo'
5
5
  require_relative '../services/renamer'
6
-
6
+ require 'json'
7
7
  module Pod
8
8
 
9
9
  class VemarsProject
@@ -12,6 +12,7 @@ module Pod
12
12
  attr_reader :basicInfo
13
13
  attr_reader :selected_components
14
14
  attr_reader :git_url
15
+ attr_reader :service_url
15
16
 
16
17
  attr_accessor :components_details
17
18
  attr_accessor :source
@@ -20,13 +21,14 @@ module Pod
20
21
  File.join(Dir.pwd, "Project")
21
22
  end
22
23
 
23
- def initialize(app_key, components, config_json, version=nil, bundle_id=nil, name='', language='objc', git_url)
24
+ def initialize(app_key, components, config_json, version=nil, bundle_id=nil, name='', language='objc', git_url, service_url)
24
25
  @language = language
25
26
  @basicInfo = BasicInfo.new(app_key, bundle_id, name, version)
26
27
  @git_url = git_url
27
28
  @config_json = config_json
28
29
  @selected_components = components | (language == 'swift' ? %w[OneKit SwiftOneKit] : ['OneKit'])
29
30
  @components_details = []
31
+ @service_url = service_url
30
32
  end
31
33
 
32
34
  def generate
@@ -83,7 +85,7 @@ module Pod
83
85
  end
84
86
 
85
87
  def collect_components
86
- components_api = Components_api.new(@basicInfo.version)
88
+ components_api = Components_api.new(@basicInfo.version,@service_url)
87
89
  all_components = components_api.getComponents
88
90
  @source = components_api.source
89
91
  @selected_components.each do |com|
@@ -104,6 +106,16 @@ module Pod
104
106
 
105
107
  def construct_plist
106
108
  json = JSON.load_file @config_json
109
+ json["project_info"]["app_id"] = json["project_info"]["app_id"].to_s
110
+ services = Hash.new
111
+ if @selected_components.include? "BDHotfix"
112
+ services["bdhotfix"] = { "dist_area" => "cn", "domain_name" => "", "debug" => true}
113
+ end
114
+ if @selected_components.include? "VEH5Kit"
115
+ services["jsbridge_services"] = { "auth_domain" => "", "auth_enable" => false}
116
+ services["gecko_services"] = { "platform_domain" => "", "pattern" => "", "gecko_channels" => [], "gecko_access_key" => ""}
117
+ end
118
+ json["services"] = services
107
119
  File.open(Dir.pwd + "/onekit-config.plist", 'w') { |file|
108
120
  file.puts json.to_plist
109
121
  }
@@ -11,8 +11,20 @@ module Pod
11
11
  Query what baseline versions are available in vemars.
12
12
  DESC
13
13
 
14
+ def self.options
15
+ options = [
16
+ ['--service_url=SERVICE_URL', 'url of vemars CLI service.']
17
+ ]
18
+ end
19
+
20
+ def initialize(argv)
21
+ @service_url = argv.option('service_url',nil)
22
+ super
23
+ @additional_args = argv.remainder!
24
+ end
25
+
14
26
  def run
15
- api = Baselines_api.new()
27
+ api = Baselines_api.new(@service_url)
16
28
  api.getBaselines
17
29
  end
18
30
 
@@ -15,9 +15,16 @@ module Pod
15
15
  CLAide::Argument.new('BASELINE', false)
16
16
  ]
17
17
 
18
+ def self.options
19
+ options = [
20
+ ['--service_url=SERVICE_URL', 'url of vemars CLI service.']
21
+ ]
22
+ end
23
+
18
24
  def initialize(argv)
19
25
  baseline = argv.shift_argument
20
- @api = Components_api.new(baseline)
26
+ service_url = argv.option('service_url',nil)
27
+ @api = Components_api.new(baseline,service_url)
21
28
  super
22
29
  @additional_args = argv.remainder!
23
30
  end
@@ -22,7 +22,10 @@ module Pod
22
22
  ['--silent', 'do not run pod install'],
23
23
  ['--bundle_id=bundle_id', 'the bundle_id from Vemars'],
24
24
  ['--com=COM1,COM2', 'Selected components in vemars.'],
25
- ['--config=CONFIG_PATH', 'config path of vemars.']
25
+ ['--config=CONFIG_PATH', 'config path of vemars.'],
26
+ ['--service_url=SERVICE_URL', 'url of vemars CLI service.'],
27
+ ['--git=GIT_URL', 'git url of demo repo'],
28
+ ['--pod_repo_no_update', 'do not run pod repo update']
26
29
  ]
27
30
  options.concat(super.reject { |option, _| option == '--silent' })
28
31
  end
@@ -31,13 +34,15 @@ module Pod
31
34
  @name = argv.shift_argument
32
35
  @version = argv.shift_argument
33
36
  @language = argv.option('language', 'objc')
34
- 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')
35
38
  @silent = argv.flag?('silent', false)
39
+ @repo_no_update = argv.flag?('pod_repo_no_update',false)
36
40
  @appkey = argv.option('appkey', '')
37
41
  @bundle_id = argv.option('bundle_id', nil)
38
42
  @selected_components = argv.option('com', "").split(',')
39
43
  @config_json = argv.option('config', '/onekit-config.json')
40
- @project = VemarsProject.new(@appkey, @selected_components, @config_json, @version, @bundle_id, @name, @language, git_url)
44
+ 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)
41
46
  super
42
47
  @additional_args = argv.remainder!
43
48
  end
@@ -77,8 +82,14 @@ module Pod
77
82
  end
78
83
 
79
84
  Dir.chdir(project_dir) do
80
- system('bundle install')
81
- system('bundle exec pod install --repo-update')
85
+ # system('bundle install')
86
+ # system('bundle exec pod install --repo-update')
87
+ if @repo_no_update
88
+ puts "Pod install skipped!"
89
+ system('pod install --no-repo-update')
90
+ else
91
+ system('pod install --repo-update')
92
+ end
82
93
  end
83
94
  end
84
95
 
@@ -19,8 +19,10 @@ module Pod
19
19
  options = [
20
20
  ['--path=PODFILE_PATH', 'the /path/to/Dir_contains_Podfile'],
21
21
  ['--com=COM1,COM2', 'Selected components in vemars.'],
22
- ['--silent', 'do not run pod install'],
23
- ['--config=CONFIG_PATH', 'config path of vemars.']
22
+ ['--config=CONFIG_PATH', 'config path of vemars.'],
23
+ ['--service_url=SERVICE_URL', 'url of vemars CLI service.'],
24
+ ['--git=GIT_URL', 'git url of demo repo'],
25
+ ['--pod_repo_no_update', 'do not run pod repo update']
24
26
  ]
25
27
  options.concat(super.reject { |option, _| option == '--silent' })
26
28
  end
@@ -30,10 +32,12 @@ module Pod
30
32
  @path = argv.option('path', '')
31
33
  @selected_components = argv.option('com', '').split(',')
32
34
  @config_json = argv.option('config', '/onekit-config.json')
35
+ @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
+ service_url = argv.option('service_url',nil)
38
+ @project = VemarsProject.new(@appkey, @selected_components, @config_json, @baseline, git_url, service_url)
33
39
  super
34
40
  @additional_args = argv.remainder!
35
- git_url = argv.option('git', 'git@github.com:volcengine/ve_Template_iOS.git')
36
- @project = VemarsProject.new(@appkey, @selected_components, @config_json, @baseline, git_url)
37
41
  end
38
42
 
39
43
  def validate!
@@ -63,8 +67,14 @@ module Pod
63
67
  end
64
68
 
65
69
  Dir.chdir(project_dir) do
66
- system('bundle install')
67
- system('bundle exec pod install --repo-update')
70
+ # system('bundle install')
71
+ # system('bundle exec pod install --repo-update')
72
+ if @repo_no_update
73
+ puts "pod install with no repo update"
74
+ system('pod install --no-repo-update')
75
+ else
76
+ system('pod install --repo-update')
77
+ end
68
78
  end
69
79
  end
70
80
 
@@ -1,3 +1,3 @@
1
1
  module CocoapodsVemars
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -19,6 +19,7 @@ module Pod
19
19
  #{platform}
20
20
 
21
21
  #plugin 'cocoapods-vemars'
22
+ install! 'cocoapods', :deterministic_uuids => false
22
23
 
23
24
  source 'https://cdn.cocoapods.org/'
24
25
  #{source_template}
@@ -4,13 +4,17 @@ module Pod
4
4
  class Baselines_api
5
5
  include Concurrent::Async
6
6
 
7
- BASELINES_URL = 'http://mars-mpaas.bytedance.net/mpaas/baseline/baselines'.freeze
7
+ BASELINES_URL = 'https://poc-api.vemarsdev.com/mpaas/baseline/baselines'.freeze
8
8
  attr_accessor :result
9
9
 
10
+ public def initialize(url=BASELINES_URL)
11
+ @baseline_url = (url.blank? ? BASELINES_URL : url + "mpaas/baseline/baselines")
12
+ end
13
+
10
14
  def getBaselines
11
15
  body= "{\"technology_stack\": \"iOS\"}"
12
16
  header = {"ContentType" => 'application/json'}
13
- response = REST.post(BASELINES_URL, body, header)
17
+ response = REST.post(@baseline_url, body, header)
14
18
  if response.ok?
15
19
  json = JSON.parse(response.body)
16
20
  error_code = json["error_no"]
@@ -5,18 +5,20 @@ module Pod
5
5
  class Components_api
6
6
  include Concurrent::Async
7
7
 
8
- COMPONENTS_URL = 'http://mars-mpaas.bytedance.net/mpaas/baseline/baseline_config'.freeze
8
+ COMPONENTS_URL = 'https://poc-api.vemarsdev.com/mpaas/baseline/baseline_config'.freeze
9
9
 
10
10
  attr_reader :source
11
11
  attr_reader :baseline
12
12
  attr_reader :component_list
13
13
  attr_reader :baseline_api
14
+ attr_reader :components_url
14
15
 
15
- public def initialize(baseline=nil)
16
+ public def initialize(baseline=nil,url=COMPONENTS_URL)
16
17
  @baseline = baseline
17
18
  @source = ""
18
19
  @component_list = []
19
- @baseline_api = Baselines_api.new()
20
+ @baseline_api = Baselines_api.new(url)
21
+ @components_url = (url.blank? ? COMPONENTS_URL : url + "mpaas/baseline/baseline_config")
20
22
  end
21
23
 
22
24
  public def validate!
@@ -36,7 +38,7 @@ module Pod
36
38
  public def getComponents(baseline=@baseline)
37
39
  body= "{\"baseline_version\": \"#{baseline}\", \"technology_stack\": \"iOS\"}"
38
40
  header = {"ContentType" => 'application/json'}
39
- response = REST.post(COMPONENTS_URL, body, header)
41
+ response = REST.post(@components_url, body, header)
40
42
  deserilise(response)
41
43
  return component_list
42
44
  end
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.2
4
+ version: 0.0.6
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-07-21 00:00:00.000000000 Z
11
+ date: 2021-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler