Sha256: 596f97c988253d85b5850e71a36349442ffbbd32bff3b94c627503df57646a1e

Contents?: true

Size: 833 Bytes

Versions: 1

Compression:

Stored size: 833 Bytes

Contents

require 'rake/tasklib'

module Rake::Funnel::Tasks
  class AssemblyVersion < Rake::TaskLib
    include Rake::Funnel::Support

    attr_accessor :name, :language, :source, :source_args, :target_path

    def initialize(name = :version)
      @name = name
      @language = :cs
      @source = :FromVersionFiles
      @source_args = {}
      @target_path = next_to_version_file

      yield self if block_given?
      define
    end

    private
    def define
      desc 'Generate version info'
      task name do
        writer = AssemblyVersionWriter.new(source, source_args)

        writer.write(target_path, language)
      end
    end

    def next_to_version_file
      Proc.new { |language, version_info, source| File.join(File.dirname(source), "VersionInfo.#{language}") }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rake-funnel-0.1.0.pre lib/rake/funnel/tasks/assembly_version.rb