Rakefile
author Mahlon E. Smith <mahlon@laika.com>
Mon, 14 Nov 2016 14:43:41 -0800
changeset 9 47425483883e
parent 0 3cc90e88c6ab
child 10 8388c2d1d7af
permissions -rw-r--r--
Cleanups for gem release.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     1
#!/usr/bin/env rake
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     2
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     3
begin
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     4
	require 'hoe'
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     5
rescue LoadError
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     6
	abort "This Rakefile requires hoe (gem install hoe)"
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     7
end
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     8
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     9
GEMSPEC = 'thingfish-metastore-pggraph.gemspec'
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    10
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    11
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    12
Hoe.plugin :mercurial
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    13
Hoe.plugin :signing
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    14
Hoe.plugin :deveiate
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    15
Hoe.plugin :bundler
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    16
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    17
Hoe.plugins.delete :rubyforge
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    18
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    19
hoespec = Hoe.spec 'thingfish-metastore-pggraph' do |spec|
9
47425483883e Cleanups for gem release.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    20
	spec.readme_file = 'README.md'
47425483883e Cleanups for gem release.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    21
	spec.history_file = 'History.md'
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    22
	spec.extra_rdoc_files = FileList[ '*.rdoc' ]
9
47425483883e Cleanups for gem release.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    23
	spec.license 'BSD-3-Clause'
47425483883e Cleanups for gem release.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    24
	spec.urls = {
47425483883e Cleanups for gem release.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    25
		home: 'https://bitbucket.org/mahlon/thingfish-metastore-pggraph',
47425483883e Cleanups for gem release.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    26
		code: 'https://bitbucket.org/mahlon/thingfish-metastore-pggraph'
47425483883e Cleanups for gem release.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    27
	}
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    28
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    29
	if File.directory?( '.hg' )
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    30
		spec.spec_extras[:rdoc_options] = ['-f', 'fivefish', '-t', 'Thingfish-Metastore-PgGraph']
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    31
	end
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    32
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    33
	spec.developer 'Michael Granger', 'ged@FaerieMUD.org'
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    34
	spec.developer 'Mahlon E. Smith', 'mahlon@martini.nu'
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    35
9
47425483883e Cleanups for gem release.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    36
	spec.dependency 'thingfish', '~> 0.5'
47425483883e Cleanups for gem release.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    37
	spec.dependency 'loggability', '~> 0.11'
47425483883e Cleanups for gem release.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    38
	spec.dependency 'configurability', '~> 2.2'
47425483883e Cleanups for gem release.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    39
	spec.dependency 'sequel', '~> 4.35'
47425483883e Cleanups for gem release.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    40
	spec.dependency 'pg', '~> 0.19'
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    41
9
47425483883e Cleanups for gem release.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    42
	spec.dependency 'hoe-deveiate', '~> 0.8',  :development
47425483883e Cleanups for gem release.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    43
	spec.dependency 'rspec', '~> 3.0', :development
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    44
9
47425483883e Cleanups for gem release.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    45
	spec.require_ruby_version( '>=2.3.0' )
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    46
	spec.hg_sign_tags = true if spec.respond_to?( :hg_sign_tags= )
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    47
end
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    48
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    49
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    50
ENV['VERSION'] ||= hoespec.spec.version.to_s
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    51
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    52
# Run the tests before checking in
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    53
task 'hg:precheckin' => [ :check_history, :check_manifest, :spec ]
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    54
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    55
# Rebuild the ChangeLog immediately before release
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    56
task :prerelease => 'ChangeLog'
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    57
CLOBBER.include( 'ChangeLog' )
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    58
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    59
desc "Build a coverage report"
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    60
task :coverage do
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    61
	ENV["COVERAGE"] = 'yes'
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    62
	Rake::Task[:spec].invoke
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    63
end
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    64
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    65
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    66
task :gemspec => GEMSPEC
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    67
file GEMSPEC => __FILE__ do |task|
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    68
	spec = $hoespec.spec
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    69
	spec.files.delete( '.gemtest' )
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    70
	spec.signing_key = nil
9
47425483883e Cleanups for gem release.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    71
	spec.version = "#{spec.version.bump}.0.pre#{Time.now.strftime("%Y%m%d%H%M%S")}"
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    72
	File.open( task.name, 'w' ) do |fh|
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    73
		fh.write( spec.to_ruby )
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    74
	end
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    75
end
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    76
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    77
task :default => :gemspec
9
47425483883e Cleanups for gem release.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    78
CLOBBER.include( GEMSPEC.to_s )
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    79