-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
37 lines (29 loc) · 947 Bytes
/
Rakefile
File metadata and controls
37 lines (29 loc) · 947 Bytes
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
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "rake"
require "rake/javaextensiontask"
RSpec::Core::RakeTask.new(:spec)
require "rubocop/rake_task"
RuboCop::RakeTask.new
task default: %i[build spec]
Rake::JavaExtensionTask.new do |ext|
ext.name = "get_long_value"
ext.ext_dir = "src"
ext.lib_dir = "lib"
ext.target_version = ENV['TARGET_VERSION'] if ENV['TARGET_VERSION']
ext.source_version = ENV['SOURCE_VERSION'] if ENV['SOURCE_VERSION']
end
desc 'Build the gem'
task :build => [ :clean_all, :compile ] do
command = [ 'gem', 'build' ]
command << "--output=#{ENV['GEM_FILE_NAME']}" if ENV['GEM_FILE_NAME']
command << ( ENV['GEMSPEC'] || 'get_long_value.gemspec' )
puts command
system(*command)
end
task :clean_all => :clean do
%w[ get_long_value.jar get_long_value.bundle ].each do |file|
FileUtils.rm_f(File.join(File.dirname(__FILE__), 'lib', file))
end
end