-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
136 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,126 @@ | ||
# -*- encoding: utf-8 -*- | ||
require 'fileutils' | ||
|
||
PRWD = File.expand_path(__dir__) | ||
|
||
desc 'run contributed samples' | ||
task :default => [:all] | ||
task default: [:all] | ||
|
||
desc 'run all autorun samples except hype' | ||
task :all do | ||
Rake::Task[:contributed].execute | ||
Rake::Task[:vecmath].execute | ||
Rake::Task[:shaders].execute | ||
Rake::Task[:slider].execute | ||
Rake::Task[:demo].execute | ||
end | ||
|
||
desc 'run contributed samples' | ||
task :contributed do | ||
sh "cd #{PRWD}/contributed && rake" | ||
FileUtils.cd(File.join(PRWD, 'contributed')) | ||
system 'rake' | ||
end | ||
|
||
desc 'shaders' | ||
task :shaders do | ||
sh "cd #{PRWD}/processing_app/topics/shaders && rake" | ||
end | ||
|
||
desc 'PixelFlow' | ||
task :pixel_flow do | ||
sh "cd #{PRWD}/external_library/java/pixel_flow && rake" | ||
desc 'run graphics demo' | ||
task :demos do | ||
FileUtils.cd( | ||
File.join(PRWD, | ||
'processing_app', | ||
'demos', | ||
'graphics' | ||
) | ||
) | ||
system 'rake' | ||
end | ||
|
||
desc 'vecmath' | ||
desc 'run vecmath samples' | ||
task :vecmath do | ||
sh "cd #{PRWD}/processing_app/library/vecmath/vec2d && rake" | ||
sh "cd #{PRWD}/processing_app/library/vecmath/vec3d && rake" | ||
sh "cd #{PRWD}/processing_app/library/vecmath/arcball && rake" | ||
%w[vec2d vec3d arcball].each do |folder| | ||
FileUtils.cd( | ||
File.join( | ||
PRWD, | ||
'processing_app', | ||
'library', | ||
'vecmath', | ||
folder | ||
) | ||
) | ||
system 'rake' | ||
end | ||
end | ||
|
||
desc 'hype' | ||
task :hype do | ||
sh "cd #{PRWD}/external_library/java/hype && rake" | ||
desc 'run shader samples' | ||
task :shaders do | ||
FileUtils.cd( | ||
File.join( | ||
PRWD, | ||
'processing_app', | ||
'topics', | ||
'shaders' | ||
) | ||
) | ||
system 'rake' | ||
end | ||
|
||
desc 'slider' | ||
task :slider do | ||
sh "cd #{PRWD}/processing_app/library/slider && rake" | ||
desc 'run Hype Processing samples' | ||
task :hype do | ||
FileUtils.cd( | ||
File.join( | ||
PRWD, | ||
'external_library', | ||
'java', | ||
'hype' | ||
) | ||
) | ||
system 'rake' | ||
end | ||
|
||
desc 'geomerative' | ||
task :geomerative do | ||
sh "cd #{PRWD}/external_library/gem/geomerative && rake" | ||
desc 'run WordCram samples' | ||
task :wordcram do | ||
FileUtils.cd( | ||
File.join( | ||
PRWD, | ||
'external_library', | ||
'gem', | ||
'ruby_wordcram' | ||
) | ||
) | ||
system 'rake' | ||
end | ||
|
||
desc 'hemesh' | ||
task :hemesh do | ||
sh "cd #{PRWD}/external_library/java/hemesh && rake" | ||
FileUtils.cd( | ||
File.join( | ||
PRWD, | ||
'external_library', | ||
'java', | ||
'hemesh' | ||
) | ||
) | ||
system 'rake' | ||
end | ||
|
||
desc 'pbox2d' | ||
task :pbox2d do | ||
sh "cd #{PRWD}/external_library/gem/pbox2d && rake" | ||
sh "cd #{PRWD}/external_library/gem/pbox2d/revolute_joint && jruby revolute_joint.rb" | ||
sh "cd #{PRWD}/external_library/gem/pbox2d/test_contact && jruby test_contact.rb" | ||
sh "cd #{PRWD}/external_library/gem/pbox2d/mouse_joint && jruby mouse_joint.rb" | ||
sh "cd #{PRWD}/external_library/gem/pbox2d/distance_joint && jruby distance_joint.rb" | ||
end | ||
|
||
desc 'wordcram' | ||
task :wordcram do | ||
sh "cd #{PRWD}/external_library/gem/ruby_wordcram && rake" | ||
FileUtils.cd( | ||
File.join( | ||
PRWD, | ||
'external_library', | ||
'gem', | ||
'pbox2d' | ||
) | ||
) | ||
system 'rake' | ||
%w[revolute_joint test_contact mouse_joint distance_joint].each do |folder| | ||
FileUtils.cd( | ||
File.join( | ||
PRWD, | ||
'external_library', | ||
'gem', | ||
'pbox2d', | ||
folder | ||
) | ||
) | ||
system "k9 -r #{folder}.rb" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,18 @@ | ||
# Simple demo Rakefile to autorun samples in current directory | ||
# adjust path to rp5 executable, and or opts as required | ||
|
||
SAMPLES_DIR = './' | ||
|
||
desc 'run demo' | ||
task default: [:demo] | ||
|
||
desc 'demo' | ||
task :demo do | ||
samples_list.shuffle.each{ |sample| run_sample sample } | ||
samples_list.shuffle.each { |sample| run_sample sample } | ||
end | ||
|
||
def samples_list | ||
files = [] | ||
Dir.chdir(SAMPLES_DIR) | ||
Dir.glob('*.rb').each do |file| | ||
files << File.join(SAMPLES_DIR, file) | ||
end | ||
return files | ||
Dir.glob('*.rb').map { |file| File.join(__dir__, file) } | ||
end | ||
|
||
def run_sample(sample_name) | ||
puts "Running #{sample_name}...quit to run next sample" | ||
open("|jruby #{sample_name}", 'r') do |io| | ||
while l = io.gets | ||
puts(l.chop) | ||
end | ||
end | ||
system "jruby --dev #{sample_name}" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,18 @@ | ||
# Simple demo Rakefile to autorun samples in current directory | ||
# adjust path to k9 executable, and or opts as required | ||
|
||
SAMPLES_DIR="./" | ||
|
||
desc 'run demo' | ||
task :default => [:demo] | ||
task default: [:demo] | ||
|
||
desc 'demo' | ||
task :demo do | ||
samples_list.shuffle.each{|sample| run_sample sample} | ||
samples_list.shuffle.each { |sample| run_sample sample } | ||
end | ||
|
||
def samples_list | ||
files = [] | ||
Dir.chdir(SAMPLES_DIR) | ||
Dir.glob("*.rb").each do |file| | ||
files << File.join(SAMPLES_DIR, file) | ||
end | ||
return files | ||
Dir.glob('*.rb').map { |file| File.join(__dir__, file) } | ||
end | ||
|
||
def run_sample(sample_name) | ||
puts "Running #{sample_name}...quit to run next sample" | ||
open("|jruby #{sample_name}", "r") do |io| | ||
while l = io.gets | ||
puts(l.chop) | ||
end | ||
end | ||
system "jruby --dev #{sample_name}" | ||
end |
Oops, something went wrong.