Sha256: 655d06eda27a1fc522e9984a4528a7969567d9dbf0ad9c1a70ed1b613ddefaf3

Contents?: true

Size: 1.03 KB

Versions: 6

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

module GoNative
  module Plugins
    module IOS
      class Publish
        extend DSL::Serviceable
        include Release
        
        def call
          assert_valid_plugin!
          assert_staging_clear!
          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 assert_staging_clear!
          return if `git status --porcelain`.empty?

          raise Error, "There are uncommitted changes in the repository"
        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
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gonative-cli-0.5.0 lib/gonative/plugins/ios/publish.rb
gonative-cli-0.4.5 lib/gonative/plugins/ios/publish.rb
gonative-cli-0.4.4 lib/gonative/plugins/ios/publish.rb
gonative-cli-0.4.3 lib/gonative/plugins/ios/publish.rb
gonative-cli-0.4.2 lib/gonative/plugins/ios/publish.rb
gonative-cli-0.4.1 lib/gonative/plugins/ios/publish.rb