xref: /aosp_15_r20/external/protobuf/ruby/compatibility_tests/v3.0.0/Rakefile (revision 1b3f573f81763fcece89efc2b6a5209149e44ab8)
1*1b3f573fSAndroid Build Coastguard Workerrequire "rake/testtask"
2*1b3f573fSAndroid Build Coastguard Worker
3*1b3f573fSAndroid Build Coastguard Worker# Proto for tests.
4*1b3f573fSAndroid Build Coastguard Workergenproto_output = []
5*1b3f573fSAndroid Build Coastguard Workergenproto_output << "tests/generated_code.rb"
6*1b3f573fSAndroid Build Coastguard Workergenproto_output << "tests/test_import.rb"
7*1b3f573fSAndroid Build Coastguard Workerfile "tests/generated_code.rb" => "tests/generated_code.proto" do |file_task|
8*1b3f573fSAndroid Build Coastguard Worker  sh "./protoc --ruby_out=. tests/generated_code.proto"
9*1b3f573fSAndroid Build Coastguard Workerend
10*1b3f573fSAndroid Build Coastguard Worker
11*1b3f573fSAndroid Build Coastguard Workerfile "tests/test_import.rb" => "tests/test_import.proto" do |file_task|
12*1b3f573fSAndroid Build Coastguard Worker  sh "./protoc --ruby_out=. tests/test_import.proto"
13*1b3f573fSAndroid Build Coastguard Workerend
14*1b3f573fSAndroid Build Coastguard Worker
15*1b3f573fSAndroid Build Coastguard Workertask :genproto => genproto_output
16*1b3f573fSAndroid Build Coastguard Worker
17*1b3f573fSAndroid Build Coastguard Workertask :clean do
18*1b3f573fSAndroid Build Coastguard Worker  sh "rm -f #{genproto_output.join(' ')}"
19*1b3f573fSAndroid Build Coastguard Workerend
20*1b3f573fSAndroid Build Coastguard Worker
21*1b3f573fSAndroid Build Coastguard WorkerRake::TestTask.new(:test => :genproto) do |t|
22*1b3f573fSAndroid Build Coastguard Worker  t.test_files = FileList["tests/*.rb"]
23*1b3f573fSAndroid Build Coastguard Workerend
24*1b3f573fSAndroid Build Coastguard Worker
25*1b3f573fSAndroid Build Coastguard Workertask :default => [:test]
26