-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRakefile
More file actions
20 lines (16 loc) · 689 Bytes
/
Rakefile
File metadata and controls
20 lines (16 loc) · 689 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require "bundler/gem_tasks"
Rake.add_rakelib './tasks'
WINDOWS = (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
PROTOC_PLUGIN_PATH = File.join Gem.bindir, "protoc-gen-ruby#{if WINDOWS then '.bat' else '' end}"
PROTO_DIR = './lib/aquae/protos'
PROTOS = Rake::FileList['metadata.pb.rb', 'messaging.pb.rb', 'transport.pb.rb'].pathmap("#{PROTO_DIR}/%f")
task :default => :protos
directory PROTO_DIR
task :protos => [PROTO_DIR, *PROTOS]
rule '.pb.rb' do |p|
sh 'protoc',
"../pde-specification/#{p.name.pathmap('%{.pb,}n')}.proto",
'-I', '../pde-specification/',
"--ruby2_out=#{p.name.pathmap('%d')}",
"--plugin=protoc-gen-ruby2=#{PROTOC_PLUGIN_PATH}"
end