Class: Albacore::Tasks::Release
- Inherits:
-
Object
- Object
- Albacore::Tasks::Release
- Includes:
- DSL, Rake::DSL
- Defined in:
- lib/albacore/tasks/release.rb
Overview
Inspiration from: github.com/bundler/bundler/blob/master/lib/bundler/gem_helper.rb
Constant Summary
Constants included from CrossPlatformCmd
CrossPlatformCmd::KILL_TIMEOUT
Instance Attribute Summary
Attributes included from CrossPlatformCmd
Instance Method Summary collapse
-
#initialize(name = :release, opts = {}) ⇒ Release
constructor
A new instance of Release.
-
#install ⇒ Object
Installs the rake tasks under the ‘release’ namespace with a named task (given as the first parameter to the c’tor) that calls all subtasks.
Methods included from CrossPlatformCmd
#chdir, #make_command, #normalise_slashes, #sh, #shie, #stop, #system, #which
Methods included from Logging
#debug, #err, #error, #fatal, #info, #puts, #trace, #warn
Constructor Details
#initialize(name = :release, opts = {}) ⇒ Release
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/albacore/tasks/release.rb', line 36 def initialize name = :release, opts = {} @name = name @opts = Map.new(opts).apply \ pkg_dir: 'build/pkg', nuget_exe: 'tools/NuGet.exe', nuget_source: 'https://www.nuget.org/api/v2/package', clr_command: true, depend_on: :versioning, semver: nil semver = @opts.get :semver unless semver ::Albacore.subscribe :build_version do |data| @semver = data.semver end else @semver = semver end install end |
Instance Method Details
#install ⇒ Object
Installs the rake tasks under the ‘release’ namespace with a named task (given as the first parameter to the c’tor) that calls all subtasks.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/albacore/tasks/release.rb', line 61 def install namespace :release do task :guard_clean => @opts.get(:depend_on) do guard_clean end task :guard_pkg => @opts.get(:depend_on) do guard_pkg end task :scm_write => @opts.get(:depend_on) do tag_version { git_push } unless already_tagged? end task :nuget_push => @opts.get(:depend_on) do packages.each do |package| nuget_push package end end end desc 'release current package(s)' task @name => [:'release:guard_clean', :'release:guard_pkg', :'release:scm_write', :'release:nuget_push'] end |