forked from gizmomogwai/cxxproject_examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile.rb
139 lines (125 loc) · 2.99 KB
/
Rakefile.rb
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
projects = ['frazzle',
'cxxproject',
'cxx',
'cxxproject_gcctoolchain',
# 'cxxproject_clangtoolchain',
# 'cxxproject_rpitoolchain',
# 'cxxproject_fsltoolchain',
# 'cxxproject_clanganalyzer',
'cxxproject_stats',
'cxxproject_tomake',
'cxxproject_console',
'cxxproject_valgrind',
'cxxproject_gcov']
desc 'cleanup all built gems'
task :clean do
projects.each do |p|
cd "../#{p}" do
sh 'rm -rf pkg'
end
end
end
desc 'install prerequisites for build'
task :wipe_gems do
sh "rvm --force gemset empty"
end
desc 'reinstall all gems into gemset'
task :reinstall_gems => :wipe_gems do
Needed_Gems = [
'rspec',
'bundler',
'builder' # for junit report on buildserver
# 'mime-types',
# 'posix-spawn'
# 'grit',
# 'sexp_processor',
# 'ruby_parser',
# 'roodi',
# 'haml',
# 'gem-release'
]
Needed_Gems.each do |g|
sh "gem install #{g}"
end
end
desc 'install all built gems'
task :build_and_install_gems do
projects.each do |p|
cd "../#{p}" do
sh 'rm -rf pkg'
sh 'rake package'
sh 'rake install'
end
end
# sh "gem install #{FileList[projects.map{|p|"../#{p}/pkg/*.gem"}].join(' ')}"
end
desc 'setup environment'
task :environment => [:reinstall_gems, :clean, :build_and_install_gems]
desc 'bump allgems'
task :bump do
projects.each do |p|
cd "../#{p}" do
sh 'gem bump'
end
end
end
desc 'show all versions'
task :show_versions do
projects.each do |p|
cd "../#{p}", :verbose => false do
require 'gem_release'
version = GemRelease::VersionFile::new
puts "#{p} has version #{version.old_number}"
end
end
end
desc 'pushes all gems to rubygems and bumps afterwards to be safe'
task :push_gems, [:what] => [:build_and_install_gems] do |t,args|
projects_to_do = projects
projects_to_do = [args.what] if args.what
ok = ['']
failed = ['']
projects_to_do.each do |p|
cd "../#{p}" do
begin
require 'gem_release'
version = GemRelease::VersionFile.new.old_number
sh "gem push pkg/#{p}-#{version}.gem"
ok << p
sh "git tag #{version}"
sh "gem bump"
rescue Exception => e
failed << p
puts "Problems with gem #{p}"
puts e
end
end
end
puts "---------------------------"
puts "RESULTS"
puts "---------------------------"
puts "Sucessfully pushed gems:#{ok.join("\n ")}"
puts "Failed to push gems :#{failed.join("\n ")}"
if failed.size == 0
puts "pushing tags"
sh "repo forall -c git push --tags"
end
end
task :default => :build_and_install_gems
task :test do |t, args|
p args
cd '../cxxproject' do
sh 'gem bump'
end
end
desc 'prepare for acceptance tests'
task :prepare_accept => [:environment]
desc 'acceptance tests'
task :accept do
cd 'basic' do
sh 'rake clean run:filter'
end
cd 'gtest' do
sh 'rake clean run:filter'
end
end