-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
51 lines (38 loc) · 1.12 KB
/
Rakefile
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rubocop/rake_task"
require "rake"
require "rake/clean"
RuboCop::RakeTask.new do |task|
task.requires << "rubocop-performance"
task.requires << "rubocop-rspec"
task.requires << "rubocop-rake"
end
desc "Build app executable inside the bin directory"
task :build_exe do
# Executables info variables
executable_names = %w[rgss-db rgssdb]
executable_content = <<~EOF
#!/usr/bin/env ruby
# frozen_string_literal: true
require_relative "../lib/rgss_db"
EOF
# Create executables
exe_dir = File.join(File.dirname(__FILE__), "bin")
mkdir_p exe_dir unless File.directory?(exe_dir)
executable_names.each do |exe_name|
exe_path = File.join(exe_dir, exe_name)
File.open(exe_path, "w") do |file|
file.puts(executable_content)
end
chmod(0o755, exe_path)
end
end
desc "Generates rbs docs with sord"
task :sord do
rbs_dir = File.join(File.dirname(__FILE__), "./sig/")
rbs_path = File.join(rbs_dir, "rgss_db.rbs")
mkdir_p rbs_dir unless File.directory?(rbs_dir)
sh "sord '#{rbs_path}' --rbs"
end
task default: :rubocop