-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
43 lines (34 loc) · 1.07 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
require "bundler/setup"
APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
load "rails/tasks/engine.rake"
load "rails/tasks/statistics.rake"
require "bundler/gem_tasks"
require "rake/testtask"
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.pattern = "test/**/*_test.rb"
t.verbose = false
end
# Prepare webpack for dummy
task :prepare_assets do
system "rm -rf test/dummy/public/packs"
system "rm -rf test/dummy/public/packs-test"
system "yarn install --frozen-lockfile"
system "cd test/dummy && yarn install --frozen-lockfile"
end
# Generate dependency licenses
task :licenses do
system "bundle exec license_finder report --decisions_file reports/dependency_decisions.yml --format json --save reports/licenses.json"
end
# Custom Rails stats command
task stats: :statsetup
task :statsetup do
require "rails/code_statistics"
custom_directories = [
%w[Libraries\ tests test/lib]
]
STATS_DIRECTORIES.concat(custom_directories)
custom_test_types = %w[Libraries\ tests]
CodeStatistics::TEST_TYPES.concat(custom_test_types)
end
task default: :test