cocoapods-vemars 0.0.4 → 0.0.8
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 +1 -1
- data/Gemfile.lock +2 -4
- data/lib/cocoapods-vemars/command/project.rb +5 -3
- data/lib/cocoapods-vemars/command/vemars/baselines.rb +13 -1
- data/lib/cocoapods-vemars/command/vemars/components.rb +8 -1
- data/lib/cocoapods-vemars/command/vemars/create.rb +13 -3
- data/lib/cocoapods-vemars/command/vemars/patch.rb +14 -5
- data/lib/cocoapods-vemars/gem_version.rb +1 -1
- data/lib/cocoapods-vemars/services/baselines_api.rb +6 -2
- data/lib/cocoapods-vemars/services/components_api.rb +6 -4
- 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: 30550c108fbd5a78c3700c13e93afac49018e01bdb1905c7d173b0c70c7a3b7b
         | 
| 4 | 
            +
              data.tar.gz: d4903f6342f6a8e0b1a7b7ca632ca0595165d948137e05a84e009101b25fd03f
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: d8f4de048cf85455d281aead71f02a32a032709963dc793bba8aa410425fe29f866ad83c73973f3f6b32ae8558e07b2990b894a6eac62baa9c61d6daaa395f48
         | 
| 7 | 
            +
              data.tar.gz: e1f51022de625322340b8bf1b6283c9152b61832358fb8d445458f6bf1f34ee8f1abd80dc8a70dd09f96bba4b8b41c97fc05d03f75b10cff26d94178185b1a7e
         | 
    
        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.1)
         | 
| 5 5 |  | 
| 6 6 | 
             
            GEM
         | 
| 7 7 | 
             
              remote: https://rubygems.org/
         | 
| @@ -106,12 +106,10 @@ DEPENDENCIES | |
| 106 106 | 
             
              cocoapods-vemars!
         | 
| 107 107 | 
             
              concurrent-ruby
         | 
| 108 108 | 
             
              debase (= 0.2.5.beta2)
         | 
| 109 | 
            -
              json
         | 
| 110 109 | 
             
              plist (~> 3.2)
         | 
| 111 110 | 
             
              rake
         | 
| 112 111 | 
             
              rexml
         | 
| 113 112 | 
             
              ruby-debug-ide
         | 
| 114 | 
            -
              xcodeproj
         | 
| 115 113 |  | 
| 116 114 | 
             
            BUNDLED WITH
         | 
| 117 | 
            -
               2.2. | 
| 115 | 
            +
               2.2.15
         | 
| @@ -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 | 
            -
            require 'json'
         | 
| 6 | 
            +
            require 'json/pure'
         | 
| 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|
         | 
| @@ -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 | 
            -
                       | 
| 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
         | 
| @@ -33,11 +36,13 @@ module Pod | |
| 33 36 | 
             
                      @language = argv.option('language', 'objc')
         | 
| 34 37 | 
             
                      git_url = argv.option('git', 'git@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 | 
            -
                       | 
| 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
         | 
| @@ -79,7 +84,12 @@ module Pod | |
| 79 84 | 
             
                      Dir.chdir(project_dir) do
         | 
| 80 85 | 
             
                        # system('bundle install')
         | 
| 81 86 | 
             
                        # system('bundle exec pod install --repo-update')
         | 
| 82 | 
            -
                         | 
| 87 | 
            +
                        if @repo_no_update
         | 
| 88 | 
            +
                          puts "pod install with no repo update"
         | 
| 89 | 
            +
                          system('pod install --no-repo-update')
         | 
| 90 | 
            +
                        else
         | 
| 91 | 
            +
                          system('pod install --repo-update')
         | 
| 92 | 
            +
                        end
         | 
| 83 93 | 
             
                      end
         | 
| 84 94 | 
             
                    end
         | 
| 85 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 | 
            -
                        ['-- | 
| 23 | 
            -
                        ['-- | 
| 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!
         | 
| @@ -65,7 +69,12 @@ module Pod | |
| 65 69 | 
             
                      Dir.chdir(project_dir) do
         | 
| 66 70 | 
             
                        # system('bundle install')
         | 
| 67 71 | 
             
                        # system('bundle exec pod install --repo-update')
         | 
| 68 | 
            -
                         | 
| 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
         | 
| 69 78 | 
             
                      end
         | 
| 70 79 | 
             
                    end
         | 
| 71 80 |  | 
| @@ -4,13 +4,17 @@ module Pod | |
| 4 4 | 
             
              class Baselines_api
         | 
| 5 5 | 
             
                include Concurrent::Async
         | 
| 6 6 |  | 
| 7 | 
            -
                BASELINES_URL = ' | 
| 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( | 
| 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 = ' | 
| 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( | 
| 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. | 
| 4 | 
            +
              version: 0.0.8
         | 
| 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- | 
| 11 | 
            +
            date: 2021-08-24 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         |