Skip to content

Commit 6ac0e2f

Browse files
committed
Fix up packaging and rename gem.
1 parent f648a52 commit 6ac0e2f

File tree

2 files changed

+47
-42
lines changed

2 files changed

+47
-42
lines changed

Rakefile

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,23 @@
33
require "bundler/gem_tasks"
44
require "rake/testtask"
55
require "rake/extensiontask"
6+
require "rubygems/package_task"
7+
8+
GEM_NAME = 'bitmap-plus-plus'
9+
SO_NAME = 'bitmap_plus_plus'
10+
11+
gemspec = Gem::Specification.load("#{GEM_NAME}.gemspec")
612

713
# Extension task for compiling the C++ extension
814
Rake::ExtensionTask.new("bitmap_plus_plus") do |ext|
915
ext.lib_dir = "lib"
1016
end
1117

18+
# Rake task to build the default package
19+
Gem::PackageTask.new(gemspec) do |pkg|
20+
pkg.need_tar = true
21+
end
22+
1223
# Test task
1324
Rake::TestTask.new(:test) do |t|
1425
t.libs << "test"
@@ -18,22 +29,22 @@ Rake::TestTask.new(:test) do |t|
1829
t.warning = true
1930
end
2031

21-
# Make sure extension is compiled before running tests
22-
task test: :compile
23-
24-
# Default task
25-
task default: %i[compile test]
26-
27-
# Clean task
28-
CLEAN.include("lib/*.so", "lib/*.dll", "lib/*.bundle")
29-
CLEAN.include("tmp")
30-
31-
desc "Build the gem"
32-
task :gem do
33-
sh "gem build bitmap_plus_plus.gemspec"
34-
end
35-
36-
desc "Install the gem locally"
37-
task install: :gem do
38-
sh "gem install bitmap_plus_plus-*.gem"
39-
end
32+
# # Make sure extension is compiled before running tests
33+
# task test: :compile
34+
#
35+
# # Default task
36+
# task default: %i[compile test]
37+
#
38+
# # Clean task
39+
# CLEAN.include("lib/*.so", "lib/*.dll", "lib/*.bundle")
40+
# CLEAN.include("tmp")
41+
#
42+
# desc "Build the gem"
43+
# task :gem do
44+
# sh "gem build bitmap-plus-plus.gemspec"
45+
# end
46+
#
47+
# desc "Install the gem locally"
48+
# task install: :gem do
49+
# sh "gem install bitmap-plus-plus-*.gem"
50+
# end
Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
require_relative "lib/bitmap_plus_plus/version"
44

55
Gem::Specification.new do |spec|
6-
spec.name = "bitmap_plus_plus"
6+
spec.name = "bitmap-plus-plus"
77
spec.version = BitmapPlusPlus::VERSION
88
spec.authors = ["Charlie Savage"]
99
spec.email = ["cfis@savagexi.com"]
10-
1110
spec.summary = "Ruby bindings for BitmapPlusPlus, a simple C++ bitmap library"
1211
spec.description = <<~DESC
1312
BitmapPlusPlus is a Ruby gem that provides bindings to the BitmapPlusPlus C++ library
@@ -25,28 +24,23 @@ Gem::Specification.new do |spec|
2524
"documentation_uri" => "https://github.com/cfis/bitmap_plus_plus-ruby#readme",
2625
"source_code_uri" => "https://github.com/cfis/bitmap_plus_plus-ruby"
2726
}
28-
29-
spec.files = Dir[
30-
"CHANGELOG.md",
31-
"LICENSE",
32-
"README.md",
33-
"CMakeLists.txt",
34-
"CMakePresets.json",
35-
"ext/bitmap_plus_plus/*.cpp",
36-
"ext/bitmap_plus_plus/*.hpp",
37-
"ext/bitmap_plus_plus/extconf.rb",
38-
"ext/bitmap_plus_plus/CMakeLists.txt",
39-
"lib/**/*.rb",
40-
"sig/**/*.rbs",
41-
"examples/*.rb"
42-
]
43-
4427
spec.require_paths = ["lib"]
45-
spec.extensions = ["ext/bitmap_plus_plus/extconf.rb"]
46-
47-
#spec.add_dependency "rice", ">= 4.8"
48-
49-
spec.add_development_dependency "minitest", "~> 5.0"
28+
spec.extensions = ["ext/CMakeLists.txt"]
29+
spec.add_development_dependency "minitest", "~> 5.0"
5030
spec.add_development_dependency "rake", "~> 13.0"
5131
spec.add_development_dependency "rake-compiler", "~> 1.2"
32+
33+
spec.files = Dir[
34+
"CHANGELOG.md",
35+
"LICENSE",
36+
"README.md",
37+
"examples/*.*",
38+
"ext/CMakeLists.txt",
39+
"ext/CMakePresets.json",
40+
"ext/*.cpp",
41+
"ext/*.hpp",
42+
"ext/CMakeLists.txt",
43+
"lib/**/*.rb",
44+
"sig/**/*.rbs",
45+
]
5246
end

0 commit comments

Comments
 (0)