-
-
Notifications
You must be signed in to change notification settings - Fork 532
/
Rakefile
45 lines (35 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
# frozen_string_literal: true
require "date"
require "json"
require "rake"
require "rake/clean"
require "yaml"
task default: :generate
desc "Generate API files"
task generate: [:formulae, :casks, :analytics, :api_samples]
desc "Dump formula data"
task :formulae do
sh "brew", "generate-formula-api"
end
CLOBBER.include FileList[%w[_data/formula _data/formula_canonical.json api/formula api/formula_tap_migrations.json api/internal formula]]
desc "Dump cask data"
task :casks do
sh "brew", "generate-cask-api"
end
CLOBBER.include FileList[%w[_data/cask _data/cask_canonical.json api/cask api/cask-source api/cask_tap_migrations.json cask]]
def setup_analytics
ENV["HOMEBREW_NO_AUTO_UPDATE"] = "1"
return if `brew tap`.include?("homebrew/formula-analytics")
sh "brew", "tap", "homebrew/formula-analytics"
end
desc "Dump analytics data"
task :analytics do
setup_analytics
sh "brew", "generate-analytics-api"
end
CLOBBER.include FileList[%w[_data/analytics api/analytics]]
desc "Update API samples"
task :api_samples do
sh "ruby", "script/generate-api-samples.rb"
end
CLOBBER.include FileList[%w[_includes/api-samples]]