Skip to content

Commit a2a453d

Browse files
Generate lib/cucumber/messages_pb.rb on install
1 parent 52c9375 commit a2a453d

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

cucumber-messages/ruby/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ lib/cucumber/messages_pb.rb: messages.proto
66
protoc -I. -I/usr/local/include --ruby_out lib/cucumber $<
77

88
clean:
9-
rm -f lib/cucumber/messages_pb.rb
9+
rm -f lib/cucumber/messages_pb.rb pkg/cucumber-messages-*.gem

cucumber-messages/ruby/cucumber-messages.gemspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Gem::Specification.new do |s|
1010
s.platform = Gem::Platform::RUBY
1111
s.license = "MIT"
1212
s.required_ruby_version = ">= 2.3"
13+
s.extensions = ["ext/cucumber-messages/extconf.rb".freeze]
1314

1415
s.metadata = {
1516
'bug_tracker_uri' => 'https://github.com/cucumber/cucumber/issues',
@@ -31,6 +32,7 @@ Gem::Specification.new do |s|
3132
s.files = Dir[
3233
'README.md',
3334
'LICENSE',
35+
'messages.proto',
3436
'lib/**/*'
3537
]
3638
s.test_files = Dir['spec/**/*']
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
require "mkmf"
2+
3+
find_executable('protoc')
4+
5+
File.open(File.join(Dir.pwd, 'Makefile'), 'w') do |file|
6+
file.write %Q(
7+
default:
8+
\tpushd ../.. && protoc -I. -I/usr/local/include --ruby_out lib/cucumber messages.proto && popd
9+
10+
install:
11+
\t@echo "Not much to do in fact"
12+
.PHONY: clean
13+
14+
clean:
15+
\trm ../../lib/cucumber/messages_pb.rb
16+
.PHONY: clean
17+
)
18+
end
19+
20+
$makefile_created = true

0 commit comments

Comments
 (0)