Skip to content

Commit

Permalink
split files into subfolders for packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Nov 13, 2024
1 parent 2963888 commit 772b958
Show file tree
Hide file tree
Showing 307 changed files with 120 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
ruby: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3', 'head']
steps:
- uses: actions/checkout@v4
- run: .\install-glfw.ps1
- run: .\mittsu-renderer-opengl\install-glfw.ps1
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/.bundle/
/.yardoc
/Gemfile.lock
**/Gemfile.lock
/_yardoc/
/coverage/
**/coverage/
/doc/
/pkg/
/spec/reports/
Expand Down
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
source 'https://rubygems.org'

gemspec name: "mittsu-core"
gem "mittsu-core", path: "./mittsu-core"
gem "mittsu-renderer-opengl", path: "./mittsu-renderer-opengl"
gemspec

if /darwin/ === RUBY_PLATFORM
gem 'ffi', '~> 1.9', '!= 1.11.1'
Expand Down
21 changes: 16 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
require "bundler/gem_tasks"
require 'rake/testtask'

Rake::TestTask.new do |t|
t.libs << "test"
t.pattern = "test/**/test_*.rb"
t.warning = false
task :test do
FileList["mittsu-*/Rakefile"].each do |project|
# clear current tasks
Rake::Task.clear
#load tasks from this project
load project
if !Rake::Task.task_defined?(:test)
puts "No test task defined in #{project}, aborting!"
exit -1
else
dir = project.pathmap("%d")
Dir.chdir(dir) do
system "bundle exec rake test"
end
end
end
end
16 changes: 2 additions & 14 deletions lib/mittsu.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,2 @@
require "mittsu/utils"
require "mittsu/version"
require "mittsu/math"
require "mittsu/core"
require "mittsu/cameras"
require "mittsu/extras"
require "mittsu/lights"
require "mittsu/loaders"
require "mittsu/materials"
require "mittsu/objects"
require "mittsu/renderers"
require "mittsu/scenes"
require "mittsu/textures"
require "mittsu/constants"
require "mittsu-core"
require "mittsu-renderer-opengl"
8 changes: 8 additions & 0 deletions mittsu-core/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require "bundler/gem_tasks"
require 'rake/testtask'

Rake::TestTask.new do |t|
t.libs << "test"
t.pattern = "test/**/test_*.rb"
t.warning = false
end
12 changes: 12 additions & 0 deletions mittsu-core/lib/mittsu-core.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require "mittsu/utils"
require "mittsu/math"
require "mittsu/core"
require "mittsu/cameras"
require "mittsu/extras"
require "mittsu/lights"
require "mittsu/loaders"
require "mittsu/materials"
require "mittsu/objects"
require "mittsu/scenes"
require "mittsu/textures"
require "mittsu/constants"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions mittsu-core.gemspec → mittsu-core/mittsu-core.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'mittsu/version'
require_relative '../lib/mittsu/version'

Gem::Specification.new do |spec|
spec.name = "mittsu-core"
Expand All @@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
"bug_tracker" => "https://github.com/danini-the-panini/mittsu/issues"
}

spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{(^(test|examples|renderers)/|\.sh$)}) }
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{(^(test)/|\.sh$)}) }
spec.require_paths = ["lib"]

spec.required_ruby_version = '>= 2.0.0'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
add_group 'Materials', 'lib/mittsu/materials'
add_group 'Math', 'lib/mittsu/math'
add_group 'Objects', 'lib/mittsu/objects'
add_group 'Renderers', 'lib/mittsu/renderers'
add_group 'Scenes', 'lib/mittsu/scenes'
add_group 'Textures', 'lib/mittsu/textures'
end
Expand All @@ -34,7 +33,7 @@
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
require 'minitest'
Dir[__dir__ + '/support/*.rb'].each {|file| require file }
require 'mittsu'
require 'mittsu-core'

class Minitest::Test
def assert_color_equal expected, actual
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions mittsu-renderer-opengl/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source 'https://rubygems.org'

gem "mittsu-core", path: "../mittsu-core"
gemspec

if /darwin/ === RUBY_PLATFORM
gem 'ffi', '~> 1.9', '!= 1.11.1'
end
8 changes: 8 additions & 0 deletions mittsu-renderer-opengl/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require "bundler/gem_tasks"
require 'rake/testtask'

Rake::TestTask.new do |t|
t.libs << "test"
t.pattern = "test/**/test_*.rb"
t.warning = false
end
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
require 'mittsu-core'
require 'mittsu/renderers/opengl_renderer'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'mittsu/version'
require_relative '../lib/mittsu/version'

Gem::Specification.new do |spec|
spec.name = "mittsu-renderer-opengl"
Expand All @@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
"bug_tracker" => "https://github.com/danini-the-panini/mittsu/issues"
}

spec.files = `git ls-files lib/mittsu/renderers -z`.split("\x0").reject { |f| f.match(%r{(^(test|examples)/|\.sh$)}) }
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{(^(test|examples|renderers)/|\.sh$)}) }
spec.require_paths = ["lib"]

spec.required_ruby_version = '>= 2.0.0'
Expand All @@ -26,4 +26,12 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'mittsu-core', Mittsu::VERSION
spec.add_runtime_dependency 'opengl-bindings2'
spec.add_runtime_dependency 'ffi'

spec.add_development_dependency "bundler"
spec.add_development_dependency "rake"
spec.add_development_dependency 'minitest'
spec.add_development_dependency 'minitest-reporters'
spec.add_development_dependency 'pry'
spec.add_development_dependency 'benchmark-ips'
spec.add_development_dependency 'simplecov', '0.17.1'
end
38 changes: 38 additions & 0 deletions mittsu-renderer-opengl/test/minitest_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
ENV["MITTSU_ENV"] = 'test'

require 'pry'

require 'simplecov'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter
]
SimpleCov.start do
add_filter "/test/"
add_group 'Renderers', 'lib/mittsu/renderers'
end

require "minitest/reporters"
REPORTER = "#{ENV['MINITEST_REPORTER'] || 'Progress'}Reporter"
if !Minitest::Reporters.const_defined?(REPORTER)
puts "WARNING: Reporter \"#{REPORTER}\" not found, using default"
Minitest::Reporters.use!
else
Minitest::Reporters.use! Minitest::Reporters.const_get(REPORTER).new
end

$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
$LOAD_PATH.unshift File.expand_path('../../mittsu-core/lib', __dir__)
require 'minitest'
Dir[__dir__ + '/support/*.rb'].each {|file| require file }
require 'mittsu-renderer-opengl'

class Minitest::Test
def assert_color_equal expected, actual
assert_in_delta expected.r, actual.r
assert_in_delta expected.g, actual.g
assert_in_delta expected.b, actual.b
end
end

require 'minitest/autorun'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 772b958

Please sign in to comment.