Sha256: 82129564fb17d428c7ccecaae7c606ddc57c1075cc5a457d955735d96e7b9b0f

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

require "albacore/albacoretask"
require "albacore/config/nugetupdateconfig"

class NuGetUpdate
  TaskName = :nugetupdate

  include Albacore::Task
  include Albacore::RunCommand
  include Configuration::NuGetUpdate
  
  attr_reader   :safe
  
  attr_accessor :input_file,
                :repository_path
  
  attr_array    :source,
                :id

  def initialize()
    @command = "nuget"
    
    super()
    update_attributes(nugetupdate.to_hash)
  end

  def execute
    unless @input_file
      fail_with_message("nugetupdate requires #input_file")
      return
    end
    
    result = run_command("nugetupdate", build_parameters)
    fail_with_message("NuGet Update failed, see the build log for more details.") unless result
  end
  
  def build_parameters
    p = []
    p << "update"
    p << "\"#{@input_file}\""
    p << "-Source \"#{@source.join(";")}\"" if @source
    p << "-Id \"#{@id.join(";")}\"" if @id
    p << "-RepositoryPath #{@repository_path}" if @repository_path
    p << "-Safe" if @safe
    p
  end
  
  def safe
    @safe = true
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
albacore-1.0.0 lib/albacore/nugetupdate.rb
albacore-1.0.0.rc.3 lib/albacore/nugetupdate.rb