forked from jruby/jruby-launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
51 lines (47 loc) · 1.71 KB
/
Rakefile
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
require 'rubygems/package_task'
require 'date'
begin
gem 'rspec'
require 'rspec/core/rake_task'
desc "Runs Java Integration Specs"
RSpec::Core::RakeTask.new
task :default => :spec
rescue LoadError
task :default do
puts "rspec 2.0.0 or higher is not installed; skipping jruby-launcher specs"
end
end
desc "Generate gemspec file"
task :gemspec => './lib/jruby-launcher.rb' do
@gemspec ||= Gem::Specification.new do |s|
load './lib/jruby-launcher.rb'
s.name = %q{jruby-launcher}
s.platform = Gem::Platform.new("java")
s.version = JRubyLauncher::VERSION
s.authors = ["Nick Sieger", "Vladimir Sizikov"]
s.date = Date.today.to_s
s.description = %q{Builds and installs a native launcher for JRuby on your system}
s.summary = %q{Native launcher for JRuby}
s.email = ["[email protected]", "[email protected]"]
s.extensions = ["extconf.rb"]
s.files = FileList["COPYING", "README.md", "Makefile", "Rakefile", "*.c", "*.cpp", "*.h", "inc/*.*", "**/*.rb", "resources/*.*"]
s.homepage = %q{http://jruby.org}
s.rubyforge_project = %q{jruby-extras}
end
end
desc "Create gem file"
task :package => [:update_version, :gemspec, :spec] do
Gem::PackageTask.new(@gemspec) do |pkg|
end
Rake::Task['gem'].invoke
end
desc "Update version.h based on information in lib/jruby-launcher.rb"
task :update_version do
load File.join(File.dirname(__FILE__), "lib", "jruby-launcher.rb")
version_file = File.join(File.dirname(__FILE__), "version.h")
version_file_content = File.read(version_file)
version_file_content.gsub! /JRUBY_LAUNCHER_VERSION\s+"[^"]+"/, "JRUBY_LAUNCHER_VERSION \"#{JRubyLauncher::VERSION}\""
File.open(version_file, "w") do |f|
f.puts version_file_content
end
end