cocoapods-vemars 0.0.1 → 0.0.5

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: ff9c218d2c9f7720be1248b8f4d9b896071e33216c868ee0d1227289aa0e2a56
4
- data.tar.gz: fc57f96aad044460b0ad1a93a138c08953ffe0d0596e414547f866347e624b71
3
+ metadata.gz: 7b7bdedf40d7340147bc0587f4fa986e751273655edaa17cb21e8d9314c9d8a9
4
+ data.tar.gz: 43d084a4ccee5fc343af7d4f5e44a7d4c91c63d26cd68e3c4a0fb10e2c49dd7d
5
5
  SHA512:
6
- metadata.gz: cb803fc8dcfb78ffc745ea88390ccdcf752f6b1f858996e09d6778fff1b584155eb3009f38709c5fd0c112d080d4c98f5fb23669312e04f97fc85f3222da0931
7
- data.tar.gz: f0a2b8976e20882da7ba5c3aedaaaf6432eed629c94978cd910afd70cb1ed632fa9070b101e535bf516a51df7a4def428ff5564b9b32d178328fe7fd50beb4c5
6
+ metadata.gz: aa023e879ca0e000beec163259c02123a63202e58df4381d9f35ce079c7f35064e48a93f4a4a2f94ea4631641259418d6cf8bcebe7dfa4d3158ed3f7facc85dd
7
+ data.tar.gz: cb8a73dba5d8fd82f2dcfb672cae9f59bfef124bb2e2ad8b7d2f80d84d23c7dd080b62febef86ff9df1bdc3bcf80d5a0ceadacf7e331d0f2e7e7753d21e6d60f
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.4)
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,8 @@ 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.']
26
27
  ]
27
28
  options.concat(super.reject { |option, _| option == '--silent' })
28
29
  end
@@ -37,7 +38,8 @@ module Pod
37
38
  @bundle_id = argv.option('bundle_id', nil)
38
39
  @selected_components = argv.option('com', "").split(',')
39
40
  @config_json = argv.option('config', '/onekit-config.json')
40
- @project = VemarsProject.new(@appkey, @selected_components, @config_json, @version, @bundle_id, @name, @language, git_url)
41
+ service_url = argv.option('service_url',nil)
42
+ @project = VemarsProject.new(@appkey, @selected_components, @config_json, @version, @bundle_id, @name, @language, git_url,@service_url)
41
43
  super
42
44
  @additional_args = argv.remainder!
43
45
  end
@@ -77,8 +79,9 @@ module Pod
77
79
  end
78
80
 
79
81
  Dir.chdir(project_dir) do
80
- system('bundle install')
81
- system('bundle exec pod install --repo-update')
82
+ # system('bundle install')
83
+ # system('bundle exec pod install --repo-update')
84
+ system('pod install --repo-update')
82
85
  end
83
86
  end
84
87
 
@@ -20,7 +20,8 @@ module Pod
20
20
  ['--path=PODFILE_PATH', 'the /path/to/Dir_contains_Podfile'],
21
21
  ['--com=COM1,COM2', 'Selected components in vemars.'],
22
22
  ['--silent', 'do not run pod install'],
23
- ['--config=CONFIG_PATH', 'config path of vemars.']
23
+ ['--config=CONFIG_PATH', 'config path of vemars.'],
24
+ ['--service_url=SERVICE_URL', 'url of vemars CLI service.']
24
25
  ]
25
26
  options.concat(super.reject { |option, _| option == '--silent' })
26
27
  end
@@ -33,7 +34,8 @@ module Pod
33
34
  super
34
35
  @additional_args = argv.remainder!
35
36
  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
+ service_url = argv.option('service_url',nil)
38
+ @project = VemarsProject.new(@appkey, @selected_components, @config_json, @baseline, git_url, service_url)
37
39
  end
38
40
 
39
41
  def validate!
@@ -63,8 +65,9 @@ module Pod
63
65
  end
64
66
 
65
67
  Dir.chdir(project_dir) do
66
- system('bundle install')
67
- system('bundle exec pod install --repo-update')
68
+ # system('bundle install')
69
+ # system('bundle exec pod install --repo-update')
70
+ system('pod install --repo-update')
68
71
  end
69
72
  end
70
73
 
@@ -1,3 +1,3 @@
1
1
  module CocoapodsVemars
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.5"
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.byted.org/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.byted.org/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.1
4
+ version: 0.0.5
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-19 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