Class: Beni::Tasks

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/beni/tasks.rb

Overview

Rake task library exposing the beni:* namespace. Add to a Rakefile:

require "beni/tasks"

Beni::Tasks.new

or with declarations (a custom config cross-building to wasm32-wasip1):

Beni::Tasks.new do
  build_config "build_config/mruby.rb"

  target :host
  target :wasi do
    toolchain "wasi-sdk"
  end
end

The block is the declarative DSL from SPEC.md, run on DSL::Context: scalar settings (version / build_config / vendor_dir), target declarations carrying toolchain references, and top-level toolchain definitions overriding a built-in pair. Every malformed declaration raises here — no task defined, nothing downloaded.

Defined tasks:

rake beni:build           — fetch toolchains + build libmruby.a per target
rake beni:clean           — remove mruby build trees (keeps source)
rake beni:config          — generate the upstream default build config
rake beni:vendor:setup    — download & unpack the selected toolchains
rake beni:vendor:clean    — remove unpacked toolchains (keeps tarball cache)
rake beni:vendor:clobber  — remove the vendor tree entirely

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Tasks

Returns a new instance of Tasks.



45
46
47
48
49
50
51
# File 'lib/beni/tasks.rb', line 45

def initialize(&block)
  super()
  context = DSL::Context.new
  context.instance_exec(&block) if block
  @configuration = context.configuration
  define
end

Instance Attribute Details

#configurationObject (readonly)

The resolved declarations — exposed so consumers and tests can inspect what the task definitions were wired from.



43
44
45
# File 'lib/beni/tasks.rb', line 43

def configuration
  @configuration
end