From 5eaddbc6f2a4b05ac59d9e8b29d0d2226d3f2015 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 4 Feb 2017 12:30:55 +0100 Subject: [PATCH] Set up thermite --- libimagruby/Rakefile | 5 ++++- libimagruby/ext/Rakefile | 5 +++++ libimagruby/imag.gemspec | 3 +++ libimagruby/lib/imag.rb | 7 +++++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 libimagruby/ext/Rakefile diff --git a/libimagruby/Rakefile b/libimagruby/Rakefile index 43022f71..a1397441 100644 --- a/libimagruby/Rakefile +++ b/libimagruby/Rakefile @@ -1,2 +1,5 @@ require "bundler/gem_tasks" -task :default => :spec +require 'thermite/tasks' + +Thermite::Tasks.new(cargo_project_path: "..", cargo_workspace_member: "libimagruby") + diff --git a/libimagruby/ext/Rakefile b/libimagruby/ext/Rakefile new file mode 100644 index 00000000..4e097360 --- /dev/null +++ b/libimagruby/ext/Rakefile @@ -0,0 +1,5 @@ +require 'thermite/tasks' + +Thermite::Tasks.new(cargo_project_path: "..", cargo_workspace_member: "libimagruby") +task default: %w(thermite:build) + diff --git a/libimagruby/imag.gemspec b/libimagruby/imag.gemspec index c6066912..5ffa7a62 100644 --- a/libimagruby/imag.gemspec +++ b/libimagruby/imag.gemspec @@ -23,4 +23,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency "bundler", "~> 1.13" spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency 'thermite', "~> 0.11", ">= 0.11.1" + + spec.extensions << 'ext/Rakefile' end diff --git a/libimagruby/lib/imag.rb b/libimagruby/lib/imag.rb index b8c91115..d0db0d53 100644 --- a/libimagruby/lib/imag.rb +++ b/libimagruby/lib/imag.rb @@ -1,5 +1,12 @@ #!/usr/bin/env ruby +require 'thermite/fiddle' + +toplevel_dir = File.dirname(File.dirname(__FILE__)) +Thermite::Fiddle.load_module('init_imag', + cargo_project_path: toplevel_dir, + ruby_project_path: toplevel_dir) + module Imag IMAG_INIT_FN_NAME = 'imag_ruby_initialize'