Sha256: 6611773e70f8e4dbcaf5bc5826e165f55c1197649c5b2dc4af57e0eedd25d216

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

module GoNative
  module Plugins
    module IOS
      class Publish
        autoload :FileUtils, 'fileutils'
        
        extend DSL::Serviceable


        def call
          assert_valid_plugin!
          build_framework!
          release_pod!
        end

        def assert_valid_plugin!
          return if File.file?('create-framework.sh')
          
          raise Error, "File 'create-framework.sh' does not exist. Please make sure this is a valid GoNative plugin directory"
        end
        
        def build_framework!
          Utils::UI.info 'Building framework'
          return if system('sh create-framework.sh >/dev/null 2>/dev/null')
          
          raise Error, "Error building framework. Please run the create-framework file manually to fix any errors"
        end
        
        def release_pod!
          Utils::UI.info 'Linting and releasing pod'
          return if system('pod release')

          raise Error, "Failed to release pod"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gonative-cli-0.3.1 lib/gonative/plugins/ios/publish.rb