forked from jeffrafter/win32-serial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
45 lines (39 loc) · 1.51 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
require 'rake'
begin
require 'jeweler'
Jeweler::Tasks.new do |s|
s.name = "win32-serial"
s.summary = "Ruby library for Windows API serial port communication based on http://grub.ath.cx/win32serial/"
s.description = "Ruby library for Windows API serial port communication based on http://grub.ath.cx/win32serial/"
s.email = "[email protected], [email protected]"
s.homepage = "http://grub.ath.cx/win32serial/"
s.authors = ["Travis Whitton", "Jeff Rafter"]
s.files = FileList["[A-Z]*","{doc,examples,lib}/**/*", "ext/**/*.c", "ext/**/*.h"]
s.extensions << "ext/extconf.rb"
s.require_paths = ["lib", "ext"]
end
rescue LoadError
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
end
namespace :windows do
desc "Make and package the windows version of compiled libraries"
task :make do
`cd ext && ruby -I . extconf.rb`
`cd ext && make`
end
desc "Clean out the compiled libraries"
task :clean do
`cd ext && make clean`
end
desc "Generate a gemspec for a Windows binary distribution"
task :gemspec do
ext = "SPEC.platform = ::Gem::Platform.new('i386-mswin32_60'); SPEC.extensions = []; SPEC.files += ['ext/Win32Serial.so']"
`cp win32-serial.gemspec win32-serial.gemspec.windows`
`echo "#{ext}" >> win32-serial.gemspec.windows`
end
desc "Package the Windows gem as a binary release"
task :release do
`gem build win32-serial.gemspec.windows`
`mv *.gem bin`
end
end