-
Notifications
You must be signed in to change notification settings - Fork 9
/
Rakefile
72 lines (62 loc) · 1.84 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
63
64
65
66
67
68
69
70
71
72
# frozen_string_literal: true
require_relative 'lib/jruby_art/version'
require 'erb'
MVN = Gem.win_platform? ? File.expand_path('mvnw.cmd') : File.expand_path('mvnw')
task default: %i[compile init gem test]
# depends on installed processing, with processing on path
desc 'Copy Jars'
task :init do
jogl24 = File.join(ENV['HOME'], 'jogl24')
opengl = Dir.entries(jogl24).grep(/amd64|universal|arm64/).select { |jar| jar =~ /linux|windows|macosx|ios|/ }
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 'Build gem'
task :gem do
system 'jgem build jruby_art.gemspec'
end
desc 'Compile'
task :compile do
system "#{MVN} package"
FileUtils.mv "target/jruby_art-#{JRubyArt::VERSION}.jar", 'lib'
system "#{MVN} dependency:copy"
end
desc 'pmd'
task :pmd do
sh './mvnw pmd:pmd'
end
desc 'Test'
task :test do
system 'jruby --dev test/deglut_spec_test.rb'
system 'jruby --dev test/vecmath_spec_test.rb'
system 'jruby --dev test/math_tool_test.rb'
system 'jruby --dev test/helper_methods_test.rb'
system 'jruby --dev test/aabb_spec_test.rb'
system 'jruby --dev test/create_test.rb'
system 'jruby --dev test/color_group_test.rb'
system 'jruby --dev test/fast_noise_test.rb'
system 'jruby --dev test/smooth_noise_test.rb'
home = File.expand_path('~')
FLF = '%<home>s/.jruby_art/config.yml'
config = File.exist?(format(FLF, home: home))
if config
system 'jruby test/k9_run_test.rb'
else
WNF = 'Create a config %<home>s/.jruby_art/config.yml to run sketch tests'
warn format(WNF, home: home)
end
end
desc 'JDeps Tool'
task :jdeps do
system "#{MVN} 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