-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
50 lines (39 loc) · 1.05 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
# -*- coding: utf-8 -*-
dir = File.expand_path('../', __FILE__)
bin = File.join(dir, '/vendor/bin')
composer = "#{bin}/composer.phar"
phpunit = "#{bin}/phpunit"
report = "#{dir}/build/report"
report_coverage = "#{report}/coverage"
log_dir = "#{dir}/build/logs"
log_coverage = "build/logs/clover.xml"
task :default => %(setup)
desc 'Setup application'
task :setup => %w(vendor:setup composer:setup composer:install)
desc 'Run composer'
task :composer => %w(composer:setup composer:update)
namespace :vendor do
task :setup do
FileUtils.mkdir_p(bin) unless FileTest.directory?(bin)
end
end
namespace :composer do
desc 'Setup composer'
task :setup do
unless FileTest.file?(composer)
sh "curl -sS https://getcomposer.org/installer | " +
"php -- --install-dir=#{bin}"
end
end
desc 'Run composer install'
task :install do
unless FileTest.file?(phpunit)
sh "#{composer} install"
end
end
desc 'Update composer'
task :update => %(composer:install)
task :update do
sh "#{composer} self-update"
end
end