-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
62 lines (51 loc) · 1.36 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
52
53
54
55
56
57
58
59
60
61
62
# frozen_string_literal: true
require_relative './lib/picrate/version'
HOME_DIR = ENV['HOME']
task default: %i[init compile install test gem]
# Currently depends on local jogl-2.4.0 jars on path ~/jogl24
desc 'Copy Jars'
task :init do
jogl24 = File.join(HOME_DIR, 'jogl24')
opengl = Dir.entries(jogl24).grep(/amd64|armv6hf|aarch64/).select { |jar| jar =~ /linux/ }
opengl.concat %w[jogl-all.jar gluegen-rt.jar]
opengl.each do |gl|
FileUtils.cp(File.join(jogl24, gl), File.join('.', 'lib'))
end
end
desc 'Install'
task :install do
sh "mvn dependency:copy"
FileUtils.mv "target/picrate-#{PiCrate::VERSION}.jar", 'lib'
end
desc 'Gem'
task :gem do
system 'jruby -S gem build picrate.gemspec'
end
desc 'Document'
task :javadoc do
system './mvnw javadoc:javadoc'
end
desc 'Compile'
task :compile do
system './mvnw package'
end
desc 'Test'
task :test do
system 'jruby --dev test/helper_methods_test.rb'
system 'jruby --dev test/respond_to_test.rb' # Skip this test on Travis etc
system 'jruby --dev test/math_tool_test.rb'
system 'jruby --dev test/deglut_spec_test.rb'
system 'jruby --dev test/vecmath_spec_test.rb'
end
desc 'JDeps Tool'
task :jdeps do
system './mvnw jdeps:jdkinternals'
end
desc 'clean'
task :clean do
Dir['./**/*.{jar,gem}'].each do |path|
puts "Deleting #{path} ..."
File.delete(path)
end
FileUtils.rm_rf('./target')
end