root / Rakefile @ 647b2d5c
Historique | Voir | Annoter | Télécharger (2,36 ko)
1 |
# Managed by modulesync - DO NOT EDIT
|
---|---|
2 |
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
|
3 |
|
4 |
# Attempt to load voxpupuli-test (which pulls in puppetlabs_spec_helper),
|
5 |
# otherwise attempt to load it directly.
|
6 |
begin
|
7 |
require 'voxpupuli/test/rake'
|
8 |
rescue LoadError |
9 |
begin
|
10 |
require 'puppetlabs_spec_helper/rake_tasks'
|
11 |
rescue LoadError |
12 |
end
|
13 |
end
|
14 |
|
15 |
# load optional tasks for acceptance
|
16 |
# only available if gem group releases is installed
|
17 |
begin
|
18 |
require 'voxpupuli/acceptance/rake'
|
19 |
rescue LoadError |
20 |
end
|
21 |
|
22 |
# load optional tasks for releases
|
23 |
# only available if gem group releases is installed
|
24 |
begin
|
25 |
require 'voxpupuli/release/rake_tasks'
|
26 |
rescue LoadError |
27 |
end
|
28 |
|
29 |
desc "Run main 'test' task and report merged results to coveralls"
|
30 |
task test_with_coveralls: [:test] do |
31 |
if Dir.exist?(File.expand_path('../lib', __FILE__)) |
32 |
require 'coveralls/rake/task'
|
33 |
Coveralls::RakeTask.new |
34 |
Rake::Task['coveralls:push'].invoke |
35 |
else
|
36 |
puts 'Skipping reporting to coveralls. Module has no lib dir'
|
37 |
end
|
38 |
end
|
39 |
|
40 |
desc 'Generate REFERENCE.md'
|
41 |
task :reference, [:debug, :backtrace] do |t, args| |
42 |
patterns = ''
|
43 |
Rake::Task['strings:generate:reference'].invoke(patterns, args[:debug], args[:backtrace]) |
44 |
end
|
45 |
|
46 |
begin
|
47 |
require 'github_changelog_generator/task'
|
48 |
require 'puppet_blacksmith'
|
49 |
GitHubChangelogGenerator::RakeTask.new :changelog do |config| |
50 |
metadata = Blacksmith::Modulefile.new |
51 |
config.future_release = "v#{metadata.version}" if metadata.version =~ /^\d+\.\d+.\d+$/ |
52 |
config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file.\nEach new release typically also includes the latest modulesync defaults.\nThese should not affect the functionality of the module."
|
53 |
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog}
|
54 |
config.user = 'voxpupuli'
|
55 |
config.project = 'puppet-nftables'
|
56 |
end
|
57 |
|
58 |
# Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715
|
59 |
require 'rbconfig'
|
60 |
if RbConfig::CONFIG['host_os'] =~ /linux/ |
61 |
task :changelog do |
62 |
puts 'Fixing line endings...'
|
63 |
changelog_file = File.join(__dir__, 'CHANGELOG.md') |
64 |
changelog_txt = File.read(changelog_file)
|
65 |
new_contents = changelog_txt.gsub(%r{\r\n}, "\n") |
66 |
File.open(changelog_file, "w") {|file| file.puts new_contents } |
67 |
end
|
68 |
end
|
69 |
|
70 |
rescue LoadError |
71 |
end
|
72 |
# vim: syntax=ruby
|