albacore 2.3.11 → 2.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5477545e0039f685becc960210d322ca80f7533
4
- data.tar.gz: b84c0d215e55a4186da09026a78864c2c3ced25a
3
+ metadata.gz: 5997bbefeb06940d95cf2b0adfef17499c71c508
4
+ data.tar.gz: 5a116af92e4f1f384a4fc00e7c7dd4de2810bff2
5
5
  SHA512:
6
- metadata.gz: e2a7b9b32e5e1c3dfe12fc624245e325871b26f5d0231387db4d08d97651bb1c64a0875409555dcff861950553ce8492d206064fcd2e6e650a8fd87776ca1275
7
- data.tar.gz: a80530c23639b263f1a5ec5e0257e12492305bd6d55275439a2cb4668d350fe1bef058707ec1b6bd48a46cc0d6f759b578aaad80ccbacf68a9d2d815adad5409
6
+ metadata.gz: 76e6485c3f669a03ae66f796f5195855ada0debea68fa20f2f7250fb44d02c8535cf9f9bf2db0f390ec0f1cffae53bdff4a17ae63d01f55aba980101951a176c
7
+ data.tar.gz: b0723983f09cb341db767661093ad5557a2e49737c0c417e406281034ee059687d8b9459a8a2dda1b72acbad01e81a82fda5fc619fc0ec1e8f3269ba0ee85e98
@@ -1,3 +1,4 @@
1
+ require 'albacore/tools'
1
2
  require 'albacore/app_spec'
2
3
  require 'albacore/errors/invalid_app_spec_error'
3
4
  require 'map'
@@ -66,18 +67,6 @@ module Albacore
66
67
  end
67
68
  end
68
69
 
69
- def git_release_notes
70
- tags = `git tag`.split(/\n/).
71
- map { |tag| [ ::XSemVer::SemVer.parse_rubygems(tag), tag ] }.
72
- sort { |a, b| a <=> b }.
73
- map { |_, tag| tag }
74
- last_tag = tags[-1]
75
- second_last_tag = tags[-2] || `git rev-list --max-parents=0 HEAD`
76
- logs = `git log --pretty=format:%s #{second_last_tag}..`.split(/\n/)
77
- "Release Notes for #{last_tag}:
78
- #{logs.inject('') { |state, line| state + "\n * #{line}" }}"
79
- end
80
-
81
70
  def create_nuspec app_spec
82
71
  require 'albacore/nuget_model'
83
72
  p = Albacore::NugetModel::Package.new
@@ -88,7 +77,7 @@ module Albacore
88
77
  m.authors = app_spec.authors
89
78
  m.owners = app_spec.owners
90
79
  m.description = app_spec.description || app_spec.title_raw
91
- m.release_notes = app_spec.release_notes || git_release_notes
80
+ m.release_notes = app_spec.release_notes || Albacore::Tools.git_release_notes
92
81
  m.summary = app_spec.summary
93
82
  m.language = app_spec.language
94
83
  m.project_url = app_spec.project_url || 'https://haf.se'
@@ -4,6 +4,7 @@ require 'map'
4
4
  require 'albacore/logging'
5
5
  require 'albacore/project'
6
6
  require 'albacore/paths'
7
+ require 'albacore/tools'
7
8
 
8
9
  module Albacore
9
10
  module NugetModel
@@ -357,6 +358,7 @@ end})
357
358
  package.metadata.title = proj.name if proj.name
358
359
  package.metadata.version = version if version
359
360
  package.metadata.authors = proj.authors if proj.authors
361
+ package.metadata.release_notes = Albacore::Tools.git_release_notes
360
362
 
361
363
  if opts.get :nuget_dependencies
362
364
  trace "adding nuget dependencies for id #{proj.id}"
@@ -418,13 +420,13 @@ end})
418
420
 
419
421
  package
420
422
  end
423
+
421
424
  def self.get_output_path proj, opts
422
425
  try = proj.try_output_path(opts.get(:configuration))
423
426
  return try if try
424
427
  warn 'using fallback output path'
425
428
  proj.fallback_output_path
426
429
  end
427
-
428
430
  end
429
431
  end
430
432
  end
@@ -1,4 +1,17 @@
1
1
  require 'albacore'
2
+ require 'xsemver'
2
3
 
3
4
  module Albacore::Tools
5
+ # Try to get the release notes from git, but looking at the commit messages
6
+ def self.git_release_notes
7
+ tags = `git tag`.split(/\n/).
8
+ map { |tag| [ ::XSemVer::SemVer.parse_rubygems(tag), tag ] }.
9
+ sort { |a, b| a <=> b }.
10
+ map { |_, tag| tag }
11
+ last_tag = tags[-1]
12
+ second_last_tag = tags[-2] || `git rev-list --max-parents=0 HEAD`
13
+ logs = `git log --pretty=format:%s #{second_last_tag}..`.split(/\n/)
14
+ "Release Notes for #{last_tag}:
15
+ #{logs.inject('') { |state, line| state + "\n * #{line}" }}"
16
+ end
4
17
  end
@@ -1,3 +1,3 @@
1
1
  module Albacore
2
- VERSION = "2.3.11"
2
+ VERSION = "2.3.12"
3
3
  end
@@ -0,0 +1,11 @@
1
+ require 'albacore/tools'
2
+
3
+ describe 'when calling Tools#git_release_notes' do
4
+ subject do
5
+ Albacore::Tools.git_release_notes
6
+ end
7
+ it 'should start with "Release Notes"...' do
8
+ expect(subject).to match /Release Notes for /
9
+ end
10
+ end
11
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: albacore
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.11
4
+ version: 2.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrik Feldt
@@ -380,6 +380,7 @@ files:
380
380
  - spec/testdata/example.nuspec
381
381
  - spec/testdata/example.symbols.nuspec
382
382
  - spec/tools/fluent_migrator_spec.rb
383
+ - spec/tools_spec.rb
383
384
  - spec/utils_spec.rb
384
385
  homepage: http://albacorebuild.net
385
386
  licenses:
@@ -616,4 +617,5 @@ test_files:
616
617
  - spec/testdata/example.nuspec
617
618
  - spec/testdata/example.symbols.nuspec
618
619
  - spec/tools/fluent_migrator_spec.rb
620
+ - spec/tools_spec.rb
619
621
  - spec/utils_spec.rb