Class: Albacore::NugetsPack::Config
- Inherits:
-
Object
- Object
- Albacore::NugetsPack::Config
- Extended by:
- ConfigDSL
- Includes:
- CmdConfig
- Defined in:
- lib/albacore/task_types/nugets_pack.rb
Overview
This tasktype allows you to quickly package project files to nuget packages.
Point files to the project files, that should be in MsBuild XML.
Examples
nugets_pack :pack => ['build/pkg', :versioning] do |p|
p.files = FileList['src/**/*.csproj']
p.out = 'build/pkg'
p.exe = 'buildsupport/NuGet.exe'
p. do |m|
m.version = ENV['NUGET_VERSION']
end
p.gen_symbols
p.no_project_dependencies
end
Instance Attribute Summary collapse
-
#configuration ⇒ Object
writeonly
sets the MsBuild configuration that is used to produce the output into <OutputPath>…</OutputPath>.
-
#files ⇒ Object
writeonly
sets the files to search.
-
#target ⇒ Object
writeonly
the .net target (e.g. net40, mono20, mono3, etc).
Instance Method Summary collapse
-
#gen_symbols ⇒ Object
generate symbols for the nugets: just call this method to enable generation.
-
#initialize ⇒ Config
constructor
A new instance of Config.
-
#leave_nuspec ⇒ Object
leave the nuspec behind, don’t delete it after generating it.
-
#no_nuget_dependencies ⇒ Object
call this if you want to cancel inclusion of package dependencies when creating the nuspec file.
-
#no_project_dependencies ⇒ Object
call this if you want to cancel ‘smart’ scanning of the *proj file for its dependencies.
- #nuget_gem_exe ⇒ Object
-
#opts ⇒ Object
gets the options specified for the task, used from the task.
- #with_metadata {|@package.metadata| ... } ⇒ Object
-
#with_package {|@package| ... } ⇒ Object
configure the package with a block.
Methods included from ConfigDSL
Methods included from CmdConfig
Methods included from Logging
#debug, #err, #error, #fatal, #info, #puts, #trace, #warn
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
145 146 147 148 149 150 151 152 153 |
# File 'lib/albacore/task_types/nugets_pack.rb', line 145 def initialize @package = Albacore::NugetModel::Package.new @target = 'net40' @symbols = false @project_dependencies = true @nuget_dependencies = true @leave_nuspec = false fill_required end |
Instance Attribute Details
#configuration=(value) ⇒ Object (writeonly)
sets the MsBuild configuration that is used to produce the output into <OutputPath>…</OutputPath>
143 144 145 |
# File 'lib/albacore/task_types/nugets_pack.rb', line 143 def configuration=(value) @configuration = value end |
#files=(value) ⇒ Object (writeonly)
sets the files to search
139 140 141 |
# File 'lib/albacore/task_types/nugets_pack.rb', line 139 def files=(value) @files = value end |
#target=(value) ⇒ Object (writeonly)
the .net target (e.g. net40, mono20, mono3, etc)
136 137 138 |
# File 'lib/albacore/task_types/nugets_pack.rb', line 136 def target=(value) @target = value end |
Instance Method Details
#gen_symbols ⇒ Object
generate symbols for the nugets: just call this method to enable generation
166 167 168 |
# File 'lib/albacore/task_types/nugets_pack.rb', line 166 def gen_symbols @symbols = true end |
#leave_nuspec ⇒ Object
leave the nuspec behind, don’t delete it after generating it
172 173 174 |
# File 'lib/albacore/task_types/nugets_pack.rb', line 172 def leave_nuspec @leave_nuspec = true end |
#no_nuget_dependencies ⇒ Object
call this if you want to cancel inclusion of package dependencies when creating the nuspec file
184 185 186 |
# File 'lib/albacore/task_types/nugets_pack.rb', line 184 def no_nuget_dependencies @nuget_dependencies = false end |
#no_project_dependencies ⇒ Object
call this if you want to cancel ‘smart’ scanning of the *proj file for its dependencies
178 179 180 |
# File 'lib/albacore/task_types/nugets_pack.rb', line 178 def no_project_dependencies @project_dependencies = false end |
#nuget_gem_exe ⇒ Object
188 189 190 |
# File 'lib/albacore/task_types/nugets_pack.rb', line 188 def nuget_gem_exe @exe = Albacore::Nugets::find_nuget_gem_exe end |
#opts ⇒ Object
gets the options specified for the task, used from the task
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/albacore/task_types/nugets_pack.rb', line 193 def opts files = @files.respond_to?(:each) ? @files : [@files] [:authors, :description, :version].each do |required| warn "metadata##{required} is missing from nugets_pack [nugets pack: config]" if @package..send(required) == 'MISSING' end Map.new({ :out => @out, :exe => @exe, :symbols => @symbols, :package => @package, :target => @target, :files => @files, :configuration => @configuration, :project_dependencies => @project_dependencies, :nuget_dependencies => @nuget_dependencies, :original_path => FileUtils.pwd, :leave_nuspec => @leave_nuspec }) end |
#with_metadata {|@package.metadata| ... } ⇒ Object
155 156 157 |
# File 'lib/albacore/task_types/nugets_pack.rb', line 155 def &block yield @package. end |
#with_package {|@package| ... } ⇒ Object
configure the package with a block
160 161 162 |
# File 'lib/albacore/task_types/nugets_pack.rb', line 160 def with_package &block yield @package end |