-
Notifications
You must be signed in to change notification settings - Fork 3
/
Rakefile
46 lines (37 loc) · 1.11 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require 'rake/testtask'
require 'rake/extensiontask'
require 'rake/clean'
require 'sdoc'
NAME = "polarssl"
DLEXT = RbConfig::CONFIG['DLEXT']
CLEAN.include("ext/**/*{.o,.log,.#{DLEXT}}")
CLEAN.include("ext/**/Makefile")
CLEAN.include("doc")
CLOBBER.include("lib/**/*.#{DLEXT}")
Rake::TestTask.new do |t|
t.pattern = "test/*_test.rb"
t.libs << 'test'
end
task test: :compile
RDOC_FILES = FileList["RDOC_MAIN.rdoc", "lib/**/*.rb", "ext/polarssl/polarssl.c", "ext/polarssl/*.c"]
RDoc::Task.new do |rd|
rd.rdoc_dir = "doc"
rd.main = "RDOC_MAIN.rdoc"
rd.title = "PolarSSL Ruby API"
rd.rdoc_files.include(RDOC_FILES)
rd.options << '-e' << 'UTF-8'
rd.options << '-f' << 'sdoc'
rd.options << '-T' << 'sdoc'
end
Rake::ExtensionTask.new "polarssl" do |ext|
ext.lib_dir = "lib/polarssl"
end
desc "Signs the gem"
task :sign_gem do
require 'digest/sha2'
built_gem_path = "polarssl-#{ENV["VERSION"]}.gem"
checksum = Digest::SHA512.new.hexdigest(File.read(built_gem_path))
checksum_path = "checksum/polarssl-#{ENV["VERSION"]}.gem.sha512"
File.open(checksum_path, 'w' ) {|f| f.write(checksum) }
end
task default: :test