Sha256: 23973ada94af93608ce4faa89ec4e37b836d393c20ab0cd41797d33540ca1b80

Contents?: true

Size: 1.35 KB

Versions: 5

Compression:

Stored size: 1.35 KB

Contents

require 'thor'
require 'fileutils'
require 'fwtoolkit/config'
require 'fwtoolkit/projectfile'
require 'fwtoolkit/cli/fw_actions'
require 'fwtoolkit/cli/thorutils'

module FWToolkit
    class Bitrise < Thor
      include Thor::Actions
      include FWToolkit::ThorUtils

      source_root_templates!

      desc 'genereate [PROJECT NAME] [CLASS PREFIX]', "Create a new bitrise.yml file for the project, based on a blank file"
      def generate(project_name, class_prefix)
        destination_root = Dir.pwd

        say "Creating bitrise.yml file in: #{File.expand_path destination_root}/bitrise.yml"

        invoke FWToolkit::Bitrise, 'new', [destination_root, project_name, class_prefix.upcase]
      end

      desc 'new', 'Creates a new bitrise YML configuration file'
      def new(project_root, project_name, class_prefix)
        destination_root = project_root
        bitrise_file = File.join(project_root, 'bitrise.yml')

        Projectfile.load_with_config! :project_name => project_name, :class_prefix => class_prefix.upcase

        template_config = { :target_platform => Config.target_platform,
            :organization_name => Config.organization_name,
            :project_creator => Config.developer_name } 
        template_config.merge! Projectfile.config 

        template_directory "templates/bitrise", destination_root, template_config
      end

    end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fwtoolkit-2.2.4 lib/fwtoolkit/cli/bitrise.rb
fwtoolkit-2.2.3 lib/fwtoolkit/cli/bitrise.rb
fwtoolkit-2.2.2 lib/fwtoolkit/cli/bitrise.rb
fwtoolkit-2.2.1 lib/fwtoolkit/cli/bitrise.rb
fwtoolkit-2.2.0 lib/fwtoolkit/cli/bitrise.rb