public
Rubygem
Description: Apache Buildr
Homepage: http://incubator.apache.org/buildr
Clone URL: git://github.com/vic/buildr.git
commit  a97453f8f34cff911a4baf5955664afe76d3b21a
tree    0bb59e819f19f7a90795558dcff0f7f1a3446337
parent  31abc5e668afa322f5ca04b47e78add3f7e03125
buildr / Rakefile
100644 65 lines (53 sloc) 2.31 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
 
 
require 'rake/gempackagetask'
 
 
def spec(platform = nil)
  @specs ||= {}
  platform ||= RUBY_PLATFORM =~ /java/ ? 'java' : 'ruby'
  @specs[platform] ||= begin
    spec = Gem::Specification.load(File.join(File.dirname(__FILE__), 'buildr.gemspec'))
    spec.platform = platform
    if platform =~ /java/
      spec.add_dependency 'jruby-openssl', '~> 0.2'
      spec.add_dependency 'ci_reporter', '~> 1.5'
    else
      spec.add_dependency 'rjb', '~>1.1'
    end
    spec
  end
end
 
 
desc 'Compile Java libraries used by Buildr'
task 'compile' do
  puts 'Compiling Java libraries ...'
  sh Config::CONFIG['ruby_install_name'], '-Ilib', '-Iaddon', 'bin/buildr', 'compile'
  puts 'OK'
end
file Rake::GemPackageTask.new(spec).package_dir=>'compile'
file Rake::GemPackageTask.new(spec).package_dir_path=>'compile'
 
# We also need the other package (JRuby if building on Ruby, and vice versa)
Rake::GemPackageTask.new spec(RUBY_PLATFORM =~ /java/ ? 'ruby' : 'java') do |task|
  # Block necessary otherwise doesn't do full job.
end
 
 
ENV['incubating'] = 'true'
ENV['staging'] = "people.apache.org:~/public_html/#{spec.name}/#{spec.version}"
 
task 'apache:license'=>spec.files
task('apache:license').prerequisites.exclude('doc/css/syntax.css')
 
task 'spec:check' do
  print 'Checking that we have JRuby, Scala and Groovy available ... '
  fail 'Full testing requires JRuby!' unless which('jruby')
  fail 'Full testing requires Scala!' unless which('scala')
  fail 'Full testing requires Groovy!' unless which('groovy')
  puts 'OK'
end