-
Notifications
You must be signed in to change notification settings - Fork 94
/
Rakefile
52 lines (45 loc) · 1.14 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
require_relative 'lib/ruby-processing/version'
def create_manifest
title = 'Implementation-Title: rpextras (java extension for ruby-processing)'
version = format('Implementation-Version: %s', RubyProcessing::VERSION)
file = File.open('MANIFEST.MF', 'w') do |f|
f.puts(title)
f.puts(version)
end
end
task :default => [:init, :compile, :test, :gem]
desc 'Create Manifest'
task :init do
create_manifest
end
desc 'Build gem'
task :gem do
sh 'gem build ruby-processing.gemspec'
end
desc 'Compile'
task :compile do
sh 'mvn package'
sh 'mv target/rpextras.jar lib'
end
desc 'Test'
task :test do
sh 'jruby test/vecmath_spec_test.rb'
sh 'jruby test/deglut_spec_test.rb'
sh 'jruby test/math_tool_test.rb'
home = File.expand_path('~')
config = File.exist?(format('%s/.rp5rc', home))
if config
sh 'jruby test/helper_methods_test.rb'
ruby 'test/rp5_run_test.rb'
else
warn format('You should create %s/.rp5rc to run sketch tests', home)
end
end
desc 'Clean'
task :clean do
Dir['./**/*.%w{jar gem}'].each do |path|
puts format('Deleting %s ...', path)
File.delete(path)
end
FileUtils.rm_rf('./tmp')
end