Class: Albacore::Asmver::MultipleFilesConfig

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/albacore/task_types/asmver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging

#debug, #err, #error, #fatal, #info, #puts, #trace, #warn

Instance Attribute Details

#files=(value) ⇒ Object (writeonly)

list of xxproj files to iterate over



19
20
21
# File 'lib/albacore/task_types/asmver.rb', line 19

def files=(value)
  @files = value
end

Instance Method Details

#attributes(attrs) ⇒ Object



21
22
23
# File 'lib/albacore/task_types/asmver.rb', line 21

def attributes attrs
  @attributes = attrs
end

#configurationsObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/albacore/task_types/asmver.rb', line 31

def configurations
  @files ||= FileList['**/*.{fsproj,csproj,vbproj}']

  debug { "generating config for files: #{@files}" }

  @files.map { |proj|
      proj =~ /(\w\w)proj$/
      [ $1, Project.new(proj) ]
    }.map { |ext, proj|
      attrs = @attributes.clone
      attrs[:assembly_title] = proj.name
      file_path = "#{proj.proj_path_base}/AssemblyVersionInfo.#{ext}"
      cfg = Albacore::Asmver::Config.new file_path, proj.asmname, attrs
      cfg = @handle_config.call(proj, cfg) if @handle_config
      cfg
    }
end

#handle_config(&block) ⇒ Object

block should have signature: Project -> AsmVer::Config -> AsmVer::Config because you can use this block to change the configuration generated



27
28
29
# File 'lib/albacore/task_types/asmver.rb', line 27

def handle_config &block
  @handle_config = block
end