This repository has been archived by the owner on Oct 1, 2023. It is now read-only.
generated from ParadoxV5/template-ruby-gem
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
68 lines (57 loc) · 1.8 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# frozen_string_literal: true
# Building Tasks #
require_relative 'lib/ffi/uctags/directory'
src = File.join(FFI::UCtags::EXE_ROOT, 'src')
steps = {
File.join(src, 'configure') => './autogen.sh',
File.join(src, 'Makefile') => %W[./configure
--prefix=#{FFI::UCtags::EXE_ROOT}
--disable-readcmd
--disable-xml
--disable-json
--disable-seccomp
--disable-yaml
--disable-pcre2
--without-included-regex
],
FFI::UCtags::EXE_PATH =>
"#{ENV.fetch('MAKE') do
require 'etc'
"make -j #{Etc.nprocessors/2 + 1}"
end} install"
}
steps.each do|filepath, command|
file(filepath) { sh(*command, chdir: src) }
end
steps.each_key.each_cons(2) {|dependency, name| file name => dependency }
desc '`configure` and `make` the u-ctags submodule'
task 'u-ctags': [FFI::UCtags::EXE_PATH]
desc 'same as `rake u-ctags`'
task default: %i[u-ctags]
desc 'Reap the u-ctags sources and `bundle install`'
task :bundle do
if File.exist? '.git' # Git/Hub repository
sh 'git submodule deinit --force u-ctags'
sh 'git config submodule.u-ctags.active false'
else # Downloaded directly
puts "Clearing directory '#{src}'"
File.delete *Dir[File.join src, '**']
# Don’t delete the directory itself to match `deinit` behavior
end
sh 'bundle install'
end
desc 'same as `rake u-ctags bundle`'
task setup: %i[u-ctags bundle]
# Development Tasks #
begin
require 'minitest/test_task'
# Create the following tasks:
# * test : run tests
# * test:cmd : print the testing command
# * test:isolated : run tests independently to surface order dependencies
# * test:deps : (alias of test:isolated)
# * test:slow : run tests and reports the slowest 25
Minitest::TestTask.create
rescue LoadError
warn 'Minitest not installed. Testing tasks not available.'
end