3 # Licensed to the Apache Software Foundation (ASF) under one
4 # or more contributor license agreements. See the NOTICE file
5 # distributed with this work for additional information
6 # regarding copyright ownership. The ASF licenses this file
7 # to you under the Apache License, Version 2.0 (the
8 # "License"); you may not use this file except in compliance
9 # with the License. You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing,
14 # software distributed under the License is distributed on an
15 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 # KIND, either express or implied. See the License for the
17 # specific language governing permissions and limitations
20 require "bundler/gem_helper"
24 base_dir = File.join(__dir__)
26 helper = Bundler::GemHelper.new(base_dir)
30 release_task = Rake::Task["release"]
31 release_task.prerequisites.replace(["build", "release:rubygem_push"])
33 def run_extconf(build_dir, extension_dir, *arguments)
35 ruby(File.join(extension_dir, "extconf.rb"),
40 spec.extensions.each do |extension|
41 extension_dir = File.join(base_dir, File.dirname(extension))
42 build_dir = ENV["BUILD_DIR"]
44 build_dir = File.join(build_dir, "red-arrow")
47 build_dir = extension_dir
49 CLOBBER << File.join(build_dir, "Makefile")
50 CLOBBER << File.join(build_dir, "mkmf.log")
52 makefile = File.join(build_dir, "Makefile")
53 file makefile => build_dir do
54 run_extconf(build_dir, extension_dir)
58 task :configure => build_dir do
59 run_extconf(build_dir, extension_dir)
63 task :compile => makefile do
71 sh("make", "clean") if File.exist?("Makefile")
79 ruby("test/run-test.rb")
87 benchmarks = if ENV["BENCHMARKS"]
88 ENV["BENCHMARKS"].split
90 FileList["benchmark/{,*/**/}*.yml"]
93 benchmarks.each do |benchmark|
94 sh("benchmark-driver", benchmark)
99 YARD::Rake::YardocTask.new do |task|