-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathRakefile
More file actions
29 lines (21 loc) · 734 Bytes
/
Rakefile
File metadata and controls
29 lines (21 loc) · 734 Bytes
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
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "standard/rake"
require "rake/extensiontask"
require "rb_sys/extensiontask"
GEMSPEC = Gem::Specification.load("tiktoken_ruby.gemspec")
RbSys::ExtensionTask.new("tiktoken_ruby", GEMSPEC) do |ext|
ext.lib_dir = "lib/tiktoken_ruby"
end
RSpec::Core::RakeTask.new(:spec)
task :native, [:platform] do |_t, platform:|
sh "bundle", "exec", "rb-sys-dock", "--platform", platform, "--build"
end
task build: :compile
task default: %i[compile spec standard]
# Packaging default (non-precompiled) gem
require "rubygems/package_task"
gem_path = Gem::PackageTask.new(GEMSPEC).define
desc "Package the Ruby gem"
task "package" => [gem_path]