Apparently the ||= operator does not work with constants in some versions of Ruby.
[arvados.git] / Rakefile
1 lib_dir = File.expand_path('../lib', __FILE__)
2 $LOAD_PATH.unshift(lib_dir)
3 $LOAD_PATH.uniq!
4
5 require 'rubygems'
6 require 'rake'
7
8 require File.join(File.dirname(__FILE__), 'lib/google/api_client', 'version')
9
10 PKG_DISPLAY_NAME   = 'Google API Client'
11 PKG_NAME           = PKG_DISPLAY_NAME.downcase.gsub(/\s/, '-')
12 PKG_VERSION        = Google::APIClient::VERSION::STRING
13 PKG_FILE_NAME      = "#{PKG_NAME}-#{PKG_VERSION}"
14 PKG_HOMEPAGE       = 'http://code.google.com/p/google-api-ruby-client/'
15
16 RELEASE_NAME       = "REL #{PKG_VERSION}"
17
18 PKG_AUTHOR         = "Bob Aman"
19 PKG_AUTHOR_EMAIL   = "bobaman@google.com"
20 PKG_SUMMARY        = 'Package Summary'
21 PKG_DESCRIPTION    = <<-TEXT
22 The Google API Ruby Client makes it trivial to discover and access supported
23 APIs.
24 TEXT
25
26 PKG_FILES = FileList[
27     'lib/**/*', 'spec/**/*', 'vendor/**/*',
28     'tasks/**/*', 'website/**/*',
29     '[A-Z]*', 'Rakefile'
30 ].exclude(/database\.yml/).exclude(/[_\.]git$/)
31
32 RCOV_ENABLED = !!(RUBY_PLATFORM != 'java' && RUBY_VERSION =~ /^1\.8/)
33 if RCOV_ENABLED
34   task :default => 'spec:rcov'
35 else
36   task :default => 'spec'
37 end
38
39 WINDOWS = (RUBY_PLATFORM =~ /mswin|win32|mingw|bccwin|cygwin/) rescue false
40 SUDO = WINDOWS ? '' : ('sudo' unless ENV['SUDOLESS'])
41
42 Dir['tasks/**/*.rake'].each { |rake| load rake }