Sha256: 24c1e28471e96f4855888dd17b03c514f7ee97703c3646a7cfd06cc8be34d1ba

Contents?: true

Size: 1004 Bytes

Versions: 7

Compression:

Stored size: 1004 Bytes

Contents

# encoding: UTF-8

module Tetra
  # tetra generate-spec
  class GenerateSpecSubcommand < Tetra::Subcommand
    option %w(-f --filter), "FILTER", "filter files to be installed by this spec", default: "*.jar"
    parameter "[POM]", "a pom file path", default: "pom.xml"

    def execute
      checking_exceptions do
        project = Tetra::Project.new(".")
        ensure_dry_running(:has_finished, project) do
          patches = project.write_source_patches
          package = Tetra::Package.new(project, pom, filter, patches)

          patches.each do |patch|
            print_generation_result(project, patch)
          end

          result_path, conflict_count = package.to_spec
          print_generation_result(project, result_path, conflict_count)
          puts "Warning: #{pom} not found, some spec fields will be left blank" unless File.file?(pom)
          puts "Warning: source archive not found, package will not build" unless project.src_archive
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tetra-2.0.6 lib/tetra/ui/generate_spec_subcommand.rb
tetra-2.0.5 lib/tetra/ui/generate_spec_subcommand.rb
tetra-2.0.4 lib/tetra/ui/generate_spec_subcommand.rb
tetra-2.0.3 lib/tetra/ui/generate_spec_subcommand.rb
tetra-2.0.2 lib/tetra/ui/generate_spec_subcommand.rb
tetra-2.0.1 lib/tetra/ui/generate_spec_subcommand.rb
tetra-2.0.0 lib/tetra/ui/generate_spec_subcommand.rb