forked from dekellum/rjack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
97 lines (81 loc) · 2.02 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
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
# -*- ruby -*-
gems = %w[ tarpit
maven
slf4j
logback
mina
netty
async-httpclient
commons-pool
commons-codec
commons-dbcp
commons-dbutils
guava
httpclient-3
httpclient-4
icu
jackson
jdom
jetty
jetty-jsp
rome
jets3t
xerces
nekohtml
protobuf
jdbc-postgres
jms-spec
jms
qpid-client
zookeeper
lucene
solr ]
subtasks = %w[ clean install_deps test gem docs tag install publish_rdoc push ]
task :default => :test
# Common task idiom for the common distributive subtasks
sel_tasks = Rake.application.top_level_tasks
sel_tasks << 'test' if sel_tasks.delete( 'default' )
sel_subtasks = ( subtasks & sel_tasks )
task :distribute do
Rake::Task[ :multi ].invoke( sel_subtasks.join(' ') )
end
subtasks.each do |sdt|
desc ">> Run '#{sdt}' on all gem sub-directories"
task sdt => :distribute
end
desc "Run multi['task1 tasks2'] tasks over all sub gems"
task( :multi, :subtasks ) do |t,args|
stasks = args.subtasks.split
gems.each do |dir|
Dir.chdir( dir ) do
puts ">> cd #{dir}"
sh( $0, *stasks )
end
end
end
desc "Run multish['shell command'] over all sub gem dirs"
task( :multish, :subtasks ) do |t,args|
gems.each do |dir|
Dir.chdir( dir ) do
puts ">> cd #{dir}"
sh( args.subtasks )
end
end
end
desc "Generate per-gem Gemfiles and jbundle install each"
task :generate_gemfile_per_gem do
( gems - %w[ tarpit maven ] ).each do |sname|
Dir.chdir( sname ) do
puts "=== Gemfile: #{sname} ==="
File.open( 'Gemfile', 'w' ) do |fout|
fout.write <<RUBY
# -*- ruby -*-
source :rubygems
gemspec :path => '.', :name => 'rjack-#{sname}'
RUBY
end
system "jbundle install --path /home/david/.gem --local" or
raise "Failed with #{$?}"
end
end
end